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.When behavior changes, update this file and the tests in the same change. The implementation and tests remain the ultimate source of truth.
await and return through the program's implicit async-function scope.return, final top-level expression as a REPL-style result, and null when no value is produced.undefined and non-finite numbers normalized to null. Tool
arguments follow JSON serialization semantics before their schema applies (see the tools section).tools tree only.search(...) built-in: synchronous tool discovery that counts as an admitted tool call and is
shadowable by program declarations like other globals.null, undefined, booleans, finite and non-finite numbers, and strings.null and
undefined are no-ops, while arrays are rejected.NaN and Infinity globals.Symbol.iterator and
Symbol.asyncIterator keys are available only for custom iterator protocols.const, let, and accepted var declarations.for...of bindings.var declarations.let and const bindings in every lexical scope, including program/block bodies, switch bodies, and
loop headers, so reads before initialization and self- or cross-referential initializers observe the JavaScript
temporal dead zone.const { [field]: value } = record.const { length } = values.IteratorClose on early completion
or binding/default failure.if/else and conditional expressions.switch, including default clauses and fallthrough.for, while, and do...while.for...of over arrays, strings, Maps, Sets, URLSearchParams, custom synchronous iterators, and confined
synchronous generators. Abrupt completion invokes the iterator's optional return().for...in over own keys of plain objects, arrays, and tool references.break and continue.try, catch, optional catch bindings, and finally.throw with arbitrary values.break, and labeled continue.for await...of over the supported synchronous collections and custom iterator objects using
Symbol.asyncIterator or the Symbol.iterator fallback. Each iterator step is sequential, yielded promises and
plain values from synchronous collections and sync iterators are awaited before binding, and abrupt loop
completion invokes the iterator's optional return(). Custom async iterators control their yielded values, as in
JavaScript; only their next() results are awaited. Confined sync and async generators are iterable here.async functions.Array.from
mapper APIs, with one shared acceptance rule everywhere including promise reactions.Boolean, Number, String, parseInt, parseFloat, isFinite, isNaN, and URI helpers as callbacks.values.map(Math.abs), records.map(JSON.stringify),
items.forEach(console.log), and Promise.resolve(-1).then(Math.abs). Extra callback arguments a built-in
does not consume are ignored, like JS; consumed arguments stay strictly validated (Math.floor still rejects a
string). Intrinsic references keep their receiver ("abc".includes works as a predicate), unlike detached JS
methods, which lose this.Error types construct (messages.map(Error)),
and new-requiring constructors (Map, Set, URL, URLSearchParams, Promise) throw a TypeError,
like JS.Promise statics are rejected as callbacks with a hint to wrap them in an
arrow function."[object Promise]", like JavaScript; they are
not automatically awaited.thisArg of iteration methods is accepted and ignored: CodeMode functions have no this, so
ignoring it matches JS arrow-function semantics exactly.this in non-arrow CodeMode functions and callbacks.Function.prototype.call, apply, and bind for CodeMode functions.yield, and yield*, including lazy bodies,
next(value), return(value), throw(value), exhaustion, promise adoption, async request ordering,
try/catch/finally, and sync/async iterator symbols. Async yield* awaits values while adapting a sync
iterator but preserves values supplied by a manually implemented async iterator. Generator values are opaque
runtime references.Array.from, Map/Set/URLSearchParams construction, Object.fromEntries, Object/Map groupBy,
Promise combinators, AggregateError, and Math.sumPrecise. Mapper/grouping callbacks interleave with iterator
steps; synchronous consumers preserve yielded promise objects rather than awaiting them. Async generators are
rejected by every synchronous consumer.IteratorClose boundaries: consumer errors and
intentional early stops invoke return(), acquisition/next() failures do not, and an original consumer error
wins over a cleanup failure. Async iterator consumption remains limited to for await...of and async yield*.next/return/throw; finally yields and completion overrides; rejected
yielded promises; mixed async request queues; sync and async yield* forwarding; malformed methods/results;
and declaration, expression, and object-method forms with closure and parameter behavior. The adapted suite
deliberately skips Test262 variants whose observation mechanism requires unsupported getter definitions,
proxies, prototype inspection or mutation, non-arrow this, classes, or arbitrary symbols. It also skips tests
asserting exact promise reaction-turn counts beyond the observable ordering guarantee documented below. These
are interpreter-surface boundaries, not claims that the corresponding full Test262 families pass unchanged.await for CodeMode promises and callable thenables; a plain value passes through unchanged, though every
await still defers its continuation one reaction turn.new for Array, Object, Error types, Date, RegExp, Map, Set, URL, URLSearchParams, and Promise.+, -, *, /, %, and **.==, !=, ===, !==, <, <=, >, and >=.&, |, ^, ~, <<, >>, and >>>.&&, ||, ??, and !, with short-circuiting.+, unary -, void, typeof, instanceof, and own-property-only in.++ and --.await, repeated awaits, and recursive thenable assimilation when a promise or thenable is returned from
a function/program.Promise.resolve and Promise.reject.Promise.all, Promise.allSettled, Promise.race, and Promise.any over finite collections, custom synchronous
iterators, and synchronous generators containing promises and plain values.Promise.all preserves result order and rejects on the first observed failure without cancelling siblings.Promise.allSettled returns plain fulfilled/rejected outcome records.Promise.race settles from the first result without cancelling losers at settlement time.Promise.all, Promise.allSettled, and Promise.race; separately constructed
combinator batches overlap as in normal JavaScript..then, .catch, and .finally: handlers run deferred in attach order, returned
promises are adopted, handler throws reject the derived promise, .finally preserves the original settlement
unless its cleanup fails, and direct self-resolution rejects with a TypeError.await (including of plain values and already-settled promises) defers its continuation one reaction
turn, so concurrent async functions interleave at await points as in JavaScript.Promise.race. Exact microtask-count parity beyond this observable ordering is not a documented guarantee.Promise.all stragglers, and un-awaited calls alike) is
interrupted when the program returns; rejections that settled un-awaited become Success.warnings
diagnostics. A combinator abandoned inside its final settlement turn counts as pending and is interrupted
without a warning.try/catch can handle awaited tool and promise failures.Promise.any: first fulfillment wins; all-rejected rejects with an AggregateError whose errors array holds
the catch-normalized reasons in input order, and empty input rejects with an empty AggregateError.new Promise((resolve, reject) => ...): the executor runs synchronously and receives first-class resolve/reject
callables that settle the promise exactly once (they may escape the executor and settle later); an executor
throw rejects unless the promise already settled, resolving with a promise or callable thenable adopts it, and
resolving with the promise itself rejects with a TypeError. Resolver callables work anywhere callbacks are
accepted, including .then/.catch handlers and collection callbacks, but remain opaque references that cannot
cross the data boundary.then field across Promise.resolve, combinators,
constructors, reactions, finally, await, and async returns. Thenable methods run deferred, receive
first-call-wins resolve/reject functions, and ignore throws after settlement. Inherited/accessor then fields
and a JavaScript this receiver remain outside the supported object/function model.constructor, prototype, or __proto__ because paths use inert Map keys.JSON.stringify: object properties with
undefined values are dropped, undefined array elements and non-finite numbers become null, and sparse
arrays densify. Tools never receive undefined inside their input object, though a bare tools.t(undefined)
argument still reaches schema decoding as undefined. Program results keep the stricter
normalization where every undefined becomes null.Object() and new Object() return {} for nullish arguments and pass objects through unchanged;
primitive wrapper objects (Object(1)) are rejected explicitly.Object.keys, Object.values, Object.entries, Object.hasOwn, Object.assign, and Object.fromEntries, with
synchronous iterator support for fromEntries.Object.keys over arrays and tool references.__proto__, constructor, and prototype are blocked.__proto__, constructor, or prototype are rejected at JSON/tool boundaries and
cannot be created, read, or written in CodeMode; tool path segments with those names remain supported.Object.is for supported data values.Object.groupBy over finite collections and custom synchronous iterators/generators, with string-key coercion
and null-prototype results.Array constructor with or without new: Array(a, b) collects arguments and Array(n) creates a sparse
array of that length; invalid lengths throw RangeError. Iteration, spread, join, and JSON handle holes like
JavaScript, and host results normalize holes to null.Array.isArray, Array.of, and Array.from, including the Array.from mapper form with
(value, index) arguments and stepwise synchronous iterator consumption.map, filter, flatMap, and forEach.find, findIndex, findLast, findLastIndex, some, every, includes, indexOf, and
lastIndexOf.reduce and reduceRight.sort, toSorted, reverse, and toReversed.at, slice, concat, flat, with, and join.push, pop, shift, unshift, splice, fill, and copyWithin.keys, values, and entries return arrays rather than iterators.length, numeric indexing, index assignment, spread, and for...of.thisArg argument of Array.from is accepted and ignored, like JS arrows.Array.prototype.toSpliced."01" remain non-index properties rather than aliasing index
1; arbitrary array-property assignment remains unsupported.Array.prototype.sort preserves trailing holes, while toSorted densifies holes into undefined elements,
like JavaScript.toLowerCase, toUpperCase, normalize.trim, trimStart, and trimEnd.includes, startsWith, endsWith, indexOf, lastIndexOf, and search.slice, substring, at, charAt, charCodeAt, and codePointAt.split, concat, repeat, padStart, padEnd, replace, and replaceAll.match, materialized matchAll, replace, replaceAll, split, and search.localeCompare; locale and options arguments are currently ignored.toString, length, numeric indexing, spread, and for...of by Unicode code point.String.fromCharCode and String.fromCodePoint.includes(1) and slice("1") coerce like
native JS, split(undefined) returns the whole string, and includes/startsWith/endsWith reject regular
expressions with a native-style TypeError. Opaque runtime references still reject as data errors, and
repeat still requires a finite non-negative count.match(), matchAll(), and search(); all behave as an empty pattern. Present
arguments must still be a regular expression or string pattern.Number, parseInt, and parseFloat.Number.isInteger, Number.isFinite, Number.isNaN, Number.isSafeInteger,
Number.parseInt, and Number.parseFloat.toFixed, toPrecision, toExponential, toString, and valueOf.MAX_SAFE_INTEGER, MIN_SAFE_INTEGER, MAX_VALUE, MIN_VALUE, EPSILON, NaN,
POSITIVE_INFINITY, and NEGATIVE_INFINITY.PI, E, LN2, LN10, LOG2E, LOG10E, SQRT2, and SQRT1_2.random, max, min, abs, acos, acosh, asin, asinh, atan, atan2, atanh,
floor, ceil, round, trunc, sign, sqrt, cbrt, pow, hypot, cos, cosh, sin, sinh,
tan, tanh, log, log2, log10, log1p, exp, expm1, f16round, fround, clz32, and imul.Number() and String(): they produce 0 and "", while
Number(undefined) stays NaN and String(undefined) stays "undefined".++ and -- use CodeMode numeric coercion (numeric strings increment, plain data objects become NaN, Dates
use their epoch time) and reject opaque runtime references as data errors.Number/String/the coercion functions read as undefined
for feature detection. Calling any undefined value reports a native-style TypeError naming the callee, for
example Math.sum is not a function. Blocked members (constructor, __proto__, ...) still throw,
and unknown Promise statics keep their descriptive error.Math.sumPrecise over finite collections and custom synchronous iterators/generators, rejecting non-number
elements without coercion.isFinite and isNaN; opaque runtime references reject as data errors, like Number(...).JSON.parse and JSON.stringify for supported data objects; the blocked data-key gap listed above still applies.JSON.stringify.JSON.parse reviver callbacks, including postorder traversal, deletion through undefined, and root replacement.
Revivers receive (key, value) but no this holder because CodeMode functions intentionally have no this.JSON.stringify function and array replacers. Function replacers receive (key, value) in preorder, including
the root, but no this holder. Array replacers preserve requested property order, deduplicate names, coerce
number primitives, and ignore non-string/non-number entries. Primitive wrapper entries remain unsupported.__proto__, constructor,
or prototype is rejected before callback traversal.console.log, console.info, console.debug, console.warn, and console.error.console.dir and console.table.Date.now, Date.parse, and Date.UTC.new Date() from the current time, epoch milliseconds, a date string, another Date, or local components.Date() without new returns the current time as a string, like JS, but in deterministic ISO format
rather than the host's locale/timezone string.getTime, valueOf, toISOString, toJSON, and deterministic ISO toString.getFullYear, getMonth, getDate, getDay, getHours, getMinutes, getSeconds, and
getMilliseconds.getUTCFullYear, getUTCMonth, getUTCDate, getUTCDay, getUTCHours, getUTCMinutes,
getUTCSeconds, and getUTCMilliseconds.getTimezoneOffset, arithmetic, relational comparison, and instanceof Date.null.TimeClip behavior.Date.prototype.toUTCString and its toGMTString alias.RangeError branding for invalid toISOString() calls.RegExp(pattern, flags) construction, with or without new.test, exec, and toString.source, flags, lastIndex, hasIndices, global, ignoreCase, multiline, sticky, unicode,
unicodeSets, and dotAll..index, and stateful global matching.lastIndex.indices metadata for the d flag, including named groups on exec, match, and matchAll results.RegExp.escape.Map.groupBy over finite collections and custom synchronous iterators/generators, preserving key identity.new Map() from synchronous iterables of entries.get, set, has, delete, clear, size, and forEach.new Set() from synchronous iterables.add, has, delete, clear, size, and forEach.keys, values, and entries arrays for Map and Set.for...of, Array.from, and Object.fromEntries integration.{} at host/JSON boundaries.union, intersection, difference, symmetricDifference, isSubsetOf,
isSupersetOf, and isDisjointFrom, including supported Set-like operands.encodeURI, encodeURIComponent, decodeURI, and decodeURIComponent.new URL(input, base), URL.canParse, and URL.parse.toString, toJSON, and linked searchParams.href, origin, protocol, username, password, host, hostname, port,
pathname, search, and hash.origin.new URLSearchParams() from query strings, data objects, synchronous iterables of pairs, and URLSearchParams.append, delete, get, getAll, has, set, sort, forEach, keys, values,
entries, toString, and size.{}.Error, TypeError, RangeError, SyntaxError, ReferenceError, EvalError, and URIError, callable with
or without new.AggregateError with the (errors, message?) signature and an own errors array, constructed directly or by
an all-rejected Promise.any; direct construction accepts custom synchronous iterators and generators.name/message, error inheritance through instanceof, and plain-data serialization.instanceof for Date, RegExp, Map, Set, URL, URLSearchParams, Array, Object, Promise, and Error types.catch.ToolError messages.Promise.allSettled
reasons.