Skip to main content

Module vm

Module vm 

Source

Modules§

unstable
Unstable helpers

Structs§

Any
Array
BigInt
Function
A function value: it can be called, it has a length, it has a text, and it has an identity. Nothing else. It holds a VM’s own value, laid out as Unpacked lays out every value, which the VM constructs through its own capability, such as IStaticFunction, and Function::new wraps.
Number
A JavaScript number: an f64 that holds one NaN.
Object
OptionLambda
A region is open and no receiver is live: the state after a ?.() node, a?.(...b), or a |() or |?.() step inside a region. Its steps are |() (call) and |. (dot); no |?.(), and no |!() — there is no receiver for either to justify.
OptionPropertyLambda
Both bits live: the state after a ?. node, a?.b, or a |. step inside a region. Every step is legal here: |() (call), |. (dot), |?.() (option_call) and |!() (end_call).
PropertyLambda
A receiver is live and no region is open: the state after a . node, a.b. Its steps are |() (end_call) and |?.() (option_call); end is the bare node, the read with its receiver dropped — the one property read nanvm-lib has, dot(a, key).end().
String

Enums§

Constructor
The constructors instanceof may name: the EDAG’s constructorId, a closed list — Array alone today, where Map and Set are one variant each once the VM has such values. A name, not a value: no global is a value in the EDAG, so the operator’s right side is carried as the word it is, and a variant here rather than an Any<A>.
IteratorRecord
What Any::get_iterator returns: the values an iterable yields, one at a time, after ECMAScript’s Iterator Record. The spec’s record also holds a next method and a [[Done]] flag; this one is a Rust Iterator and needs neither.
JsonError
An Any<A> shape Any::to_json does not (yet) know how to render.
Nullish
https://developer.mozilla.org/en-US/docs/Glossary/Nullish “In JavaScript, a nullish value is the value which is either null or undefined. Nullish values are always falsy.”
ObjectSpread
What Any::object_spread returns: the entries {...v} copies, each a key and its value, in [[OwnPropertyKeys]] order. The object side’s counterpart of IteratorRecord, and like it a Rust iterator, never a VM value.
Unpacked

Traits§

IComplex
A heap value: cloned by reference, compared by identity.
IContainer
A sequence with a header: a string, a bigint, an array, an object.
IFunction
A function: what a program can do with one, and nothing it cannot.
IStaticFunction
A VM that makes a function out of a Rust static function: every VM, since IVm::static_function is the capability itself. The name is what compiled modules and the runtime’s member functions bound on, each a maker of functions, kept as the one spelling of that requirement where a bound on IVm alone would say less about what the code does.
IVm
A VM’s value representation.
ToAny
ToArray
ToObject
ToString

Functions§

runtime
The runtime as a value, runtime::<A>(): what whoever runs compiled modules builds once and hands each as its parameter (fjs/js/runtime/README.md, “How NaNVM finds it”). The runtime as a value: the runtime export of fjs/js/runtime, its static, dot and in functions, the first two over the tables they close over, as the ordinary backend prints any module — every static body a closure carrying the NativeFunction text of its id, Object.entries the built-in itself. Built once by whoever runs compiled modules and handed to each as its parameter (fjs/js/runtime/README.md).

Type Aliases§

Property
StaticCode
The code of a static function.