summaryrefslogtreecommitdiff
path: root/ext/fetch/22_body.js
diff options
context:
space:
mode:
authorLeo Kettmeir <crowlkats@toaxl.com>2023-05-01 12:47:13 +0200
committerGitHub <noreply@github.com>2023-05-01 10:47:13 +0000
commitb31cf9fde6ad5398c20370c136695db77df6beeb (patch)
tree23ef5cd5d6e9342abefdc37332cc12d9bce3f245 /ext/fetch/22_body.js
parentd856bfd336137e1bcf81a0db9e8ad2b418ba711e (diff)
refactor(webidl): move prefix & context out of converters options bag (#18931)
Diffstat (limited to 'ext/fetch/22_body.js')
-rw-r--r--ext/fetch/22_body.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/fetch/22_body.js b/ext/fetch/22_body.js
index 875ec0620..82703af76 100644
--- a/ext/fetch/22_body.js
+++ b/ext/fetch/22_body.js
@@ -448,16 +448,16 @@ function extractBody(object) {
return { body, contentType };
}
-webidl.converters["BodyInit_DOMString"] = (V, opts) => {
+webidl.converters["BodyInit_DOMString"] = (V, prefix, context, opts) => {
// Union for (ReadableStream or Blob or ArrayBufferView or ArrayBuffer or FormData or URLSearchParams or USVString)
if (ObjectPrototypeIsPrototypeOf(ReadableStreamPrototype, V)) {
- return webidl.converters["ReadableStream"](V, opts);
+ return webidl.converters["ReadableStream"](V, prefix, context, opts);
} else if (ObjectPrototypeIsPrototypeOf(BlobPrototype, V)) {
- return webidl.converters["Blob"](V, opts);
+ return webidl.converters["Blob"](V, prefix, context, opts);
} else if (ObjectPrototypeIsPrototypeOf(FormDataPrototype, V)) {
- return webidl.converters["FormData"](V, opts);
+ return webidl.converters["FormData"](V, prefix, context, opts);
} else if (ObjectPrototypeIsPrototypeOf(URLSearchParamsPrototype, V)) {
- return webidl.converters["URLSearchParams"](V, opts);
+ return webidl.converters["URLSearchParams"](V, prefix, context, opts);
}
if (typeof V === "object") {
if (
@@ -465,16 +465,16 @@ webidl.converters["BodyInit_DOMString"] = (V, opts) => {
// deno-lint-ignore prefer-primordials
ObjectPrototypeIsPrototypeOf(SharedArrayBuffer.prototype, V)
) {
- return webidl.converters["ArrayBuffer"](V, opts);
+ return webidl.converters["ArrayBuffer"](V, prefix, context, opts);
}
if (ArrayBufferIsView(V)) {
- return webidl.converters["ArrayBufferView"](V, opts);
+ return webidl.converters["ArrayBufferView"](V, prefix, context, opts);
}
}
// BodyInit conversion is passed to extractBody(), which calls core.encode().
// core.encode() will UTF-8 encode strings with replacement, being equivalent to the USV normalization.
// Therefore we can convert to DOMString instead of USVString and avoid a costly redundant conversion.
- return webidl.converters["DOMString"](V, opts);
+ return webidl.converters["DOMString"](V, prefix, context, opts);
};
webidl.converters["BodyInit_DOMString?"] = webidl.createNullableConverter(
webidl.converters["BodyInit_DOMString"],