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 remain subject to their schema and the outbound-handling gap listed below.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.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.if/else and conditional expressions.switch, including default clauses and fallthrough.for, while, and do...while.for...of over arrays, strings, Maps, Sets, and URLSearchParams.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 and async iteration.async functions.Array.from
mapper APIs, with one shared acceptance rule everywhere including promise reactions.Boolean, Number, String, parseInt, parseFloat, 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.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.await for CodeMode promises; 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 implicit resolution when a promise is returned from a function/program.Promise.resolve and Promise.reject.Promise.all, Promise.allSettled, Promise.race, and Promise.any over supported collections 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 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 remain plain data.constructor, prototype, or __proto__ because paths use inert Map keys.undefined and non-finite numbers in outbound tool arguments before render-only and OpenAPI tools run;
retain null normalization for program results and JSON serialization.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.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.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.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" must remain an ordinary property key rather than
aliasing index 1.Array.prototype.sort and toSorted must preserve trailing holes; they currently turn holes into own
undefined elements.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") currently
reject instead of coercing.match() and search().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 currently do not produce 0 and "".++ and -- must use CodeMode numeric coercion and reject opaque runtime references; they currently call host
Number(...) directly.undefined for feature detection; some currently appear callable or throw
during property access.Math.sumPrecise.isFinite and isNaN.JSON.parse and JSON.stringify for supported data objects; the blocked data-key gap listed above still applies.JSON.stringify.console.log, console.info, console.debug, console.warn, and console.error.console.dir and console.table.JSON.parse reviver callbacks.JSON.stringify function/array replacers.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.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, global, ignoreCase, multiline, sticky, unicode, and dotAll..index, and stateful global matching.lastIndex.hasIndices, match indices, and unicodeSets metadata for the d and v flags.RegExp.escape.new Map() from entry arrays or another Map.get, set, has, delete, clear, size, and forEach.new Set() from arrays, strings, or another Set.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.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, pairs, Maps, 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.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.