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§
- 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§
- 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.- 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 [[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.- 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_
known_ builtin - is_
object_ builtin_ method - 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.- 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. - proto_
method - Dispatch a
@proto:<Ctor>:<method>thunk (a method read off a builtin prototype, e.g.Object.prototype.toString) againstrecv(its invoke-timethis).Object.prototype.toStringyields the[object Tag]brand string libraries type-check on; every other method routes through normal method dispatch onrecv. - 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.