framework/js/lib/extension-utils.js
2015-04-25 22:28:39 +09:30

9 lines
263 B
JavaScript

export function extend(object, func, extension) {
var oldFunc = object[func];
object[func] = function() {
var value = oldFunc.apply(this, arguments);
var args = [].slice.apply(arguments);
return extension.apply(this, [value].concat(args));
}
};