diff --git a/packages/codemode/src/interpreter/model.ts b/packages/codemode/src/interpreter/model.ts index 90cda977095..889a75b1e6b 100644 --- a/packages/codemode/src/interpreter/model.ts +++ b/packages/codemode/src/interpreter/model.ts @@ -111,7 +111,7 @@ export class InterpreterRuntimeError extends Error { // Orient the agent rather than enumerate JavaScript; interpreter-support.md is the full matrix. export const supportedSyntaxMessage = - "Programs run a JavaScript subset for calling tools: plain and async functions, data literals, destructuring, standard control flow, await/Promise, and common built-ins (Array, Object, Math, JSON, Date, RegExp, Map, Set, URL). Classes, this, getters/setters, tagged templates, BigInt, and custom Symbols are unavailable; use plain functions and data objects instead." + "This is a restricted JavaScript-like language. Supported: plain and async functions, data literals, destructuring, standard control flow, await and Promise, and built-ins such as Array, Object, Math, JSON, Date, RegExp, Map, Set, and URL. Unsupported: classes, this, getters/setters, tagged templates, BigInt, and custom Symbols. Use plain functions and data objects instead." export const unsupportedSyntax = (kind: string, node: AstNode): InterpreterRuntimeError => new InterpreterRuntimeError( diff --git a/packages/codemode/test/new-expression.test.ts b/packages/codemode/test/new-expression.test.ts index bba04c835ab..7e604357f6a 100644 --- a/packages/codemode/test/new-expression.test.ts +++ b/packages/codemode/test/new-expression.test.ts @@ -70,7 +70,11 @@ describe("new on a non-constructible callee", () => { test("classes remain unsupported syntax", async () => { const failure = await error(`class A {}; return new A()`) expect(failure.kind).toBe("UnsupportedSyntax") - expect(failure.message).toStartWith("Syntax 'ClassDeclaration' is not supported. Programs run a JavaScript subset") - expect(failure.message).toContain("Classes, this, getters/setters, tagged templates, BigInt, and custom Symbols") + expect(failure.message).toStartWith( + "Syntax 'ClassDeclaration' is not supported. This is a restricted JavaScript-like language. Supported: ", + ) + expect(failure.message).toContain( + "Unsupported: classes, this, getters/setters, tagged templates, BigInt, and custom Symbols.", + ) }) })