<!-- https://tinyscript.tinyactors.dev/reference/built-in/ -->
# Built-in objects · Reference

Kind: reference. For: [Script author](https://tinyscript.tinyactors.dev/audiences/script-author.xml), [Embedder](https://tinyscript.tinyactors.dev/audiences/embedder.xml).
Voice: [Reference](https://tinyscript.tinyactors.dev/voices/reference.xml).

> Which built-in objects tinyscript compiles, and how far each works.

77 features: 5 implemented, 45 partial, 27 planned. Back to [all areas](https://tinyscript.tinyactors.dev/reference/index.md).

| Feature | Status | What works | Test |
|---|---|---|---|
| `AbstractModuleSource` | planned | The first profile does not expose this built-in. A later standard-library increment can add it. |  |
| `AggregateError` | partial | Collect each value produced by the errors iterable into a fresh array on a branded aggregate error. The host can pause and collect during iteration. General message coercion remains open. | [`tests/aggregate-error.js`](https://github.com/tinyactors-dev/tinyactors/blob/0c5984ec45040151fa4d9133cc0011950fbb90a0/tinyscript/tests/aggregate-error.js) |
| `Array` | partial | Array literals retain element order, holes, length and invocation-local identity. Numeric reads and writes preserve tagged values. Sparse writes extend length. Numeric keys in the array can distinguish holes from undefined. Built-in Set and Map constructors consume arrays. Numeric length assignment trims stored elements or adds holes. Eleven callback methods execute their traversal in guest WASM with stable initial length, live value lookup, explicit receivers and short-circuiting. The realm exposes a writable Array constructor and replaceable isArray and of methods. The shared mutable Array.prototype provides first-class search and mutator methods. Named and computed mutator calls preserve the receiver and honor method overrides. General purpose property descriptors, custom prototype chains, species constructors and spread remain in scope. |  |
| `ArrayBuffer` | planned | The first profile does not expose this built-in. A later standard-library increment can add it. |  |
| `AsyncDisposableStack` | planned | The first profile does not expose this built-in. A later standard-library increment can add it. |  |
| `AsyncFunction` | partial | Async functions, arrows and methods have %AsyncFunction.prototype% (@@toStringTag "AsyncFunction") as their prototype and are not constructors. The AsyncFunction constructor, which compiles source text, is open. |  |
| `AsyncGenerator` | partial | next, return and throw queue a request with the async generator driver and return its promise; the driver runs the requests in order, awaiting each yielded value. %AsyncGeneratorPrototype% carries the tag "AsyncGenerator" and inherits @@asyncIterator from %AsyncIteratorPrototype%. yield* hands the driver its operand: the driver gets the operand's async iterator, or its sync iterator with each result's value awaited (CreateAsyncFromSyncIterator), and forwards each request to it until it is done. |  |
| `AsyncGeneratorFunction` | partial | Every async generator function inherits %AsyncGeneratorFunction.prototype%, whose prototype is %AsyncGeneratorPrototype%; the AsyncGeneratorFunction constructor, which compiles source text, is not provided. |  |
| `AsyncIterator` | partial | %AsyncIteratorPrototype% exists as the prototype of %AsyncGeneratorPrototype%, with @@asyncIterator returning its receiver; the global AsyncIterator constructor and its helpers are not provided. |  |
| `Atomics` | planned | Build on shared memory with explicit scheduling and replay of interleavings. Blocking and wake ordering need a host scheduling contract. |  |
| `BigInt` | partial | Decimal, hexadecimal, octal and binary literals, typed internal functions and locals, same-type addition, subtraction, multiplication, division, remainder, unary minus and comparisons are implemented. Console output preserves exact values. Primitive property reads inherit a mutable BigInt prototype. Its toString and valueOf accept BigInts and ordinary wrappers with private BigInt data. Object(bigint) boxes a value; new BigInt throws TypeError. BigInt(value) accepts integral finite Numbers, BigInts, booleans and UTF-16 integer strings. Number(bigint) rounds once to binary64, including ties-to-even and overflow. The fixed-width asIntN and asUintN methods truncate after ToIndex and ToBigInt coercion. Invalid primitive conversions throw TypeError, RangeError or SyntaxError as appropriate. Signed shifts and bitwise operations work on arbitrary-width integers within the configured limb capacity. Exponentiation uses repeated squaring. User-defined conversion hooks remain open. Relational operators compare mixed Number, BigInt and string operands. |  |
| `BigInt64Array` | planned | The first profile does not expose this built-in. A later standard-library increment can add it. |  |
| `BigUint64Array` | planned | The first profile does not expose this built-in. A later standard-library increment can add it. |  |
| `Boolean` | implemented | The writable realm constructor returns truth values when called and boxes them when constructed. Boolean.prototype carries the false value, and its mutable methods require the Boolean brand. | [`tests/booleans.js`](https://github.com/tinyactors-dev/tinyactors/blob/0c5984ec45040151fa4d9133cc0011950fbb90a0/tinyscript/tests/booleans.js) |
| `console` | partial | Host-mediated log through the one console.write CBOR method. console is a namespace object whose log, warn and error are first-class values. A call with one argument writes it as it is: a Number or a BigInt as itself, any other value as its text. A call with several arguments writes one string message, as the WHATWG Console standard's Logger: a first string with format specifiers goes through its Formatter (%s String, %d and %i parseInt, %f parseFloat, %o and %O the value's text, %c nothing), and the values left are joined by single spaces. A call with no argument writes nothing. warn and error write the same message as log: console.write carries no level. Converting an object whose toString or valueOf is the guest's own is not supported yet (d-native-reentry). | [`tests/console.js`](https://github.com/tinyactors-dev/tinyactors/blob/0c5984ec45040151fa4d9133cc0011950fbb90a0/tinyscript/tests/console.js) |
| `DataView` | planned | The first profile does not expose this built-in. A later standard-library increment can add it. |  |
| `Date` | partial | Date objects hold a time value. new Date() and Date() read the embedder clock through the effect Date.now raises; the reply builds the object or its string. Local time comes from the time-zone table the realm request lends, UTC without one. A subclass constructed with no arguments, and an object argument with a guest valueOf, are not supported yet. |  |
| `decodeURI` | partial | Decodes strict UTF-8 percent escapes and preserves reserved delimiters with the original escape spelling. Malformed input throws URIError. The global is a first-class, writable native function. Object coercion shares the runtime’s current ToPrimitive limits. |  |
| `decodeURIComponent` | partial | Decodes percent escapes including delimiters, checks every UTF-8 sequence and preserves unescaped UTF-16. Malformed input throws URIError. The global is a first-class, writable native function. Object coercion shares the runtime’s current ToPrimitive limits. |  |
| `DisposableStack` | planned | The first profile does not expose this built-in. A later standard-library increment can add it. |  |
| `encodeURI` | partial | Encodes a Unicode scalar as UTF-8 percent escapes while preserving URI delimiters. Unpaired surrogates throw URIError. The global is a first-class, writable native function. Object coercion shares the runtime’s current ToPrimitive limits. |  |
| `encodeURIComponent` | partial | Percent-encodes URI delimiters and non-ASCII scalars. Unpaired surrogates throw URIError. The global is a first-class, writable native function. Object coercion shares the runtime’s current ToPrimitive limits. |  |
| `Error` | partial | First-class realm constructor with the standard prototype chain and an internal Error brand. Supports ordinary calls, new, bound construction, subclassing and alternate newTarget. Stack capture and general guest message coercion remain open. |  |
| `escape` | partial | Annex B UTF-16 code-unit escapes use two hexadecimal digits for Latin-1 and four after %u for other units. The function shares the runtime’s object conversion limits. |  |
| `eval` | planned | Strict direct eval needs lexical access and early-error validation. Indirect eval runs in its realm environment. Dynamic source compilation has explicit policy and resource budgets. |  |
| `EvalError` | partial | First-class realm constructor with the standard prototype chain and an internal Error brand. Supports ordinary calls, new, bound construction, subclassing and alternate newTarget. Stack capture and general guest message coercion remain open. |  |
| `FinalizationRegistry` | planned | Provide cleanup jobs through explicit collector and job scheduling once managed objects and weak references exist. |  |
| `Float16Array` | planned | The first profile does not expose this built-in. A later standard-library increment can add it. |  |
| `Float32Array` | planned | The first profile does not expose this built-in. A later standard-library increment can add it. |  |
| `Float64Array` | planned | The first profile does not expose this built-in. A later standard-library increment can add it. |  |
| `Function` | partial | Named module functions have stable identity and can be passed, returned inside the guest, stored in objects or collections and invoked. Arrows, ordinary function expressions and nested declarations share captured bindings. Ordinary functions have own length and name properties and a writable prototype with a constructor back-reference. Each closure has distinct properties. Anonymous functions infer names from bare bindings and object definitions. Computed keys evaluate once and supply the name, including symbol descriptions. Arrow functions and concise methods have no initial prototype. Function.prototype supplies call, apply, bind and Symbol.hasInstance. Budgeted dynamic source compilation remains in scope. See tests/function-properties.js. |  |
| `Generator` | planned | The first profile does not expose this built-in. A later standard-library increment can add it. |  |
| `GeneratorFunction` | planned | The first profile does not expose this built-in. A later standard-library increment can add it. |  |
| `globalThis` | partial | Each realm lazily owns an ordinary global object. Custom properties are visible to strict identifier reads, typeof and simple assignment. Replacing the globalThis property preserves the realm environment. The full set of first-class standard constructors and namespaces remains in scope. |  |
| `Infinity` | partial | Global reads produce positive binary64 infinity and respect local bindings. The matching own global property is non-enumerable and read-only. General descriptor APIs remain planned. |  |
| `Int16Array` | planned | The first profile does not expose this built-in. A later standard-library increment can add it. |  |
| `Int32Array` | planned | The first profile does not expose this built-in. A later standard-library increment can add it. |  |
| `Int8Array` | planned | The first profile does not expose this built-in. A later standard-library increment can add it. |  |
| `InternalError` | planned | The first profile does not expose this built-in. A later standard-library increment can add it. |  |
| `Intl` | planned | Implement ECMA-402 with pinned locale data and an explicit locale and time zone policy. |  |
| `isFinite` | implemented | Apply ToNumber, then reject infinities and NaN. BigInt and Symbol inputs throw TypeError. |  |
| `isNaN` | implemented | Apply ToNumber and check for NaN. BigInt and Symbol inputs throw TypeError. |  |
| `Iterator` | partial | Arrays, Sets and Maps create live built-in iterators. Each built-in iterator family exposes a distinct branded next method through dynamic lookup. Calls produce fresh ordinary objects with writable, enumerable and configurable value and done properties in that order. Result objects share a layout, compare by identity, and support ordinary mutation, reflection and freezing. See tests/iteration-results.js. Iterator helpers, user-defined iteration, prototype dispatch and closing remain in scope. Iterator is the abstract constructor: a call, or new Iterator(), throws TypeError; a subclass constructs an ordinary object of its prototype; Iterator.prototype is %IteratorPrototype%. |  |
| `JSON` | partial | JSON.parse decodes UTF-16 text directly into guest records, arrays and primitive values. JSON.stringify serializes data properties with well-formed UTF-16 escaping, property selection, and indentation. Callable hooks remain planned. JSON is a namespace object, a writable realm binding with the standard Symbol.toStringTag, whose static functions are its properties. |  |
| `Map` | partial | Map, get, set, has, delete, clear and size share ordered SameValueZero keys with Set. Values carry their runtime JavaScript type. Copy construction preserves key and value identity. Keys, values, and entries observe updates, deletions, reinsertions and clears. The constructor consumes built-in iterables. Custom iterator hooks, callbacks and subclass dispatch remain in scope. |  |
| `Math` | partial | Math is a writable realm binding. Its methods are writable, configurable and nonenumerable. Constants are immutable. The namespace carries the standard Symbol.toStringTag. Scalar kernels guard the original callees once before entering a body without guest calls or host effects. Other code performs ordinary property lookup. Additional arithmetic functions are tracked in the member catalog. |  |
| `NaN` | partial | Global reads produce a binary64 NaN and respect local bindings. The matching own global property is non-enumerable and read-only. General descriptor APIs remain planned. |  |
| `Number` | partial | Decimal and binary/octal/hexadecimal source literals round to binary64. Decimal exponents and numeric separators are supported. All standard numeric constants and the four noncoercing Number predicates are implemented. Number(value) accepts Numbers, BigInts, booleans, null, undefined and UTF-16 numeric strings. Strings follow StringNumericLiteral syntax and invalid strings produce NaN. Number.parseInt and Number.parseFloat share the original global function identities. Primitive Number property reads inherit a mutable realm prototype. Exact toFixed, toPrecision, toExponential, toString and valueOf support detached calls with a valid receiver. new Number creates an ordinary object with private Number data. Locale-aware formatting remains open. |  |
| `Object` | partial | Object.create, getPrototypeOf, setPrototypeOf and the legacy prototype accessor support mixed ordinary-object and Array chains, including null prototypes. Cyclic reparenting throws TypeError. Object literals share an invocation-local Object.prototype with native toString, valueOf, hasOwnProperty, isPrototypeOf and the legacy prototype accessor. Descriptor objects, additional intrinsic prototypes and exotic receivers remain in scope. |  |
| `parseFloat` | implemented | Parse the longest signed decimal or Infinity prefix after leading ECMAScript whitespace. Decimal input rounds to the nearest binary64 value, including subnormal results and negative zero. |  |
| `parseInt` | implemented | Convert the input to text and radix to Int32, then consume the longest digit prefix in bases 2 through 36. Hex prefix inference, signed zero, arbitrary input length, rounding and overflow are supported. |  |
| `Promise` | partial | Promise records keep their state, result and reactions in a guest array the collector traces. Settling a promise queues its reaction jobs on the session; an invocation runs the queued jobs after its export returns or throws, until the queue is empty, and a job that makes a host request parks the invocation with the queue. The constructor, then, catch, finally and the static methods run as one guest library body, so thenables, species constructors and capability executors are ordinary guest calls; all, allSettled, any and race take their iterable through GetIterator, so an array's own or replaced @@iterator is called and an abrupt one rejects. A program reaches Promise only by naming it: one that reads it through globalThis by a computed name alone refuses it. Open: Promise.allKeyed and allSettledKeyed (a proposal), and a new.target whose prototype is an accessor. | [`tests/promises.js`](https://github.com/tinyactors-dev/tinyactors/blob/0c5984ec45040151fa4d9133cc0011950fbb90a0/tinyscript/tests/promises.js) |
| `Proxy` | planned | Implement internal method interception and enforce the target invariants required by ECMAScript. |  |
| `RangeError` | partial | First-class realm constructor with the standard prototype chain and an internal Error brand. Supports ordinary calls, new, bound construction, subclassing and alternate newTarget. Stack capture and general guest message coercion remain open. |  |
| `ReferenceError` | partial | First-class realm constructor with the standard prototype chain and an internal Error brand. Supports ordinary calls, new, bound construction, subclassing and alternate newTarget. Stack capture and general guest message coercion remain open. |  |
| `Reflect` | partial | Reflect.apply and Reflect.construct consume array-like argument lists and preserve the specified receiver or newTarget. First-class get, has, ownKeys, getPrototypeOf and setPrototypeOf share the runtime's ordinary and array property operations. Additional internal methods and Proxy remain in scope. Reflect is a namespace object, a writable realm binding with the standard Symbol.toStringTag, whose static functions are its properties. |  |
| `RegExp` | partial | Literal test calls lower to compact WASM automata for UTF-16 input and JavaScript coercion, with search, anchors, ASCII atoms, alternation and ASCII case folding. RegExp objects run on the backtracking engine: captures, named groups, backreferences, lookaround and the flags dgimsuvy. RegExp is a constructor value that compiles patterns at run time; RegExp.prototype is the prototype of every RegExp. Unicode property escapes come from UCD 17.0 (binary properties, General_Category, Script, Script_Extensions), and a match longer than one run's fuel pauses and resumes in the next run; properties of strings report UNSUPPORTED. |  |
| `Set` | partial | Construction accepts null, undefined, another built-in Set, or a string iterated by Unicode code point. Membership uses SameValueZero in add, has and delete. Size and clear track live entries. Set objects have invocation-local identity. Keys, values and entries are live through compaction. User-defined iterables, set algebra and subclasses remain open. |  |
| `SharedArrayBuffer` | planned | Provide shared backing storage for typed arrays with scheduling and memory-order guarantees defined by the embedder. |  |
| `String` | partial | Image-backed primitive strings retain UTF-16 code units, including lone surrogates. Locals, length, strict equality, truth tests, logical selection and console output work. Two strings concatenate through + and +=. Earlier values preserve their UTF-16 contents after append. charAt and charCodeAt read individual UTF-16 code units. Single-unit and empty results require no allocation. Callable String converts all currently executable primitive types and built-in collections. Decimal Number conversion produces the shortest round-tripping decimal under ECMAScript formatting rules. Arrays join nested members in order and skip ancestor cycles. Dynamic and computed property access supports UTF-16 indices, length, and the implemented String methods. Extracted methods retain native identity, name and arity; generic calls and Reflect.apply use the supplied receiver. String.prototype is a realm-owned object with the empty-string brand, a read-only length and mutable non-enumerable methods. Method selection precedes argument evaluation. String(value) returns primitive text. new String(value) and Object(string) return fresh wrappers whose UTF-16 indices remain virtual across compaction. Guest conversion hooks and other prototype methods remain in scope. |  |
| `SuppressedError` | partial | First-class Error subclass that retains the new error and the earlier suppressed value. Calling, constructing and alternate newTarget preserve the Error brand. General guest message coercion remains open. | [`tests/error-constructors.js`](https://github.com/tinyactors-dev/tinyactors/blob/0c5984ec45040151fa4d9133cc0011950fbb90a0/tinyscript/tests/error-constructors.js) |
| `Symbol` | partial | Fresh identity, the realm symbol registry, fifteen well-known symbols and branded wrappers preserve primitive identity. Methods, the description getter and the well-known @@toPrimitive hook use ordinary prototype lookup. Registry sharing across embedder realms and guest-issued coercion hooks remain open. |  |
| `SyntaxError` | partial | First-class realm constructor with the standard prototype chain and an internal Error brand. Supports ordinary calls, new, bound construction, subclassing and alternate newTarget. Stack capture and general guest message coercion remain open. |  |
| `Temporal` | planned | Implement the standard Temporal classes and arithmetic. Host-supplied clock and time-zone data enter through explicit policy. |  |
| `TypedArray` | partial | %TypedArray%.prototype holds the methods and getters Uint8Array shares, whose owner is TA_TYPEDARRAY. No %TypedArray% constructor object is made: Uint8Array holds from and of itself. Uint8Array is the one element type. | [`tests/uint8array.js`](https://github.com/tinyactors-dev/tinyactors/blob/0c5984ec45040151fa4d9133cc0011950fbb90a0/tinyscript/tests/uint8array.js) |
| `TypeError` | partial | First-class realm constructor with the standard prototype chain and an internal Error brand. Supports ordinary calls, new, bound construction, subclassing and alternate newTarget. Stack capture and general guest message coercion remain open. |  |
| `Uint16Array` | planned | The first profile does not expose this built-in. A later standard-library increment can add it. |  |
| `Uint32Array` | planned | The first profile does not expose this built-in. A later standard-library increment can add it. |  |
| `Uint8Array` | partial | A Uint8Array is an ordinary object whose integer indices are views of bytes: a read gives a Number, a write converts by ToNumber and ToUint8 and is ignored out of range, and its elements are not configurable. The bytes are a store of the session's heap, which subarray's views share. There is no ArrayBuffer: buffer is not supported, and the constructor takes no buffer. Its prototype is %TypedArray%.prototype, the methods of which need no callback; those that take a callback (every, filter, find, findIndex, findLast, findLastIndex, forEach, map, reduce, reduceRight, some, and sort's comparator) are not supported yet (d-native-reentry). A Uint8Array costs a 136-byte record and a 24-byte handle slot; its store, which its subarrays share, a 24-byte buffer header, a 24-byte handle slot and the bytes: 208 bytes and its length in all, 160 bytes for a subarray. | [`tests/uint8array.js`](https://github.com/tinyactors-dev/tinyactors/blob/0c5984ec45040151fa4d9133cc0011950fbb90a0/tinyscript/tests/uint8array.js) |
| `Uint8ClampedArray` | planned | The first profile does not expose this built-in. A later standard-library increment can add it. |  |
| `undefined` | partial | The undefined value can be stored in a realm slot or returned from a dynamic function. Its own global property is non-enumerable and read-only. |  |
| `unescape` | partial | Annex B decoding accepts two-digit and %u four-digit escapes, preserves malformed input, and keeps lone surrogates. The function shares the runtime’s object conversion limits. |  |
| `URIError` | partial | First-class realm constructor with the standard prototype chain and an internal Error brand. Supports ordinary calls, new, bound construction, subclassing and alternate newTarget. Stack capture and general guest message coercion remain open. |  |
| `WeakMap` | partial | Construct from a supported iterable, set, get, query and delete weak entries. Ephemeron tracing retains values only for reachable keys. Registered symbols are ineligible. Custom iterator protocols, intrinsic prototypes and catchable errors remain pending. |  |
| `WeakRef` | partial | Constructing a reference or successfully dereferencing it retains its target through the current job. Collection after an explicit job boundary clears unreachable targets before reusing handles. Intrinsic prototypes and catchable errors remain pending. |  |
| `WeakSet` | partial | Construct from a supported iterable, add, query and delete weak object and nonregistered symbol keys. Collection removes dead handles before slot reuse. Dynamic method dispatch and intrinsic prototypes remain pending. |  |
| `WebAssembly` | planned | Provide the guest WebAssembly API over the supported engine. Engine feature coverage and guest scheduling need their own conformance inventory. |  |

At tinyscript commit [`0c5984ec`](https://github.com/tinyactors-dev/tinyactors/tree/0c5984ec45040151fa4d9133cc0011950fbb90a0/tinyscript); each test is a program that runs the feature.
