mirror of
https://github.com/denoland/deno.git
synced 2024-12-23 15:49:44 -05:00
fix(ext/fetch): resolve TODOs about WebIDL conversions in body init (#15312)
This commit is contained in:
parent
5d263c932f
commit
519ed44ebb
2 changed files with 7 additions and 4 deletions
|
@ -452,15 +452,13 @@
|
|||
webidl.converters["BodyInit_DOMString"] = (V, opts) => {
|
||||
// Union for (ReadableStream or Blob or ArrayBufferView or ArrayBuffer or FormData or URLSearchParams or USVString)
|
||||
if (ObjectPrototypeIsPrototypeOf(ReadableStreamPrototype, V)) {
|
||||
// TODO(lucacasonato): ReadableStream is not branded
|
||||
return V;
|
||||
return webidl.converters["ReadableStream"](V, opts);
|
||||
} else if (ObjectPrototypeIsPrototypeOf(BlobPrototype, V)) {
|
||||
return webidl.converters["Blob"](V, opts);
|
||||
} else if (ObjectPrototypeIsPrototypeOf(FormDataPrototype, V)) {
|
||||
return webidl.converters["FormData"](V, opts);
|
||||
} else if (ObjectPrototypeIsPrototypeOf(URLSearchParamsPrototype, V)) {
|
||||
// TODO(lucacasonato): URLSearchParams is not branded
|
||||
return V;
|
||||
return webidl.converters["URLSearchParams"](V, opts);
|
||||
}
|
||||
if (typeof V === "object") {
|
||||
if (
|
||||
|
|
|
@ -300,6 +300,11 @@
|
|||
webidl.configurePrototype(URLSearchParams);
|
||||
const URLSearchParamsPrototype = URLSearchParams.prototype;
|
||||
|
||||
webidl.converters["URLSearchParams"] = webidl.createInterfaceConverter(
|
||||
"URLSearchParams",
|
||||
URLSearchParamsPrototype,
|
||||
);
|
||||
|
||||
const _url = Symbol("url");
|
||||
|
||||
class URL {
|
||||
|
|
Loading…
Reference in a new issue