mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-28 14:43:28 +00:00
allow repeated registration of event on xhr
This commit is contained in:
@@ -48,12 +48,7 @@ pub const XMLHttpRequestEventTarget = struct {
|
|||||||
listener: EventHandler.Listener,
|
listener: EventHandler.Listener,
|
||||||
) !?Function {
|
) !?Function {
|
||||||
const target = @as(*parser.EventTarget, @ptrCast(self));
|
const target = @as(*parser.EventTarget, @ptrCast(self));
|
||||||
|
const eh = (try EventHandler.register(alloc, target, typ, listener, null)) orelse return null;
|
||||||
// The only time this can return null if the listener is already
|
|
||||||
// registered. But before calling `register`, all of our functions
|
|
||||||
// remove any existing listener, so it should be impossible to get null
|
|
||||||
// from this function call.
|
|
||||||
const eh = (try EventHandler.register(alloc, target, typ, listener, null)) orelse unreachable;
|
|
||||||
return eh.callback;
|
return eh.callback;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user