File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ pub const EventTarget = struct {
114114 pub fn _removeEventListener (
115115 self : * parser.EventTarget ,
116116 typ : []const u8 ,
117- cbk : Env.Function ,
117+ listener : EventHandler.Listener ,
118118 opts_ : ? RemoveEventListenerOpts ,
119119 ) ! void {
120120 var capture = false ;
@@ -125,6 +125,8 @@ pub const EventTarget = struct {
125125 };
126126 }
127127
128+ const cbk = (try listener .callback (self )) orelse return ;
129+
128130 // check if event target has already this listener
129131 const lst = try parser .eventTargetHasListener (
130132 self ,
@@ -266,5 +268,9 @@ test "Browser.DOM.EventTarget" {
266268 .{ "content.addEventListener('he', obj1);" , null },
267269 .{ "content.dispatchEvent(new Event('he'));" , null },
268270 .{ "obj1.calls" , "1" },
271+
272+ .{ "content.removeEventListener('he', obj1);" , null },
273+ .{ "content.dispatchEvent(new Event('he'));" , null },
274+ .{ "obj1.calls" , "1" },
269275 }, .{});
270276}
You can’t perform that action at this time.
0 commit comments