EarendilEarendildjsHow djs works
Source

Intrinsics

The intrinsics are the operations the builtin language calls as %Name(...): Rust functions (leaf: never runs user code; reentrant: may call one user function whose result completes it) and JS builtins tagged @intrinsic. The id is the immediate of call_intrinsic and part of the bytecode format. Generated from INTRINSICS in crates/djs-core/src/bytecode/intrinsics.rs, with the descriptions from builtins/intrinsics.d.ts.

idnamekindparametersdescription
0IsObjectleaf1
1IsCallableleaf1IsCallable ( argument ).
2IsConstructorleaf1IsConstructor ( argument ).
3IsArrayleaf1IsArray ( argument ), 7.2.2, through proxies: TypeError for a revoked proxy.
4IsStringleaf1
5IsNumberleaf1
6IsSymbolleaf1
7IsBooleanleaf1
8AsObjleaf1
9AsFnleaf1
10AsStrleaf1
11AsNumberleaf1
12AsSymleaf1
13AsBoolleaf1
14ToBooleanleaf1ToBoolean ( argument ).
15ToNumberPrimitiveleaf1ToNumber of a primitive (TypeError for symbols); objects go through ToPrimitive first.
16ToStringPrimitiveleaf1ToString of a primitive (TypeError for symbols); objects go through ToPrimitive first.
17ToObjectleaf1ToObject ( argument ): TypeError for undefined and null.
18ToIntegerOrInfinityNumberleaf1ToIntegerOrInfinity of a number.
19F64ToU32leaf1An integral f64 in u32 range to u32 (an internal error otherwise).
20F64ToI32leaf1An integral f64 in i32 range to i32 (an internal error otherwise).
21StrLengthleaf1The length of a string in code units.
22Getreentrant2Get ( O, P ): may call a getter.
23GetVreentrant2GetV ( V, P ): Get with a primitive base looked up on its prototype.
24Setreentrant3Set ( O, P, V, true ): may call a setter; throws on failure.
25HasPropertyreentrant2HasProperty ( O, P ): a proxy’s has trap.
26CreateDataPropertyOrThrowreentrant3CreateDataPropertyOrThrow ( O, P, V ): a proxy’s defineProperty trap.
27DeletePropertyOrThrowreentrant2DeletePropertyOrThrow ( O, P ): a proxy’s deleteProperty trap.
28Callreentrant2 + restCall ( F, V, args ): TypeError if f is not callable.
29Constructreentrant1 + restConstruct ( F, args ) with newTarget F: TypeError if f is not a constructor.
30ObjectCreateleaf1OrdinaryObjectCreate ( proto ).
31ArrayCreateleaf1ArrayCreate ( length ): RangeError above 2**32 - 1.
32NewTypeErrorleaf1A new TypeError of the current realm.
33NewNotConstructorErrorleaf1A TypeError “ is not a constructor” with f’s internal name, as QuickJS words it.
34NewSyntaxErrorleaf1A new SyntaxError of the current realm.
35NewReferenceErrorleaf1A new ReferenceError of the current realm.
36NewRangeErrorleaf1A new RangeError of the current realm.
37WellKnownSymbolleaf1The well-known symbol Symbol..
38RealmIntrinsicleaf1A realm intrinsic object by name: ObjectPrototype, FunctionPrototype, ArrayPrototype, ErrorPrototype and the native error prototypes (TypeErrorPrototype, …).
39ErrorCreateleaf1An object with [[ErrorData]] and prototype proto.
40DOMExceptionCreateleaf3A DOMException: an object with [[ErrorData]], its name and message in slots (D1840).
41DOMExceptionFieldleaf2Slot i (0 name, 1 message) of a DOMException; undefined if v is not one.
42DOMExceptionCodeleaf1The legacy code of a DOMException name, 0 if it has none.
43DOMExceptionConstantleaf1The name of the legacy code constant i, 1 to 25 (INDEX_SIZE_ERR, …).
44Btoaleaf1btoa’s base64 of the code units of s; undefined if one is above 0xFF.
45Atobleaf1atob’s forgiving-base64 decoding of s into a string of bytes; undefined if invalid.
46CaptureStackleaf1Records o.stack (D1282) from the current frames, without the prelude frames at the top: an Error constructor does not show itself. With Error.prepareStackTrace it is pending until FinishErrorStack (D2050).
47ErrorStackleaf1The stack an Error object recorded (D1971), a pending one too (D2050), or undefined for any other value.
48StackTraceValueleaf1The stack trace of the current frames (the calling builtin left out): a string, or a pending stack with Error.prepareStackTrace (D2050). With a function below, only the frames below its topmost call, none if it is not on the stack (Error.captureStackTrace, D2010).
49IsPendingStackleaf1Whether v is a stack waiting for Error.prepareStackTrace (D2050).
50SetErrorStackleaf2Sets the stack slot of an Error (an own stack of anything else).
51CallSiteSlotleaf2Slot i of a CallSite (0 function, 1 name, 2 file, 3 line, 4 column, 5 native, 6 constructor); TypeError “CallSite object expected” for anything else.
52DefineDataPropertyOrThrowreentrant4DefinePropertyOrThrow ( O, P, desc ) with a complete data descriptor; attrs are writable 1, enumerable 2, configurable 4.
53DefineOwnPropertyFromRecordreentrant3[[DefineOwnProperty]] with a descriptor record from ToPropertyDescriptor (an object whose own data properties are the present fields). False if it was rejected.
54GetOwnPropertyDescriptorObjectreentrant2FromPropertyDescriptor ( [[GetOwnProperty]](o, key) ): undefined if absent.
55HasOwnPropertyreentrant2HasOwnProperty ( O, P ).
56OwnPropertyAttributesreentrant2The attributes of an own property: -1 if absent, else writable 1, enumerable 2, configurable 4, accessor 8.
57OwnPropertyKeysreentrant2The own keys of o as a new array, in [[OwnPropertyKeys]] order: kind 0 strings, 1 symbols, 2 both, 3 enumerable strings.
58GetPrototypeOfreentrant1[[GetPrototypeOf]] ( ): an object or null.
59SetPrototypeOfreentrant2[[SetPrototypeOf]] ( V ) with an object or null: false if refused.
60PreventExtensionsreentrant1[[PreventExtensions]] ( ).
61IsExtensiblereentrant1[[IsExtensible]] ( ).
62SetIntegrityLevelreentrant2SetIntegrityLevel ( O, level ): sealed, or frozen if frozen.
63TestIntegrityLevelreentrant2TestIntegrityLevel ( O, level ): sealed, or frozen if frozen.
64SameValueleaf2SameValue ( x, y ).
65ObjectClassTagleaf1The builtinTag of Object.prototype.toString: Array, Arguments, Function, Error, Boolean, Number, String, Date, RegExp, else Object.
66WrapPrimitiveleaf2A Boolean, Number, String or Symbol wrapper of the primitive v with prototype proto.
67PrimitiveValueleaf1The primitive of a wrapper object ([[BooleanData]] and so on), a primitive itself, or undefined for other objects.
68ConstructWithArrayreentrant3Construct ( F, args, newTarget ) with the arguments in a dense array.
69ConstructWithThisreentrant4[[Construct]] of an ordinary (non-builtin) function f with thisArg as the new object (OrdinaryCreateFromConstructor done by the caller) and new.target.
70GetWithReceiverreentrant3[[Get]] ( P, Receiver ): a getter runs with receiver as this.
71SetWithReceiverreentrant4OrdinarySet ( O, P, V, Receiver ): false when refused; a setter runs with receiver.
72DeletePropertyreentrant2[[Delete]] ( P ): false for a non-configurable property.
73IsProxyleaf1Whether v is a Proxy exotic object (revoked or not).
74NewProxyleaf2A new proxy (ProxyCreate’s object, 10.5.14): callable/constructor as target is.
75ProxyTargetleaf1[[ProxyTarget]] of a proxy: TypeError “revoked proxy” once revoked.
76ProxyHandlerleaf1[[ProxyHandler]] of a proxy: TypeError “revoked proxy” once revoked.
77ProxyRevokeleaf1Revokes a proxy (target and handler become null).
78CollectionCreateleaf2A new empty collection: class 0 Map, 1 Set, 2 WeakMap, 3 WeakSet.
79CollectionClassleaf1The class of a collection object (0 Map, 1 Set, 2 WeakMap, 3 WeakSet), -1 otherwise.
80CollectionGetleaf2The value of key (SameValueZero), or undefined.
81CollectionHasleaf2Whether key is present.
82CollectionSetleaf3Adds or replaces key (-0 becomes +0); a Set passes true as the value.
83CollectionDeleteleaf2Removes key; false if it was absent.
84CollectionClearleaf1Removes every entry.
85CollectionSizeleaf1The number of entries.
86CollectionIteratorleaf2A Map Iterator or Set Iterator over m (kind 0 keys, 1 values, 2 entries): it visits entries added while iterating and skips deleted ones.
87CollectionIteratorNextleaf2%MapIteratorPrototype%.next / %SetIteratorPrototype%.next: the iterator result. TypeError “Map Iterator object expected” (or Set) for anything else.
88IsOriginalCollectionAdderleaf2Whether adder is the installed Map.prototype.set (kind 0) or Set.prototype.add (1): the constructors then store directly.
89CollectionIteratorStepleaf1Advances an iterator to the next entry; false when done.
90CollectionIteratorKeyleaf1The key of the entry the last step reached.
91CollectionIteratorValueleaf1The value of the entry the last step reached.
92CanBeHeldWeaklyleaf1CanBeHeldWeakly ( v ): an object, or a symbol not in the Symbol.for registry.
93DateNowleaf0The host’s clock (ms since the epoch; Vm::set_now).
94DateCreateleaf2A new Date object with prototype proto and time value t.
95DateValueleaf1thisTimeValue: the time value of a Date, TypeError “not a Date object” otherwise.
96DateSetValueleaf2Stores time value t in a Date (TypeError “not a Date object” otherwise); returns t.
97DateFromFieldsleaf2A time value from the Numbers year, month[, date, hours, minutes, seconds, ms] in a dense array (the constructor’s and Date.UTC’s form: years 0-99 are 1900-1999).
98DateGetFieldleaf3Field field of t (0 year, 1 month, 2 date, 3 hours, 4 minutes, 5 seconds, 6 ms, 7 weekday), local or UTC; NaN for an invalid date.
99DateSetFieldsleaf4A setter’s new time value: fields first.. of t replaced by the Numbers in args (a dense array), local or UTC (qjs’s set_date_field).
100DateFormatleaf3Formats t: fmt 0 toUTCString, 1 toString, 2 toISOString (RangeError for NaN), 3 toLocale*; part 1 date, 2 time, 3 both. “Invalid Date” for NaN.
101DateParseleaf1Date.parse of a string (ISO and the formats qjs’s toString/toUTCString emit).
102DateTimezoneOffsetleaf1getTimezoneOffset of t: minutes (UTC - local), NaN for an invalid date.
103ArrayBufferCreateleaf3AllocateArrayBuffer: byteLength zeroed bytes; max is the maxByteLength of a resizable buffer, true for an immutable one (D1970), or undefined. RangeError “invalid array buffer length” (or “… max length”).
104BufferInfoleaf2A field of an ArrayBuffer: 0 byteLength, 1 maxByteLength, 2 resizable, 3 detached, 4 immutable (D1970). TypeError “ArrayBuffer object expected” for anything else.
105BufferDetachleaf1DetachArrayBuffer.
106BufferResizeleaf2Resizes a resizable buffer in place (new bytes are 0).
107BufferTransferleaf3A new buffer with the first bytes of b (max: a Number for resizable, true for immutable), b detached; an immutable b is a TypeError.
108BufferCopyleaf5Copies count bytes from src at from to dst at to (memmove).
109SortNumbersleaf1Sorts a dense array of Numbers numerically in place (a typed array’s default order: -0 before +0, NaN last; stable), or one of BigInts by value.
110DataViewCreateleaf4A DataView over buffer (byteLength -1: length-tracking).
111DataViewFieldleaf2A slot of a DataView: 0 buffer, 1 byteOffset, 2 byteLength (-1: length-tracking). TypeError “DataView object expected” for anything else.
112DataViewGetleaf4The element of kind at byte at of the view’s buffer (bounds checked by the caller): a Number, or a BigInt for kinds 10 and 11.
113DataViewSetleaf5Writes v (a Number, or a BigInt for kinds 10 and 11) as kind at byte at of the view’s buffer.
114IsDataViewleaf1Whether v is a DataView.
115RealmConstructorleaf1The constructor installed as name (the realm’s %Name%, whatever the global is now).
116IsTypedArrayleaf1Whether v is a typed array.
117TypedArrayCreateleaf5A typed array of kind over buffer (length -1: length-tracking).
118TypedArrayFieldleaf2A field of a typed array: 0 kind, 1 buffer, 2 byteOffset, 3 length, 4 byteLength (2-4 are 0 when out of bounds), 5 out of bounds or detached, 6 length-tracking, 7 [[ByteOffset]] (also when out of bounds). TypeError “not a TypedArray” for anything else.
119TypedArrayGetleaf2Element i (undefined if not a valid index).
120TypedArraySetleaf3Writes v (a Number, or a BigInt for a BigInt array) to element i (nothing if not a valid index).
121TypedArrayCopyleaf5Copies count elements from src (at from) to dst (at to), converting; overlaps ok.
122TypedArrayKindProtoleaf1The prototype of the typed array constructor for kind (the realm’s).
123Base64Encodeleaf3The bytes of a Uint8Array as base64 (TypeError if detached or out of bounds).
124HexEncodeleaf1The bytes of a Uint8Array as lowercase hex (TypeError if detached).
125Base64Decodeleaf4FromBase64 ( string, alphabet, lastChunkHandling, maxLength ): a record object { read, bytes (an ArrayBuffer), error } (last: 0 loose, 1 strict, 2 stop-before-partial).
126HexDecodeleaf2FromHex ( string, maxLength ): the same record.
127CallWithArrayreentrant3Call ( F, V, args ) with the arguments in a dense array.
128BoundFunctionCreateleaf3BoundFunctionCreate ( target, boundThis, boundArgs ), without name and length.
129BoundTargetFunctionleaf1[[BoundTargetFunction]] of a bound function, or undefined for anything else.
130FunctionToStringleaf1The source text of a function (natives: function name() { [native code] }).
131NumberPowleaf2Number::exponentiate ( base, exponent ).
132SymbolDescriptiveStringleaf1SymbolDescriptiveString ( sym ): Symbol(description).
133CompareStringsleaf2Compares two strings by code units (IsLessThan for strings): -1, 0 or 1. Also localeCompare’s order (no Intl).
134StringCodePointsleaf1The code points of s as an array of strings (the string iterator’s values).
135SortPrimitivesleaf1Sorts the dense array list in place by SortCompare without a comparefn (undefined last, then ToString order; stable) if every element is a primitive other than a symbol. Returns false, leaving it unchanged, otherwise.
136ArraySpliceDenseleaf4Splice’s element moves in one step on a plain dense Array (no holes, default attributes, extensible, writable length, no index properties on the prototype chain): o[start .. start + deleteCount) becomes itemCount undefined slots and length follows. False, with nothing changed, for any other object.
137ArrayCanPopDenseleaf1Whether ArrayPopDense(o) applies: an Array with only dense elements, a writable length, its last element present and no index properties on its prototype chain, where pop’s Get, DeletePropertyOrThrow and Set observe nothing else.
138ArrayPopDenseleaf1Array.prototype.pop of an array ArrayCanPopDense accepts.
139ArrayFillDenseleaf4fill’s Sets on an Array while each is a plain store (an existing dense element, or an append or hole fill of an extensible Array without index properties on its prototype chain), from k up to fin: the index the general loop continues from.
140ArrayPushDenseleaf2push(v)’s Set and length update in one step when the Set is a plain append to the Array o (extensible, writable length, no holes at its end, no index properties on its prototype chain). The new length, or -1 with nothing changed.
141ArraySearchDenseleaf5The search loops of indexOf (mode 0: from up to len, strict equality), lastIndexOf (1: from down to 0) and includes (2: up to len, SameValueZero) over an Array whose elements in the range are all present in dense storage, where HasProperty and Get observe nothing: the index found or -1. -2, for the general loop, for anything else (a hole, a shorter array, another object).
142ArraySliceDenseleaf4slice’s copy loop: a[0 .. fin - k) = o[k .. fin) when every element of o in the range is present in dense storage and a is an extensible Array without index properties (a fresh ArraySpeciesCreate result), so HasProperty, Get and CreateDataPropertyOrThrow observe nothing. False, with nothing changed, otherwise.
143EachDensereentrant7The dense part of the loops of the callback builtins. From k, while o is an Array whose element k is present in its dense store (so HasProperty and Get observe nothing), calls f(o[k], k, o) with thisArg and completes the step by mode: - 0 forEach; - 1 map: CreateDataPropertyOrThrow(a, k, result); - 2 filter: for a truthy result, CreateDataPropertyOrThrow(a, to, o[k]), with to the length of a, a fresh Array (the receiver’s species is plain); - 3 some, 4 every: a truthy (some) or falsy (every) result decides; - 5 find: a truthy result decides, and o[k] goes to element 0 of the Array a; - 6 findIndex: a truthy result decides; - 7 reduce: calls f(acc, o[k], k, o) (thisArg undefined), with the accumulator as element 0 of the Array a, which gets the result. One frame for f, entered again per element. Returns the k the builtin’s own loop goes on from (len: done; k itself when f is not a plain closure or a is not as required), or -1 - k when the result at k decided.
144ArrayJoinDenseleaf3join over o[0 .. len) when every element is present in dense storage and a primitive other than a symbol (ToString runs no user code): the string, or undefined for the general loop.
145EnumerableOwnDataPropertiesleaf2EnumerableOwnProperties ( o, kind ) for kind 1 (values) and 2 (entries) in one step when no enumerable string-keyed own property is an accessor and o is not exotic (no Proxy): the array, or undefined for the general loop.
146TypedArraySetFromDenseleaf2Writes values[0 .. length) into the typed array o (at least that long) when values is an Array whose elements are all present in dense storage and primitives of o’s content type (ToNumber / ToBigInt run no user code). False, with nothing written, otherwise.
147StrLocaleCompareleaf2localeCompare without Intl (as qjs): the difference of the first differing code points, else -1, 0 or 1 by length.
148StrCharCodeAtleaf2The code unit at i as a Number, NaN out of range.
149StrCodePointAtleaf2The code point at i (a surrogate pair combined), undefined out of range.
150StrSubstringleaf3s[start .. end) in code units; the indexes are integers, clamped by the caller.
151StrIndexOfleaf3The first index ≥ from where search occurs, or -1.
152StrLastIndexOfleaf3The last index ≤ from where search occurs, or -1.
153StrToCaseleaf2Full Unicode upper- or lowercase (SpecialCasing, Final_Sigma; no locales).
154StrTrimleaf2Trims WhiteSpace and LineTerminators: where 0 both ends, 1 start, 2 end.
155StrIsWellFormedleaf1IsStringWellFormedUnicode.
156StrToWellFormedleaf1Lone surrogates replaced by U+FFFD.
157StrRepeatleaf2s repeated n times (an integer ≥ 0; RangeError past the string length limit).
158StrFromCodeUnitsleaf1A string of the code units ToUint16(n) of the Numbers in a dense array.
159StrFromCodePointsleaf1A string of the (valid) code points in a dense array.
160StrNormalizeleaf2String.prototype.normalize for form 0 NFC, 1 NFD, 2 NFKC, 3 NFKD: the normalized string; undefined only when djs is built without the unicode-normalization feature and the string would need its tables.
161NewSymbolleaf1A new symbol; the description is a string or undefined.
162SymbolDescriptionleaf1[[Description]] of a symbol: a string or undefined.
163SymbolForleaf1Symbol.for’s GlobalSymbolRegistry lookup or insertion.
164SymbolKeyForleaf1Symbol.keyFor’s registry lookup: the key, or undefined.
165NumberToStringleaf2Number::toString ( x, radix ) for an integral radix (RangeError outside 2..36), Number.prototype.toString.
166NumberToFixedleaf2Number.prototype.toFixed after ToIntegerOrInfinity(fractionDigits).
167NumberToExponentialleaf2Number.prototype.toExponential; digits is undefined or an integral Number.
168NumberToPrecisionleaf2Number.prototype.toPrecision; precision is undefined or an integral Number.
169StringParseFloatleaf1The global parseFloat after ToString.
170StringParseIntleaf2The global parseInt after ToString; radix is ToInt32(radix).
171UriEncodeleaf2Encode ( string, extraUnescaped ), 19.2.6.5, after ToString: encodeURI keeps the reserved characters (component false), encodeURIComponent escapes them. URIError for a lone surrogate.
172UriDecodeleaf2Decode ( string, preserveEscapeSet ), 19.2.6.6, after ToString: decodeURI keeps the escapes of reserved characters (component false). URIError for a malformed escape or UTF-8 sequence.
173StrEscapeleaf1escape ( string ), B.2.1.1, after ToString.
174StrUnescapeleaf1unescape ( string ), B.2.1.2, after ToString.
175CompileEvalleaf1PerformEval’s parse (19.2.1.1) for indirect eval: the source as a Script closure, to be called with this = the global object. SyntaxError for invalid source. Charges fuel per source byte.
176CompileFunctionleaf3CreateDynamicFunction’s parse (20.2.1.1.1): kind 0 function, 1 generator, 2 async, 3 async generator; params joined with “,”; a Script closure whose call returns the new function. SyntaxError for invalid source. Charges fuel per source byte.
177GlobalObjectleaf0The realm’s global object.
178EnqueueMicrotaskleaf1Queues the job MicrotaskJob(callback) (queueMicrotask).
179NumberToInt32leaf1ToInt32 of a number.
180NumberToUint32leaf1ToUint32 of a number, as an f64.
181F64Absleaf1
182F64Acosleaf1
183F64Acoshleaf1
184F64Asinleaf1
185F64Asinhleaf1
186F64Atanleaf1
187F64Atanhleaf1
188F64Atan2leaf2
189F64Cbrtleaf1
190F64Hypotleaf2
191F64Ceilleaf1
192F64Clz32leaf1Math.clz32 of a number (ToUint32 inside).
193F64Cosleaf1
194F64Coshleaf1
195F64Expleaf1
196F64Expm1leaf1
197F64Floorleaf1
198F64Froundleaf1Rounds to the nearest f32.
199F64F16roundleaf1Rounds to the nearest binary16 value (Math.f16round).
200F64SumPreciseleaf1The exactly rounded sum of the Numbers of the dense Array list (Math.sumPrecise).
201F64Imulleaf2Math.imul of two numbers (ToUint32 inside).
202F64Logleaf1
203F64Log1pleaf1
204F64Log10leaf1
205F64Log2leaf1
206F64Roundleaf1Math.round: half up, -0 kept.
207F64Signleaf1
208F64Sinleaf1
209F64Sinhleaf1
210F64Sqrtleaf1
211F64Tanleaf1
212F64Tanhleaf1
213F64Truncleaf1
214MathRandomleaf0The next number in [0, 1) of the realm’s generator (xorshift128+, seeded by the host).
215CreateArrayIteratorleaf2A new Array Iterator over o (kind 0: keys, 1: values, 2: entries), 23.1.5.1.
216ArrayIteratorTargetleaf1The object an Array Iterator iterates, or undefined once it is exhausted. TypeError “Array Iterator object expected” if it is not an Array Iterator.
217ArrayIteratorIndexleaf1The next index of an Array Iterator.
218ArrayIteratorSetIndexleaf2
219ArrayIteratorFinishleaf1Marks an Array Iterator exhausted (its target becomes undefined).
220ArrayIteratorKindleaf1The kind of an Array Iterator (0: keys, 1: values, 2: entries).
221CreateStringIteratorleaf1A String Iterator over s (CreateStringIterator, 22.1.5.1): an Array Iterator object of kind 3 with %StringIteratorPrototype%; ArrayIteratorIndex/SetIndex/Finish apply.
222StringIteratorTargetleaf1The string a String Iterator iterates, or undefined once it is exhausted. TypeError “String Iterator object expected” otherwise.
223StrCodePointStringleaf2The code point at index i of s as a string (one or two code units).
224HasOriginalIterationleaf1Whether v is an Array or a string whose iteration is the original Symbol.iterator method and next (data properties only): iterating it then equals reading it directly.
225IteratorFastReadyleaf2Whether the next step of iterator with next gives a value without running user code: next is the original one of an Array or String Iterator and the value is at hand (D1800). Then IteratorFastValue returns it; otherwise call next.
226IteratorFastValueleaf2The next value of an iterator IteratorFastReady accepts (it advances).
227CreateIterResultObjectleaf2CreateIterResultObject ( value, done ), 7.4.14.
228CreateArrayFromPairleaf2A new Array [a, b].
229PromiseCreateleaf1A new pending Promise with prototype proto.
230IsPromiseleaf1Whether v is a Promise object (has [[PromiseState]]).
231IntrinsicPromiseleaf0The realm’s %Promise% constructor.
232PromiseStateleaf1[[PromiseState]]: 0 pending, 1 fulfilled, 2 rejected.
233PromiseResultleaf1[[PromiseResult]].
234FulfillPromiseleaf2FulfillPromise ( promise, value ), 27.2.1.4: reactions become jobs. No-op unless pending.
235RejectPromiseleaf2RejectPromise ( promise, reason ), 27.2.1.7, with the rejection tracker. No-op unless pending.
236PromiseClaimResolveleaf1Sets the [[AlreadyResolved]] of p’s own resolving functions (and internal capability); false if it was already set.
237PerformPromiseThenleaf4PerformPromiseThen ( promise, onFulfilled, onRejected, resultCapability ), 27.2.5.4.1, without the result: handlers that are not callable count as empty.
238EnqueuePromiseResolveThenableJobleaf3Queues NewPromiseResolveThenableJob ( promise, thenable, then ), 27.2.2.2.
239NewRecordleaf1A new internal Record with n slots, all undefined.
240RecordGetleaf2Slot i of a Record, or of an object that keeps its state in slots (IteratorHelper).
241RecordSetleaf3
242NewBuiltinClosureleaf3A function (name “”, length) that calls the builtin kind (the table in interp/run/intrinsics.rs: 0 PromiseResolveFunction, 1 PromiseRejectFunction, 2 GetCapabilitiesExecutor, 3 PromiseAllResolveElement, 4 PromiseAllSettledResolveElement, 5 PromiseAllSettledRejectElement, 6 PromiseAnyRejectElement, 7 PromiseThenFinally, 8 PromiseCatchFinally, 9 PromiseValueThunk, 10 PromiseThrower, 11 AsyncGeneratorAwaitReturnFulfilled, 12 AsyncGeneratorAwaitReturnRejected, 13 AsyncFromSyncIteratorUnwrap, 14 AsyncFromSyncIteratorCloseThrow, 15 ProxyRevokeFunction, 16 FromAsyncFulfilled, 17 FromAsyncRejected, 18 AsyncDisposeFulfilled, 19 AsyncDisposeRejected, 20 DecoratorAddInitializer, 21 DecoratorAccessGet, 22 DecoratorAccessSet, 23 DecoratorAccessHas, 24 DecoratorParamCall) with this = data and its own arguments.
243GeneratorStateleaf1The state of a generator object (not an async state), or -1 for anything else.
244GeneratorSetStateleaf2
245GeneratorResumereentrant3Resumes a suspended generator or async function (state 0 or 1) in a frame of its own: mode 0 continues with value (a generator at a yield gets value false, an async function the value), 1 throws value at the suspension point, 2 (generators at a yield) returns value from there (value true). The result is what the activation hands back when it next suspends or completes.
246IsAsyncFunctionStateleaf1Whether v is the state of an async function call.
247AsyncFunctionPromiseleaf1The result promise of an async function call.
248AsyncGeneratorStateleaf1The state of an async generator, or -1 for anything else.
249AsyncGeneratorEnqueueleaf2Appends a request to the generator’s queue.
250AsyncGeneratorFirstRequestleaf1The oldest request, or undefined.
251AsyncGeneratorDequeueleaf1Removes and returns the oldest request (undefined if none).
252CreateAsyncFromSyncIteratorleaf2CreateAsyncFromSyncIterator ( syncIteratorRecord ), 27.1.6.1: a Record [iterator, next] with %AsyncFromSyncIteratorPrototype%.
253CreateIteratorHelperleaf3A new IteratorHelper object of kind (0: Iterator.from’s wrapper, with %WrapForValidIteratorPrototype%; else a helper, with %IteratorHelperPrototype%): slot 0 kind, 1 state 0, 2 iterator, 3 next, the others undefined.
254ThisIteratorHelperleaf2v if it is an iterator helper (wrap false) or Iterator.from’s wrapper (wrap true), else TypeError “Iterator Helper object expected” / “Iterator Wrap object expected”.
255WeakRefCreateleaf2A new WeakRef with prototype proto and target (AddToKeptObjects ( target ) too).
256WeakRefDerefleaf1WeakRefDeref of v (AddToKeptObjects of a live target): the target, or undefined once it died. TypeError “WeakRef object expected” for anything else.
257FinalizationRegistryCreateleaf2A new FinalizationRegistry with prototype proto and cleanupCallback.
258ThisFinalizationRegistryleaf1v if it is a FinalizationRegistry, else TypeError “FinalizationRegistry object expected”.
259FinalizationRegistryRegisterleaf4Appends a cell (token undefined for none).
260FinalizationRegistryUnregisterleaf2Removes the cells registered with token; whether there were any.
261FinalizationRegistryNextDeadleaf1The index of the first cell whose target died, or -1.
262FinalizationRegistryTakeleaf2The held value of dead cell i, removing the cell.
263FinalizationRegistrySetQueuedleaf2Marks whether a cleanup job for r is queued.
264DisposableStackCreateleaf2A new DisposableStack (isAsync false) or AsyncDisposableStack with prototype proto: slot 0 isAsync, 1 state 0 (pending), 2 a new empty Array of resources.
265ThisDisposableStackleaf2v if it is a DisposableStack (isAsync false) or an AsyncDisposableStack, else TypeError “DisposableStack object expected” / “AsyncDisposableStack object expected”.
266JsonParseleaf2JSON.parse of text without a reviver; qjs’s SyntaxError for invalid JSON. With withSource, an Array [value, record] where record is the JSON Parse Record tree for the reviver’s source text access: [value, source, elements, entries] (D1611).
267JsonRawJSONleaf1JSON.rawJSON’s work after ToString: a frozen, null-prototype RawJSON object with the own property rawJSON = text; SyntaxError “invalid rawJSON string” unless text is a JSON primitive without leading or trailing whitespace.
268IsRawJSONleaf1Whether v has [[IsRawJSON]] (a JSON.rawJSON object).
269JsonStringifyFastleaf2JSON.stringify(v, undefined, space) with gap already computed, for plain data: the string, undefined for an undefined result, or null when the value needs the full algorithm (accessors, toJSON, wrappers, exotic objects; nothing observable happened). TypeError “circular reference” and RangeError “Maximum call stack size exceeded” are final.
270JsonStringifyFastAtleaf4JsonStringifyFast for an object the full algorithm reached, after its toJSON and replacer (its own toJSON is not looked at again), nested in the objects of the algorithm’s stack (a cycle back to one throws; they set the indentation), with an array replacer’s PropertyList or undefined: the string, or null when it is not plain data.
271JsonQuoteleaf1QuoteJSONString ( value ), 25.5.2.3.
272CreateDataPropertyreentrant3CreateDataProperty ( O, P, V ): false if refused.
273IsBigIntleaf1
274ToBigIntPrimitiveleaf1ToBigInt of a primitive: TypeError for undefined, null, numbers and symbols; SyntaxError for a bad string.
275NumberToBigIntleaf1NumberToBigInt ( number ), 21.2.1.1.1: RangeError unless integral.
276BigIntToStringleaf2The digits of a BigInt in radix 2..36.
277BigIntAsIntNleaf2BigInt.asIntN on an index and a BigInt.
278BigIntAsUintNleaf2BigInt.asUintN on an index and a BigInt.
279BigIntToNumberleaf1The Number value of a BigInt (rounded to nearest).
280IsRegExpObjectleaf1Whether v is a RegExp object (has [[RegExpMatcher]]).
281RegExpCreateleaf3RegExpAlloc + RegExpInitialize after the ToStrings: a new RegExp with prototype proto (%RegExp.prototype% for undefined) and lastIndex 0. qjs’s SyntaxError for a bad pattern or flags. Regex literals compile to this.
282RegExpSourceleaf1[[OriginalSource]] of a RegExp object.
283RegExpFlagsleaf1[[OriginalFlags]] of a RegExp object, in canonical order.
284RegExpHasFlagleaf2Whether a RegExp object has the flag letter flag.
285RegExpEscapedSourceleaf1EscapeRegExpPattern of [[OriginalSource]] ((?:) when empty).
286RegExpExecRawleaf4RegExpBuiltinExec ( R, S ) once lastIndex is Get(R, “lastIndex”) as a Number (ToLength is applied here): the match array or null, and lastIndex updated for g and y. Pass undefined as state: when the fuel runs out mid-match the interpreter suspends here and keeps the matcher’s state in that argument. InternalError “out of memory in regexp execution” if the backtracking stack overflows.
287RegExpTestRawleaf4RegExpExecRaw without the match array: whether it matched (lastIndex is updated the same way). Suspendable like RegExpExecRaw.
288IsOriginalRegExpExecleaf1Whether v is the original RegExp.prototype.exec (the installed builtin).
289CreateRegExpStringIteratorleaf4A RegExp String Iterator (CreateRegExpStringIterator, 22.2.9.1).
290RegExpStringIteratorSlotleaf2Slot i of a RegExp String Iterator: 0 the regexp, 1 the string, 2 global, 3 unicode, 4 done. TypeError “RegExp String Iterator object expected” for anything else.
291RegExpStringIteratorFinishleaf1Marks a RegExp String Iterator done.
292RegExpEscapeStringleaf1RegExp.escape of a string (EncodeForRegExpEscape, qjs’s lowercase hex).
293IsPristineRegExpleaf1Whether v is a RegExp whose protocol lookups (exec, flags and the flag getters, constructor, Symbol.species, Symbol.match, lastIndex) are all original data, so that skipping them is unobservable (D1503).
294RegExpSplitRawleaf4RegExp.prototype[Symbol.split] of a pristine RegExp on a non-empty string with 0 < lim: the result array. Suspendable like RegExpExecRaw (pass undefined as state).
295RegExpReplaceRawleaf4RegExp.prototype[Symbol.replace] of a pristine global RegExp with a string replacement template: the result, and lastIndex 0. Suspendable like RegExpExecRaw.
296IsDenseArrayleaf1Whether v is an Array whose elements 0 .. length-1 are all present in its dense store (no holes): reading them with Get then runs no user code.
297AllNumbersleaf1Whether every element of a dense array (no holes) is a Number.
298AllCodePointsleaf1Whether every element of a dense array is an integral Number in [0, 0x10FFFF].
299InstallMethodleaf4Defines f as a method of the object at the dotted path target (from the global object): writable, configurable, not enumerable, with name = key and length. The key is a string or a symbol ([Symbol.iterator] paths).
300InstallConstructorleaf5@constructor: defines f as the global constructor key (writable, configurable, not enumerable) and sets its name and length; with a parent (a dotted path), f’s [[Prototype]] is the parent constructor. Its statics follow, then InstallPrototype.
301InstallPrototypeleaf3The prototype of the constructor key, installed after its statics (D2052, qjs’s order): the realm’s intrinsic prototype for that name if there is one, else a new object inheriting from the parent’s prototype (or Object.prototype). Sets f.prototype.
302InstallPrototypeConstructorleaf1prototype.constructor of the constructor key, installed among the prototype’s methods where qjs’s order puts it (D2150).
303InstallAccessorleaf4@getter/@setter: one half of an accessor (configurable, not enumerable).
304InstallValueleaf4@value: a data property with attrs (writable 1, enumerable 2, configurable 4).
305InstallIntrinsicleaf2Registers f so that privileged code can call it as %name(…).
306MarkNativeleaf2Makes the builtin f native builtin index of the generated table: with native builtins on, its calls run the Rust state machine.
307MarkFastleaf1Gives the builtin f its leaf fast path (@fast, D1850): with native builtins on, a call first tries the Rust function of the same name in builtins/fast.rs.
308ArraySpeciesCreatebuiltin (JS)2
309ArrayConstructorbuiltin (JS)0 + rest
310ArraySpeciesbuiltin (JS)0
311FindViaPredicatebuiltin (JS)6
312EveryOrSomebuiltin (JS)4
313Reducebuiltin (JS)4
314SortListbuiltin (JS)3
315CollectPresentbuiltin (JS)3
316ArraySetLengthbuiltin (JS)3
317AsyncGeneratorStepbuiltin (JS)3
318AsyncGeneratorAwaitReturnFulfilledbuiltin (JS)1
319AsyncGeneratorAwaitReturnRejectedbuiltin (JS)1
320GetAsyncIteratorbuiltin (JS)1
321AsyncIteratorReturnMethodbuiltin (JS)1
322AsyncIteratorCloseThrowbuiltin (JS)1
323AsyncFromSyncIteratorUnwrapbuiltin (JS)1
324AsyncFromSyncIteratorCloseThrowbuiltin (JS)1
325ToBigIntbuiltin (JS)1
326ToNumericbuiltin (JS)1
327ToPrimitivebuiltin (JS)2
328ToNumberbuiltin (JS)1
329ToStringbuiltin (JS)1
330LengthOfArrayLikebuiltin (JS)1
331ToPropertyKeybuiltin (JS)1
332GetPrototypeFromConstructorbuiltin (JS)2
333DatePrototypeValueOfbuiltin (JS)0
334DatePrototypeToISOStringbuiltin (JS)0
335DatePrototypeToJSONbuiltin (JS)1
336DatePrototypeToPrimitivebuiltin (JS)1
337DecoratorStartbuiltin (JS)2
338ApplyDecoratorsbuiltin (JS)6
339DecoratorRunInitsbuiltin (JS)3
340DecoratorRunExtrasbuiltin (JS)3
341DecoratorAddInitializerbuiltin (JS)1
342DecoratorAccessGetbuiltin (JS)1
343DecoratorAccessSetbuiltin (JS)2
344DecoratorAccessHasbuiltin (JS)1
345ApplyLegacyDecoratorsbuiltin (JS)4
346DecoratorParambuiltin (JS)2
347DecoratorParamCallbuiltin (JS)2
348DecoratorMetadatabuiltin (JS)2
349AsyncDisposeFulfilledbuiltin (JS)1
350AsyncDisposeRejectedbuiltin (JS)1
351UsingCreatebuiltin (JS)0
352UsingAddbuiltin (JS)2
353AwaitUsingAddbuiltin (JS)2
354UsingDisposeErrorbuiltin (JS)2
355UsingDisposebuiltin (JS)1
356UsingDisposeStepbuiltin (JS)1
357UsingAwaitValuebuiltin (JS)1
358CallPrepareStackTracebuiltin (JS)4
359ThrowWithStackbuiltin (JS)1
360MicrotaskJobbuiltin (JS)1
361FromAsyncFulfilledbuiltin (JS)1
362FromAsyncRejectedbuiltin (JS)1
363InstanceofOperatorbuiltin (JS)2
364ClassHeritagebuiltin (JS)1
365ThrowTypeErrorbuiltin (JS)1
366FunctionPrototypeBehaviorbuiltin (JS)0
367AsyncAwaitbuiltin (JS)2
368AsyncFunctionReturnbuiltin (JS)2
369AsyncFunctionThrowbuiltin (JS)2
370GeneratorFunctionConstructorbuiltin (JS)0 + rest
371AsyncGeneratorFunctionConstructorbuiltin (JS)0 + rest
372AsyncFunctionConstructorbuiltin (JS)0 + rest
373DynamicImportbuiltin (JS)2
374GetIteratorbuiltin (JS)1
375IteratorClosebuiltin (JS)1
376IteratorCloseThrowbuiltin (JS)1
377IteratorRestbuiltin (JS)2
378ArrayPrototypeValuesbuiltin (JS)0
379ArrayIteratorPrototypeNextbuiltin (JS)0
380StringPrototypeIteratorbuiltin (JS)0
381StringIteratorPrototypeNextbuiltin (JS)0
382SerializeJSONPropertybuiltin (JS)7
383JSONStackIncludesbuiltin (JS)2
384JSONJoinbuiltin (JS)7
385SerializeJSONObjectbuiltin (JS)6
386SerializeJSONArraybuiltin (JS)6
387AddEntriesFromIterablebuiltin (JS)3
388MapPrototypeSetbuiltin (JS)2
389MapIteratorPrototypeNextbuiltin (JS)0
390ResolvePromisebuiltin (JS)2
391PromiseResolveFunctionbuiltin (JS)1
392PromiseRejectFunctionbuiltin (JS)1
393GetCapabilitiesExecutorbuiltin (JS)2
394PromiseReactionJobbuiltin (JS)4
395PromiseResolveThenableJobbuiltin (JS)3
396PromiseConstructorbuiltin (JS)1
397PromiseAllResolveElementbuiltin (JS)1
398PromiseAllSettledResolveElementbuiltin (JS)1
399PromiseAllSettledRejectElementbuiltin (JS)1
400PromiseAnyRejectElementbuiltin (JS)1
401PromiseThenFinallybuiltin (JS)1
402PromiseCatchFinallybuiltin (JS)1
403PromiseValueThunkbuiltin (JS)0
404PromiseThrowerbuiltin (JS)0
405HostCallSettlebuiltin (JS)3
406ProxyRevokeFunctionbuiltin (JS)0
407ProxyGetPrototypeOfbuiltin (JS)1
408ProxySetPrototypeOfbuiltin (JS)2
409ProxyIsExtensiblebuiltin (JS)1
410ProxyPreventExtensionsbuiltin (JS)1
411ProxyGetOwnPropertyDescriptorObjectbuiltin (JS)2
412ProxyHasOwnPropertybuiltin (JS)2
413ProxyOwnPropertyAttributesbuiltin (JS)2
414ProxyDefineOwnPropertyFromRecordbuiltin (JS)3
415ProxyDefineDataPropertyOrThrowbuiltin (JS)4
416ProxyCreateDataPropertybuiltin (JS)3
417ProxyCreateDataPropertyOrThrowbuiltin (JS)3
418ProxyHasbuiltin (JS)2
419ProxyGetbuiltin (JS)3
420ProxySetbuiltin (JS)4
421ProxySetOrThrowbuiltin (JS)4
422ProxySetOnReceiverbuiltin (JS)3
423ProxyDeletePropertybuiltin (JS)2
424ProxyDeletePropertyOrThrowbuiltin (JS)2
425ProxyOwnPropertyKeysbuiltin (JS)2
426ProxyCallbuiltin (JS)3
427ProxyConstructbuiltin (JS)3
428OrdinaryConstructSlowbuiltin (JS)3
429ProxySetIntegrityLevelbuiltin (JS)2
430ProxyTestIntegrityLevelbuiltin (JS)2
431ForInStepbuiltin (JS)1
432RegExpSpeciesbuiltin (JS)0
433RegExpPrototypeHasIndicesbuiltin (JS)0
434RegExpPrototypeGlobalbuiltin (JS)0
435RegExpPrototypeIgnoreCasebuiltin (JS)0
436RegExpPrototypeMultilinebuiltin (JS)0
437RegExpPrototypeDotAllbuiltin (JS)0
438RegExpPrototypeUnicodebuiltin (JS)0
439RegExpPrototypeUnicodeSetsbuiltin (JS)0
440RegExpPrototypeStickybuiltin (JS)0
441RegExpPrototypeFlagsbuiltin (JS)0
442RegExpPrototypeExecbuiltin (JS)1
443RegExpPrototypeMatchbuiltin (JS)1
444SetPrototypeAddbuiltin (JS)1
445SetIteratorPrototypeNextbuiltin (JS)0
446ArraySpreadbuiltin (JS)2
447CopyDataPropertiesbuiltin (JS)2
448CopyDataPropertiesExcludingbuiltin (JS)2
449TypedArraySetElementSlowbuiltin (JS)3
450FinalizationRegistryCleanupJobbuiltin (JS)1