Expand description
JavaScript values, and the conversions between them.
A Value is what the VM’s stack and every property hold. The number split
between Value::Int and Value::Float mirrors QuickJS’s JS_TAG_INT /
JS_TAG_FLOAT64: keeping small integers as i32 makes array indices and loop
counters exact and cheap. Every arithmetic result that does not fit i32
becomes a Float, so the two are interchangeable numerically and only
Value::strict_equals has to care about which one it has.
Structs§
- Cell
- A mutable binding cell, shared between closures.
- JsString
- An immutable string, stored on the GC heap.
- JsSymbol
- A JavaScript symbol, stored on the GC heap.
- Wtf8
- A JavaScript string’s bytes, in WTF-8.
Enums§
- Value
- A JavaScript value.
Constants§
- JS_
STRING_ LEN_ MAX - The longest string this engine will build, which is the reference’s
JS_STRING_LEN_MAX.text += textin a loop is the program that reaches it, and the ceiling is what turns that intoInternalError: string too longinstead of an overflow.
Functions§
- number_
to_ string ToStringapplied to a number.- number_
to_ string_ for_ print ToStringas the engine’sprintapplies it, which differs from the language one for negative zero.- string_
to_ number ToNumberapplied to a string.- to_
int32 ToInt32.