QuickBEAM.VM.Interpreter.Values.Coercion (QuickBEAM v0.10.9)

Copy Markdown View Source

JS type coercion: to_number, to_int32, to_uint32, to_primitive, to_string_val, and numeric parsing.

Summary

Functions

Compatibility wrapper for primitive coercion.

Converts a function-like VM value to its primitive string representation.

Parses an integer in a radix and returns :nan on invalid input.

Parses a JavaScript numeric string literal into a VM number value.

Coerces a VM value using JavaScript ToInt32 semantics.

Coerces a VM value using JavaScript ToNumber semantics.

Coerces a VM value using JavaScript ToNumeric semantics.

Coerces an object value using JavaScript ToPrimitive semantics.

Coerces a VM value using JavaScript ToString semantics.

Coerces a VM value using JavaScript ToUint32 semantics.

Wraps an integer into JavaScript signed 32-bit range.

Functions

coerce_to_primitive(val)

Compatibility wrapper for primitive coercion.

fn_to_primitive(fun)

Converts a function-like VM value to its primitive string representation.

parse_int_or_nan(s, base)

Parses an integer in a radix and returns :nan on invalid input.

parse_numeric(s)

Parses a JavaScript numeric string literal into a VM number value.

to_int32(val)

Coerces a VM value using JavaScript ToInt32 semantics.

to_number(val)

Coerces a VM value using JavaScript ToNumber semantics.

to_numeric(obj)

Coerces a VM value using JavaScript ToNumeric semantics.

to_primitive(val)

Coerces an object value using JavaScript ToPrimitive semantics.

to_string_val(n)

Coerces a VM value using JavaScript ToString semantics.

to_uint32(val)

Coerces a VM value using JavaScript ToUint32 semantics.

wrap_int32(n)

Wraps an integer into JavaScript signed 32-bit range.