diff options
author | Leo Kettmeir <crowlkats@toaxl.com> | 2023-05-01 12:47:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-01 10:47:13 +0000 |
commit | b31cf9fde6ad5398c20370c136695db77df6beeb (patch) | |
tree | 23ef5cd5d6e9342abefdc37332cc12d9bce3f245 /ext/web/02_event.js | |
parent | d856bfd336137e1bcf81a0db9e8ad2b418ba711e (diff) |
refactor(webidl): move prefix & context out of converters options bag (#18931)
Diffstat (limited to 'ext/web/02_event.js')
-rw-r--r-- | ext/web/02_event.js | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/ext/web/02_event.js b/ext/web/02_event.js index 0372293cf..e7553ea89 100644 --- a/ext/web/02_event.js +++ b/ext/web/02_event.js @@ -122,7 +122,7 @@ const isTrusted = ObjectGetOwnPropertyDescriptor({ }, }, "isTrusted").get; -const eventInitConverter = webidl.createDictionaryConverter("EventInit", [{ +webidl.converters.EventInit = webidl.createDictionaryConverter("EventInit", [{ key: "bubbles", defaultValue: false, converter: webidl.converters.boolean, @@ -167,14 +167,16 @@ class Event { 1, "Failed to construct 'Event'", ); - type = webidl.converters.DOMString(type, { - prefix: "Failed to construct 'Event'", - context: "Argument 1", - }); - const eventInit = eventInitConverter(eventInitDict, { - prefix: "Failed to construct 'Event'", - context: "Argument 2", - }); + type = webidl.converters.DOMString( + type, + "Failed to construct 'Event'", + "Argument 1", + ); + const eventInit = webidl.converters.EventInit( + eventInitDict, + "Failed to construct 'Event'", + "Argument 2", + ); this[_attributes] = { type, ...eventInit, @@ -947,13 +949,13 @@ function lazyAddEventListenerOptionsConverter() { ); } -webidl.converters.AddEventListenerOptions = (V, opts) => { +webidl.converters.AddEventListenerOptions = (V, prefix, context, opts) => { if (webidl.type(V) !== "Object" || V === null) { V = { capture: Boolean(V) }; } lazyAddEventListenerOptionsConverter(); - return addEventListenerOptionsConverter(V, opts); + return addEventListenerOptionsConverter(V, prefix, context, opts); }; class EventTarget { @@ -973,10 +975,11 @@ class EventTarget { webidl.requiredArguments(arguments.length, 2, prefix); - options = webidl.converters.AddEventListenerOptions(options, { + options = webidl.converters.AddEventListenerOptions( + options, prefix, - context: "Argument 3", - }); + "Argument 3", + ); if (callback === null) { return; |