Skip to content

Commit

Permalink
fix(fetch): set default param value for Response.json (nodejs#1723)
Browse files Browse the repository at this point in the history
  • Loading branch information
KhafraDev authored and metcoder95 committed Dec 26, 2022
1 parent 10afbbf commit f188820
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/fetch/response.js
Expand Up @@ -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.'
Expand Down
3 changes: 1 addition & 2 deletions test/wpt/status/fetch.status.json
Expand Up @@ -23,8 +23,7 @@
]
},
"idlharness.any.js": {
"fail": [
"Response interface: operation json(any, optional ResponseInit)",
"flaky": [
"Window interface: operation fetch(RequestInfo, optional RequestInit)"
]
},
Expand Down

0 comments on commit f188820

Please sign in to comment.