mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 14:30:02 -04:00
don't override non event properties on window
This commit is contained in:
parent
c0c3dd1f0d
commit
98422f736d
1 changed files with 6 additions and 2 deletions
|
@ -38,7 +38,7 @@ export default function (client: ScramjetClient, self: Self) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return listener.apply(self, argArray);
|
return Reflect.apply(target, thisArg, argArray);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,11 @@ export default function (client: ScramjetClient, self: Self) {
|
||||||
const keys = Reflect.ownKeys(target);
|
const keys = Reflect.ownKeys(target);
|
||||||
|
|
||||||
for (const key of keys) {
|
for (const key of keys) {
|
||||||
if (typeof key === "string" && key.startsWith("on")) {
|
if (
|
||||||
|
typeof key === "string" &&
|
||||||
|
key.startsWith("on") &&
|
||||||
|
handlers[key.slice(2)]
|
||||||
|
) {
|
||||||
const descriptor = Object.getOwnPropertyDescriptor(target, key);
|
const descriptor = Object.getOwnPropertyDescriptor(target, key);
|
||||||
if (!descriptor.get || !descriptor.set || !descriptor.configurable)
|
if (!descriptor.get || !descriptor.set || !descriptor.configurable)
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue