mirror of
https://github.com/flarum/core.git
synced 2025-05-05 23:15:22 +02: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;
|
return value;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Object.assign(object[method], original);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -58,4 +60,6 @@ export function override(object, method, newMethod) {
|
|||||||
object[method] = function(...args) {
|
object[method] = function(...args) {
|
||||||
return newMethod.apply(this, [original.bind(this)].concat(args));
|
return newMethod.apply(this, [original.bind(this)].concat(args));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Object.assign(object[method], original);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user