mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 06:50:01 -04:00
fix event proxy throwing when handler is null
This commit is contained in:
parent
d7c6044602
commit
881492ffff
1 changed files with 4 additions and 1 deletions
|
@ -45,10 +45,13 @@ export default function (client: ScramjetClient, self: Self) {
|
|||
|
||||
client.Proxy("EventTarget.prototype.addEventListener", {
|
||||
apply(ctx) {
|
||||
ctx.args[1] = wraplistener(ctx.args[1]);
|
||||
if (typeof ctx.args[1] === "object")
|
||||
ctx.args[1] = wraplistener(ctx.args[1]);
|
||||
},
|
||||
});
|
||||
|
||||
// TODO: removeEventListener
|
||||
|
||||
if (!iswindow) return;
|
||||
|
||||
const targets = [self.window, self.HTMLElement.prototype];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue