framework/js/lib/extension-utils.js

9 lines
263 B
JavaScript
Raw Normal View History

2015-04-25 20:58:39 +08:00
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));
}
};