opencode v2 mirror
opencode packages codemode interpreter-support.md
47 kB
Markdown

CodeMode Interpreter Support #

This is the checkable support matrix for CodeMode's confined JavaScript interpreter. It tracks the language and standard-library surface that programs can use today, plus concrete gaps that may be implemented later.

  • [x] means the feature is implemented at the scope described here.
  • [ ] means a concrete compatibility gap remains.
  • Checked items do not promise complete ECMAScript edge-case parity; known differences are stated explicitly.
  • Intentional boundaries are not listed as compatibility work.

When behavior changes, update this file and the tests in the same change. The implementation and tests remain the ultimate source of truth. Upstream test262 files run verbatim from test/test262; a failing file is listed in test/test262/skipped.txt and its gap is an unchecked item here (see test/test262/README.md).

Source and execution model #

Values and literals #

Bindings and destructuring #

Statements and control flow #

Functions and callbacks #

Expressions and operators #

Promises and tools #

Objects and properties #

Arrays #

Strings #

Numbers and Math #

JSON and console #

Date #

Regular expressions #

Iterator #

Map and Set #

URL and URI helpers #

Uint8Array #

The only binary type. Bytes stay inside the program or cross to extensions as copies; the tool boundary rejects them with a hint to encode as text first (TextDecoder, toBase64, toHex).

Web platform helpers #

Extensions #

Host functions a host opts in through Extension.make({ name, globals }) and CodeMode.make({ extensions }). Nothing is exposed unless a host provides it; extension calls are not tool calls.

Errors and diagnostics #