There was an error while loading. Please reload this page.
1 parent 9b1891f commit 181428aCopy full SHA for 181428a
1 file changed
packages/codemode/src/stdlib/web.ts
@@ -5,9 +5,8 @@ import { coerceToString } from "./value.js"
5
// WebIDL DOMString conversion: a missing argument is a TypeError, anything else stringifies.
6
const base64 = (name: "atob" | "btoa") =>
7
sync(name, (args, node) => {
8
- if (args.length === 0) {
9
- throw new InterpreterRuntimeError(`${name} requires 1 argument, but only 0 were provided.`, node).as("TypeError")
10
- }
+ if (args.length === 0)
+ throw new InterpreterRuntimeError(`${name} requires 1 argument (a string)`, node).as("TypeError")
11
const input = coerceToString(args[0])
12
try {
13
return name === "atob" ? atob(input) : btoa(input)
0 commit comments