7 Runtime System
This library implements the JavaScript runtime system. It can be required via:
(require javascript/runtime) | package: javascript |
7.1 Namespaces
procedure
procedure
(reset-js-namespace! ns) → any
ns : namespace?
7.2 Values
All Scheme values are legal JavaScript values. A subset of Scheme values are designated as native JavaScript values. A native value is one of:
void?: the JavaScript undefined value
null?: the JavaScript null value
boolean?: a JavaScript primitive boolean value
string?: a JavaScript primitive string value
number?: a JavaScript primitive number value
object?: a JavaScript object
function?: a JavaScript function
array?: a JavaScript primitive array object
wrapper?: a JavaScript object wrapping a primitive value
7.3 Objects
The type object? is an opaque structure type. The types function?, array? and wrapper? are structure subtypes of object?. All objects carry an internal, mutable property table.
property-value?
Plain value properties are assumed to have no attributes. An attributed value may have any combination of the attributes DONT-ENUM?, READ-ONLY?, and DONT-DELETE?.
struct
(struct attributed (value attributes) #:extra-constructor-name make-attributed) value : value? attributes : bit-set?
A bit-set is an efficient representation of a vector of booleans.
procedure
(bit-flag-set? x bit) → boolean?
x : bit-field? bit : bit?
value
READ-ONLY? : bit?
value
DONT-ENUM? : bit?
value
DONT-DELETE? : bit?
value?
A ref is a special property with custom get, set, and delete behavior.
procedure
(delete-ref! x) → any
x : ref?
procedure
(has-property? x key) → boolean?
x : object? key : string?
procedure
(has-own-property? x key) → boolean?
x : object? key : string?
procedure
(has-attribute? x bit) → boolean?
x : property? bit : bit?
procedure
(object-get x key) → (optional/c value?)
x : object? key : string?
procedure
(object-set! x key v) → any
x : object? key : string? v : value?
procedure
(object-delete! x key) → any
x : object? key : string?
procedure
(object-keys-stream x) → (-> string?)
x : object?
7.4 JavaScript Library
value
global-object : object?
procedure
(install-standard-library! global) → any
global : object?