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,
|
||||
) !?Function {
|
||||
const target = @as(*parser.EventTarget, @ptrCast(self));
|
||||
|
||||
// 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;
|
||||
const eh = (try EventHandler.register(alloc, target, typ, listener, null)) orelse return null;
|
||||
return eh.callback;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user