summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2022-01-11 17:31:13 +0100
committerGitHub <noreply@github.com>2022-01-11 17:31:13 +0100
commitf3ece7457a2f87787da1d77afdd4ccec7ba03574 (patch)
tree75a5b72ebc708674134eec455af6e8592ccceb36
parent9f4e1e0d346533d9ecefc9f9ff9a1a0faf426d21 (diff)
fix(ext/web): handle no arguments in atob (#13341)
-rw-r--r--ext/web/05_base64.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/web/05_base64.js b/ext/web/05_base64.js
index e0c2a36f8..7f4b607c9 100644
--- a/ext/web/05_base64.js
+++ b/ext/web/05_base64.js
@@ -29,8 +29,10 @@
* @returns {string}
*/
function atob(data) {
+ const prefix = "Failed to execute 'atob'";
+ webidl.requiredArguments(arguments.length, 1, { prefix });
data = webidl.converters.DOMString(data, {
- prefix: "Failed to execute 'atob'",
+ prefix,
context: "Argument 1",
});