From e2210478aea1d737993aae72874929ec4601e37c Mon Sep 17 00:00:00 2001 From: Khafra <42794878+KhafraDev@users.noreply.github.com> Date: Sat, 22 Oct 2022 18:38:10 -0400 Subject: [PATCH] fix(fetch): set default param value for `Response.json` --- lib/fetch/response.js | 2 +- test/wpt/status/fetch.status.json | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/fetch/response.js b/lib/fetch/response.js index 018224bc02c..be97d67ce6f 100644 --- a/lib/fetch/response.js +++ b/lib/fetch/response.js @@ -48,7 +48,7 @@ class Response { } // https://fetch.spec.whatwg.org/#dom-response-json - static json (data, init = {}) { + static json (data = undefined, init = {}) { if (arguments.length === 0) { throw new TypeError( 'Failed to execute \'json\' on \'Response\': 1 argument required, but 0 present.' diff --git a/test/wpt/status/fetch.status.json b/test/wpt/status/fetch.status.json index c432144f217..7c37163c35a 100644 --- a/test/wpt/status/fetch.status.json +++ b/test/wpt/status/fetch.status.json @@ -23,8 +23,7 @@ ] }, "idlharness.any.js": { - "fail": [ - "Response interface: operation json(any, optional ResponseInit)", + "flaky": [ "Window interface: operation fetch(RequestInfo, optional RequestInit)" ] },