mirror of
https://github.com/denoland/deno.git
synced 2024-11-25 15:29:32 -05:00
fix(ext/response): make error, json, redirect enumerable (#16497)
This commit is contained in:
parent
fca539e65c
commit
7bd2c607dd
2 changed files with 7 additions and 7 deletions
|
@ -34,6 +34,7 @@
|
|||
const {
|
||||
ArrayPrototypeMap,
|
||||
ArrayPrototypePush,
|
||||
ObjectDefineProperties,
|
||||
ObjectPrototypeIsPrototypeOf,
|
||||
RangeError,
|
||||
RegExp,
|
||||
|
@ -287,7 +288,7 @@
|
|||
* @param {ResponseInit} init
|
||||
* @returns {Response}
|
||||
*/
|
||||
static json(data, init = {}) {
|
||||
static json(data = undefined, init = {}) {
|
||||
const prefix = "Failed to call 'Response.json'";
|
||||
data = webidl.converters.any(data);
|
||||
init = webidl.converters["ResponseInit_fast"](init, {
|
||||
|
@ -435,6 +436,11 @@
|
|||
}
|
||||
|
||||
webidl.configurePrototype(Response);
|
||||
ObjectDefineProperties(Response, {
|
||||
json: { enumerable: true },
|
||||
redirect: { enumerable: true },
|
||||
error: { enumerable: true },
|
||||
});
|
||||
const ResponsePrototype = Response.prototype;
|
||||
mixinBody(ResponsePrototype, _body, _mimeType);
|
||||
|
||||
|
|
|
@ -3173,9 +3173,6 @@
|
|||
"Request interface: new Request('about:blank') must inherit property \"isReloadNavigation\" with the proper type",
|
||||
"Request interface: new Request('about:blank') must inherit property \"isHistoryNavigation\" with the proper type",
|
||||
"Request interface: new Request('about:blank') must inherit property \"duplex\" with the proper type",
|
||||
"Response interface: operation error()",
|
||||
"Response interface: operation redirect(USVString, optional unsigned short)",
|
||||
"Response interface: operation json(any, optional ResponseInit)",
|
||||
"Response interface: attribute body",
|
||||
"Response interface: attribute bodyUsed",
|
||||
"Response interface: calling redirect(USVString, optional unsigned short) on new Response() with too few arguments must throw TypeError",
|
||||
|
@ -3206,9 +3203,6 @@
|
|||
"Request interface: new Request('about:blank') must inherit property \"isReloadNavigation\" with the proper type",
|
||||
"Request interface: new Request('about:blank') must inherit property \"isHistoryNavigation\" with the proper type",
|
||||
"Request interface: new Request('about:blank') must inherit property \"duplex\" with the proper type",
|
||||
"Response interface: operation error()",
|
||||
"Response interface: operation redirect(USVString, optional unsigned short)",
|
||||
"Response interface: operation json(any, optional ResponseInit)",
|
||||
"Response interface: attribute body",
|
||||
"Response interface: attribute bodyUsed",
|
||||
"Response interface: calling redirect(USVString, optional unsigned short) on new Response() with too few arguments must throw TypeError",
|
||||
|
|
Loading…
Reference in a new issue