refactor(codemode): simplify model-facing wording (#38042)

This commit is contained in:
Aiden Cline 2026-07-21 10:19:53 -05:00 committed by GitHub
commit 8d80365ef4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 70 additions and 98 deletions

View file

@ -51,7 +51,7 @@ export const mathMethods = new Set([
])
export const invokeMathMethod = (name: string, args: Array<unknown>, node: AstNode): number => {
if (!mathMethods.has(name)) throw new InterpreterRuntimeError(`Math.${name} is not available in CodeMode.`, node)
if (!mathMethods.has(name)) throw new InterpreterRuntimeError(`Math.${name} is not available.`, node)
if (name === "random") return Math.random()
if (name === "sumPrecise") {
const items = spreadItems(args[0])
@ -151,5 +151,5 @@ export const invokeMathMethod = (name: string, args: Array<unknown>, node: AstNo
case "imul":
return Math.imul(a, b())
}
throw new InterpreterRuntimeError(`Math.${name} is not available in CodeMode.`, node)
throw new InterpreterRuntimeError(`Math.${name} is not available.`, node)
}