You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
URL: URL.revokeObjectURL accepts no parameters when 1 is required #50432
An argument is considered to be an optional argument if it is declared with the optional keyword. The final argument of a variadic operation is also considered to be an optional argument. Declaring an argument to be optional indicates that the argument value can be omitted when the operation is invoked. The final argument in an operation must not explicitly be declared to be optional if the operation is variadic.
Optional arguments can also have a default value specified. If the argument’s identifier is followed by a U+003D (=) and a value (matching DefaultValue), then that gives the optional argument its default value. The implicitly optional final argument of a variadic operation must not have a default value specified. The default value is the value to be assumed when the operation is called with the corresponding argument omitted.
Activity
anonrig commentedon Oct 27, 2023
Why does it need to throw an error?
targos commentedon Oct 28, 2023
Because the parameter is not defined as optional.
KhafraDev commentedon Oct 28, 2023
relevant part of the webidl spec:
An argument is considered to be an optional argument if it is declared with the optional keyword. The final argument of a variadic operation is also considered to be an optional argument. Declaring an argument to be optional indicates that the argument value can be omitted when the operation is invoked. The final argument in an operation must not explicitly be declared to be optional if the operation is variadic.
Optional arguments can also have a default value specified. If the argument’s identifier is followed by a U+003D (=) and a value (matching DefaultValue), then that gives the optional argument its default value. The implicitly optional final argument of a variadic operation must not have a default value specified. The default value is the value to be assumed when the operation is called with the corresponding argument omitted.
KhafraDev commentedon Oct 28, 2023
from the webidl definition
there's a required param here
Fixes: nodejs#50432
url: throw error if argument length of revokeObjectURL is 0
url: throw error if argument length of revokeObjectURL is 0
url: throw error if argument length of revokeObjectURL is 0