diff options
| author | Kenta Moriuchi <moriken@kimamass.com> | 2023-04-30 19:24:34 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-30 12:24:34 +0200 |
| commit | 74bb09aa38e37603caf81152b48652a0d0972ccd (patch) | |
| tree | d80aed7303ef507653335808e705be10bf74b0d4 /ext | |
| parent | 59825a95b4d3952c955b8b43e174189999e35d15 (diff) | |
fix(ext/url): throw `TypeError` for empty argument (#18896)
Fixes #18893
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/url/00_url.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/url/00_url.js b/ext/url/00_url.js index d76366cfa..7f674e9aa 100644 --- a/ext/url/00_url.js +++ b/ext/url/00_url.js @@ -371,6 +371,7 @@ class URL { */ constructor(url, base = undefined) { const prefix = "Failed to construct 'URL'"; + webidl.requiredArguments(arguments.length, 1, prefix); url = webidl.converters.DOMString(url, { prefix, context: "Argument 1" }); if (base !== undefined) { base = webidl.converters.DOMString(base, { @@ -390,6 +391,7 @@ class URL { */ static canParse(url, base = undefined) { const prefix = "Failed to call 'URL.canParse'"; + webidl.requiredArguments(arguments.length, 1, prefix); url = webidl.converters.DOMString(url, { prefix, context: "Argument 1" }); if (base !== undefined) { base = webidl.converters.DOMString(base, { |
