Skip to content

Commit cab6011

Browse files
authored
set default argument values to undefined instead of {} (#3521)
1 parent 7c1066c commit cab6011

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/web/fetch/request.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ let patchMethodWarning = false
8181
// https://fetch.spec.whatwg.org/#request-class
8282
class Request {
8383
// https://fetch.spec.whatwg.org/#dom-request
84-
constructor (input, init = {}) {
84+
constructor (input, init = undefined) {
8585
if (input === kConstruct) {
8686
return
8787
}

lib/web/fetch/response.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Response {
4141
}
4242

4343
// https://fetch.spec.whatwg.org/#dom-response-json
44-
static json (data, init = {}) {
44+
static json (data, init = undefined) {
4545
webidl.argumentLengthCheck(arguments, 1, 'Response.json')
4646

4747
if (init !== null) {
@@ -108,7 +108,7 @@ class Response {
108108
}
109109

110110
// https://fetch.spec.whatwg.org/#dom-response
111-
constructor (body = null, init = {}) {
111+
constructor (body = null, init = undefined) {
112112
if (body === kConstruct) {
113113
return
114114
}

0 commit comments

Comments
 (0)