Skip to content

Commit

Permalink
fix: remove unnecessary parameters in USVString calls (#3467)
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzlopak authored Aug 16, 2024
1 parent 271d598 commit 6ee9ccd
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion lib/web/eventsource/eventsource.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class EventSource extends EventTarget {
})
}

url = webidl.converters.USVString(url, prefix, 'url')
url = webidl.converters.USVString(url)
eventSourceInitDict = webidl.converters.EventSourceInitDict(eventSourceInitDict, prefix, 'eventSourceInitDict')

this.#dispatcher = eventSourceInitDict.dispatcher
Expand Down
20 changes: 10 additions & 10 deletions lib/web/fetch/formdata.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ class FormData {

// 1. Let value be value if given; otherwise blobValue.

name = webidl.converters.USVString(name, prefix, 'name')
name = webidl.converters.USVString(name)
value = isBlobLike(value)
? webidl.converters.Blob(value, prefix, 'value', { strict: false })
: webidl.converters.USVString(value, prefix, 'value')
: webidl.converters.USVString(value)
filename = arguments.length === 3
? webidl.converters.USVString(filename, prefix, 'filename')
? webidl.converters.USVString(filename)
: undefined

// 2. Let entry be the result of creating an entry with
Expand All @@ -61,7 +61,7 @@ class FormData {
const prefix = 'FormData.delete'
webidl.argumentLengthCheck(arguments, 1, prefix)

name = webidl.converters.USVString(name, prefix, 'name')
name = webidl.converters.USVString(name)

// The delete(name) method steps are to remove all entries whose name
// is name from this’s entry list.
Expand All @@ -74,7 +74,7 @@ class FormData {
const prefix = 'FormData.get'
webidl.argumentLengthCheck(arguments, 1, prefix)

name = webidl.converters.USVString(name, prefix, 'name')
name = webidl.converters.USVString(name)

// 1. If there is no entry whose name is name in this’s entry list,
// then return null.
Expand All @@ -94,7 +94,7 @@ class FormData {
const prefix = 'FormData.getAll'
webidl.argumentLengthCheck(arguments, 1, prefix)

name = webidl.converters.USVString(name, prefix, 'name')
name = webidl.converters.USVString(name)

// 1. If there is no entry whose name is name in this’s entry list,
// then return the empty list.
Expand All @@ -111,7 +111,7 @@ class FormData {
const prefix = 'FormData.has'
webidl.argumentLengthCheck(arguments, 1, prefix)

name = webidl.converters.USVString(name, prefix, 'name')
name = webidl.converters.USVString(name)

// The has(name) method steps are to return true if there is an entry
// whose name is name in this’s entry list; otherwise false.
Expand All @@ -135,12 +135,12 @@ class FormData {

// 1. Let value be value if given; otherwise blobValue.

name = webidl.converters.USVString(name, prefix, 'name')
name = webidl.converters.USVString(name)
value = isBlobLike(value)
? webidl.converters.Blob(value, prefix, 'name', { strict: false })
: webidl.converters.USVString(value, prefix, 'name')
: webidl.converters.USVString(value)
filename = arguments.length === 3
? webidl.converters.USVString(filename, prefix, 'name')
? webidl.converters.USVString(filename)
: undefined

// 2. Let entry be the result of creating an entry with name, value, and
Expand Down
4 changes: 2 additions & 2 deletions lib/web/fetch/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -933,14 +933,14 @@ webidl.converters.Request = webidl.interfaceConverter(
// https://fetch.spec.whatwg.org/#requestinfo
webidl.converters.RequestInfo = function (V, prefix, argument) {
if (typeof V === 'string') {
return webidl.converters.USVString(V, prefix, argument)
return webidl.converters.USVString(V)
}

if (V instanceof Request) {
return webidl.converters.Request(V, prefix, argument)
}

return webidl.converters.USVString(V, prefix, argument)
return webidl.converters.USVString(V)
}

webidl.converters.AbortSignal = webidl.interfaceConverter(
Expand Down
4 changes: 2 additions & 2 deletions lib/web/websocket/websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class WebSocket extends EventTarget {

const options = webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'](protocols, prefix, 'options')

url = webidl.converters.USVString(url, prefix, 'url')
url = webidl.converters.USVString(url)
protocols = options.protocols

// 1. Let baseURL be this's relevant settings object's API base URL.
Expand Down Expand Up @@ -212,7 +212,7 @@ class WebSocket extends EventTarget {
}

if (reason !== undefined) {
reason = webidl.converters.USVString(reason, prefix, 'reason')
reason = webidl.converters.USVString(reason)
}

// 1. If code is present, but is neither an integer equal to 1000 nor an
Expand Down

0 comments on commit 6ee9ccd

Please sign in to comment.