diff --git a/framework/core/js/lib/extension-utils.js b/framework/core/js/lib/extension-utils.js index c54bcfc06..55712bace 100644 --- a/framework/core/js/lib/extension-utils.js +++ b/framework/core/js/lib/extension-utils.js @@ -1,8 +1,16 @@ export function extend(object, func, extension) { var oldFunc = object[func]; object[func] = function() { - var value = oldFunc.apply(this, arguments); var args = [].slice.apply(arguments); + var value = oldFunc.apply(this, args); return extension.apply(this, [value].concat(args)); } }; + +export function override(object, func, override) { + var parent = object[func]; + object[func] = function() { + var args = [].slice.apply(arguments); + return override.apply(this, [parent].concat(args)); + } +}