use unproxy instead of replacing this on the windowprxy

This commit is contained in:
velzie 2024-07-30 13:04:55 -04:00
parent 12b17bc3b4
commit 7289a329c4
No known key found for this signature in database
GPG key ID: 048413F95F0DDE1F
4 changed files with 50 additions and 41 deletions

View file

@ -24,15 +24,6 @@ export function createWindowProxy(
const value = Reflect.get(target, prop);
// this is bad! i don't know what the right thing to do is
if (typeof value === "function") {
return new Proxy(value, {
apply(_target, thisArg, argArray) {
return value.apply(self, argArray);
},
});
}
return value;
},
@ -74,14 +65,6 @@ export function createDocumentProxy(
const value = Reflect.get(target, prop);
if (typeof value === "function") {
return new Proxy(value, {
apply(_target, thisArg, argArray) {
return value.apply(self.document, argArray);
},
});
}
return value;
},
set(target, prop, newValue) {