Allow extension of functions that may not be defined

This commit is contained in:
Toby Zerner
2015-08-05 19:20:49 +09:30
parent 4c06e78b57
commit f182689c90

View File

@ -22,7 +22,7 @@ export function extend(object, method, callback) {
const original = object[method];
object[method] = function(...args) {
const value = original.apply(this, args);
const value = original ? original.apply(this, args) : undefined;
callback.apply(this, [value].concat(args));