Skip to main content

Module builtins

Module builtins 

Source
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.

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 new for the builtin constructors.
error_string
A short Name: message string for an error value (used when an await rejection unwinds as a thrown error).
function_builtin_method
Function.prototype methods (call/apply/bind) plus Symbol.prototype/ generator handling done elsewhere. Returns Ok(None) if name is not one of these (so the caller can try statics).
get_property
Read recv.name (also the computed-key path for string keys). Walks own properties, accessors, and the prototype chain (class methods / getters).
has_property
key in obj respecting the prototype chain.
install
Register every node-js builtin id on a VM.
is_known_builtin
is_object_builtin_method
numeric_hook
Host callback for arithmetic fusevm cannot complete natively (a non-Int/ non-Float operand). Supplies JavaScript + concatenation and coercion.
object_builtin_method
Dispatch an Object.prototype builtin method on an object/instance.
proto_method
Dispatch a @proto:<Ctor>:<method> thunk (a method read off a builtin prototype, e.g. Object.prototype.toString) against recv (its invoke-time this). Object.prototype.toString yields the [object Tag] brand string libraries type-check on; every other method routes through normal method dispatch on recv.