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/fetch/23_request.js | |
parent | d856bfd336137e1bcf81a0db9e8ad2b418ba711e (diff) |
refactor(webidl): move prefix & context out of converters options bag (#18931)
Diffstat (limited to 'ext/fetch/23_request.js')
-rw-r--r-- | ext/fetch/23_request.js | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/ext/fetch/23_request.js b/ext/fetch/23_request.js index 22c1f8354..d3132dc62 100644 --- a/ext/fetch/23_request.js +++ b/ext/fetch/23_request.js @@ -274,14 +274,12 @@ class Request { constructor(input, init = {}) { const prefix = "Failed to construct 'Request'"; webidl.requiredArguments(arguments.length, 1, prefix); - input = webidl.converters["RequestInfo_DOMString"](input, { + input = webidl.converters["RequestInfo_DOMString"]( + input, prefix, - context: "Argument 1", - }); - init = webidl.converters["RequestInit"](init, { - prefix, - context: "Argument 2", - }); + "Argument 1", + ); + init = webidl.converters["RequestInit"](init, prefix, "Argument 2"); this[webidl.brand] = webidl.brand; @@ -501,15 +499,15 @@ webidl.converters["Request"] = webidl.createInterfaceConverter( "Request", RequestPrototype, ); -webidl.converters["RequestInfo_DOMString"] = (V, opts) => { +webidl.converters["RequestInfo_DOMString"] = (V, prefix, context, opts) => { // Union for (Request or USVString) if (typeof V == "object") { if (ObjectPrototypeIsPrototypeOf(RequestPrototype, V)) { - return webidl.converters["Request"](V, opts); + return webidl.converters["Request"](V, prefix, context, opts); } } // Passed to new URL(...) which implicitly converts DOMString -> USVString - return webidl.converters["DOMString"](V, opts); + return webidl.converters["DOMString"](V, prefix, context, opts); }; webidl.converters["RequestRedirect"] = webidl.createEnumConverter( "RequestRedirect", |