diff --git a/packages/codemode/src/stdlib/web.ts b/packages/codemode/src/stdlib/web.ts index 75796699d43..c67db4a17bb 100644 --- a/packages/codemode/src/stdlib/web.ts +++ b/packages/codemode/src/stdlib/web.ts @@ -5,9 +5,8 @@ import { coerceToString } from "./value.js" // WebIDL DOMString conversion: a missing argument is a TypeError, anything else stringifies. const base64 = (name: "atob" | "btoa") => sync(name, (args, node) => { - if (args.length === 0) { - throw new InterpreterRuntimeError(`${name} requires 1 argument, but only 0 were provided.`, node).as("TypeError") - } + if (args.length === 0) + throw new InterpreterRuntimeError(`${name} requires 1 argument (a string)`, node).as("TypeError") const input = coerceToString(args[0]) try { return name === "atob" ? atob(input) : btoa(input)