mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 23:10:02 -04:00
refactor: automatic proxy constructor
This commit is contained in:
parent
eba3e759fd
commit
80d51ed7a7
11 changed files with 192 additions and 131 deletions
|
@ -127,18 +127,21 @@ Object.defineProperty(Element.prototype, "innerHTML", {
|
|||
},
|
||||
});
|
||||
|
||||
MutationObserver.prototype.observe = new Proxy(MutationObserver.prototype.observe, {
|
||||
apply(target, thisArg, argArray) {
|
||||
if (argArray[0] === documentProxy) argArray[0] = document;
|
||||
MutationObserver.prototype.observe = new Proxy(
|
||||
MutationObserver.prototype.observe,
|
||||
{
|
||||
apply(target, thisArg, argArray) {
|
||||
if (argArray[0] === documentProxy) argArray[0] = document;
|
||||
|
||||
return Reflect.apply(target, thisArg, argArray);
|
||||
return Reflect.apply(target, thisArg, argArray);
|
||||
},
|
||||
}
|
||||
});
|
||||
);
|
||||
|
||||
document.createTreeWalker = new Proxy(document.createTreeWalker, {
|
||||
apply(target, thisArg, argArray) {
|
||||
if (argArray[0] === documentProxy) argArray[0] = document;
|
||||
|
||||
return Reflect.apply(target, thisArg, argArray);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue