1
0
Fork 0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-07-04 20:46:39 +02:00

Always specify correct function names

This commit is contained in:
kkapsner 2020-01-22 13:38:24 +01:00
parent 29e61ada25
commit e2efb727b9
3 changed files with 52 additions and 35 deletions

View file

@ -131,13 +131,15 @@
protectionDefinition.methods.forEach(function(method){
const descriptor = Object.getOwnPropertyDescriptor(object, method);
const original = descriptor.value;
changeProperty(object, method, "value", function method(){
const value = arguments.length?
original.call(this, ...arguments):
original.call(this);
allCallback();
return value;
});
changeProperty(object, method, "value", class {
[method](){
const value = arguments.length?
original.call(this, ...arguments):
original.call(this);
allCallback();
return value;
}
}.prototype[method]);
});
protectionDefinition.getters.forEach(function(property){
const temp = {