Skip to content

Commit 181428a

Browse files
authored
fix(codemode): use Bun's wording for the missing atob/btoa argument (#48381)
1 parent 9b1891f commit 181428a

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

  • packages/codemode/src/stdlib

packages/codemode/src/stdlib/web.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ import { coerceToString } from "./value.js"
55
// WebIDL DOMString conversion: a missing argument is a TypeError, anything else stringifies.
66
const base64 = (name: "atob" | "btoa") =>
77
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-
}
8+
if (args.length === 0)
9+
throw new InterpreterRuntimeError(`${name} requires 1 argument (a string)`, node).as("TypeError")
1110
const input = coerceToString(args[0])
1211
try {
1312
return name === "atob" ? atob(input) : btoa(input)

0 commit comments

Comments
 (0)