Expand description
Builtin op handlers (compiler-emitted CallBuiltin ids) plus the JS standard
library (console, Math, JSON, Object, array/string methods) reachable
from the host. Handlers pop their arguments off the VM operand stack and
return the result value, which the VM pushes back.
Constants§
- DEFAULT_
PREPARE [[Get]](name, receiver)— 10.1.8.receiveris the object the read STARTED from and is what a getter sees asthis; it differs fromrecvonly when the read was forwarded down a prototype chain, which is whyReflect.get(t, k, r)and a Proxygettrap’s third argument both need it. Every ordinary read passesrecvitself. Re-format an error’s.stackheader on its first read, the way V8 does.- DOM_
EXCEPTION_ CODES - The legacy numeric
DOMException.codea WHATWG error name maps to. A name outside the table — including the default"Error"— reports 0. - OBJECT_
PROTO_ METHODS - The
Object.prototypemethods installed as thunks on the realObject.prototypeobject, soObject.prototype.toString.call(x)and a class prototype’s inheritedhasOwnPropertyboth resolve through the chain. - REQUIRE_
CACHE - The namespace name of the
require.cacheview. ABuiltinrather than an object literal because the module cache is the single source of truth: a populated copy would answer reads correctly and silently ignore adelete, which is the operation the property exists for.
Functions§
- builtin_
meta - The
nameandlengtha builtin function reports, from the generated intrinsic table (crate::arity::BUILTIN_ARITY).Nonefor a key the table does not cover — every non-function namespace (Math,require('fs')), and the core-module functions, whose arity is not specified anywhere. - builtin_
name - The
namea builtin function reports. The table answers for an intrinsic; anything else falls back to the last segment of the key, which is what the name is for every builtin this frontend synthesizes:@proto:TypedArray:setissetandfs.readFileSyncisreadFileSync. Reporting the whole key was how[Function: @proto:TypedArray:set]reachedconsole.log. - call_
builtin_ function - Call a resolved builtin function (global or
namespace.method). - call_
type_ method - Dispatch
recv.name(args)for the built-in prototype methods. - construct_
builtin - Construct via
newfor the builtin constructors. - define_
property_ pub [[DefineOwnProperty]]reachable fromcrate::proxy’s no-trap forward.- delete_
property [[Delete]](10.1.10) for an already-resolved property key: the one placedelete o[k],delete o.kandReflect.deletePropertyall go through, so the three cannot drift. Reportsfalsefor a non-configurable property (sloppy mode ignores the failure rather than throwing) andtrueotherwise, which is also what deleting an absent key reports.- dom_
exception new DOMException(message, name).- dom_
exception_ slot - A
DOMException’sname/message/code, which live in internal slots rather than as own properties.Nonefor anything else. - dynamic_
function - Build a callable from a complete function-expression source text — the ONE dynamic-function generator on this frontend.
- error_
string - A short
Name: messagestring for an error value (used when an await rejection unwinds as a thrown error). - eval_
source eval(src).directselects the scope the source runs in: a DIRECT eval — the literaleval(...)call form — evaluates in the CALLER’s scope, every other route to the same function value is an INDIRECT eval and evaluates in the global scope (ECMA-262 19.2.1.1PerformEval). The two are told apart inhost::call_named, whichops::CALLreaches andops::CALL_VALUE/APPLYdo not.- function_
builtin_ method Function.prototypemethods (call/apply/bind) plusSymbol.prototype/ generator handling done elsewhere. ReturnsOk(None)ifnameis not one of these (so the caller can try statics).- function_
ctor new Function(p1, …, pN, body)/Function(p1, …, pN, body).- get_
property - get_
property_ recv - has_
property key in objrespecting the prototype chain. Reports aResultbecause a Proxy’shastrap is user code and may throw.- install
- Register every node-js builtin id on a VM.
- is_
arguments - The bare brand name behind
Object.prototype.toString(Array,Uint8Array…), without the[object …]wrapper. Split out so the brand and theSymbol.toStringTagproperty read cannot disagree about what a value is. Whethervis a function’sargumentsobject. - is_
arguments_ h is_argumentsfor a caller that already holds the host borrow —object_brandruns under one, and re-entering throughwith_hostaborts the process.- is_
known_ builtin - is_
object_ builtin_ method - materialize_
stack - namespace_
constants - The numeric constants a core namespace owns, in the order node reports them
under
getOwnPropertyNames. ONE table rather than a value match plus a name list: the enumeration and the read have to agree, and they did not — every one of these read correctly whileObject.getOwnPropertyNames(Math)omitted all eight of Math’s, so a member that plainly exists was invisible to any reflective copy of the namespace. - namespace_
property - A property on a builtin namespace object (
Math.PI,Number.MAX_SAFE_INTEGER,console.log). - numeric_
hook - Host callback for arithmetic fusevm cannot complete natively (a non-
Int/ non-Floatoperand). Supplies JavaScript+concatenation and coercion. - object_
builtin_ method - Dispatch an
Object.prototypebuiltin method on an object/instance. - own_
descriptor_ pub [[GetOwnProperty]]reachable fromcrate::proxy’s no-trap forward.- own_
prop_ facts - An object’s OWN property as
(value, writable, configurable, is_accessor), orNonewhen it has none. Reads through a Proxy’sgetOwnPropertyDescriptortrap, so it answers for any object. - pending_
promise_ with_ resolver Promise.withResolvers()— a fresh pending promise paired with its own resolve/reject continuations (the same@@presolve/@@prejectthunks the executor receives), returned as a plain{ promise, resolve, reject }object. A fresh pending promise paired with the thunk that resolves it, for stdlib callers that hand the resolver to an event listener.- private_
brand_ message - The
TypeErrora failed private brand check raises. Node words it two ways: a private METHOD or accessor names the class the receiver should have been an instance of, while a private FIELD names the member. - promise_
resolve_ pub Promise.resolve(v)for stdlib callers that need to hand back an already-settled promise.- promise_
species_ from - The species constructor of a promise RECEIVER — what
then/catch/finallybuild their result with (SpeciesConstructor(p, %Promise%), 27.2.5.4 step 3). - proto_
getter_ name - The
nameof an intrinsic accessor’s getter thunk, orNonefor anything else. Kept out ofbuiltin_name’s&strreturn, which cannot own the"get size"it has to build. - proto_
method - prototype_
of [[GetPrototypeOf]](10.1.1) — the answerObject.getPrototypeOf,Reflect.getPrototypeOfand a__proto__READ all have to agree on.- set_
property_ pub [[Set]]reachable fromcrate::proxy’s no-trap forward, which has to land on the same path a plaino.k = vtakes.- set_
with_ receiver OrdinarySetWithOwnDescriptor(10.1.9.2) with a receiver distinct from the object the lookup started on — whatReflect.set(t, k, v, receiver)and a proxysettrap forwarding to it both need.- to_
bigint ToBigInt(v)— 7.1.13. The conversion every BigInt-typed SINK performs: a 64-bit typed array’s element write,DataView.prototype.setBigInt64, and BigInt arithmetic’s operand check.- to_
object ToObject(v)(7.1.18) for a primitive: the wrapper object with the matching prototype and a[[StringData]]/[[NumberData]]/[[BooleanData]]slot.- uses_
side_ table Object(x): box/pass-through — for our model, non-object args just return a fresh object; objects pass through. Whetherv’s own properties live in the fn-prop SIDE TABLE rather than in a property map. AMap/Set/Promise/RegExp/generator/symbol/bigint is an ordinary object that also has internal slots, so it can carry own properties like anything else — but its heap variant holds only those slots, so a write had nowhere to go and vanished:m.x = 5leftm.xundefined.- wrapped_
primitive - The primitive a wrapper object boxes (
new String("a")→"a"), orNonefor every other value. The slot is a hidden@@primitiveown property — the same@@marker convention the engine already uses for internal state, so it stays out ofObject.keysandJSON.stringifyon its own.