Skip to main content

Module value

Module value 

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

Functions§

number_to_string
ToString applied to a number.
number_to_string_for_print
ToString as the engine’s print applies it, which differs from the language one for negative zero.
string_to_number
ToNumber applied to a string.
to_int32
ToInt32.