Skip to content

Commit

Permalink
set default argument values to undefined instead of {} (#3521)
Browse files Browse the repository at this point in the history
  • Loading branch information
KhafraDev authored Aug 29, 2024
1 parent 7c1066c commit cab6011
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/web/fetch/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ let patchMethodWarning = false
// https://fetch.spec.whatwg.org/#request-class
class Request {
// https://fetch.spec.whatwg.org/#dom-request
constructor (input, init = {}) {
constructor (input, init = undefined) {
if (input === kConstruct) {
return
}
Expand Down
4 changes: 2 additions & 2 deletions lib/web/fetch/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Response {
}

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

if (init !== null) {
Expand Down Expand Up @@ -108,7 +108,7 @@ class Response {
}

// https://fetch.spec.whatwg.org/#dom-response
constructor (body = null, init = {}) {
constructor (body = null, init = undefined) {
if (body === kConstruct) {
return
}
Expand Down

0 comments on commit cab6011

Please sign in to comment.