mirror of
https://github.com/flarum/framework.git
synced 2024-11-28 03:32:49 +08:00
Copy properties when monkey-patching
This commit is contained in:
parent
92437edd1b
commit
b0da51309e
|
@ -28,6 +28,8 @@ export function extend(object, method, callback) {
|
|||
|
||||
return value;
|
||||
};
|
||||
|
||||
Object.assign(object[method], original);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -58,4 +60,6 @@ export function override(object, method, newMethod) {
|
|||
object[method] = function(...args) {
|
||||
return newMethod.apply(this, [original.bind(this)].concat(args));
|
||||
};
|
||||
|
||||
Object.assign(object[method], original);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user