6 Runtime System
This library implements the JavaScript runtime system. It be can required via:
(require (planet dherman/javascript:6/runtime)) |
6.1 Namespaces
Creates a PLT namespace containing the standard JavaScript top-level bindings.
ns : namespace? |
Resets the global object in JavaScript namespace ns.
6.2 Values
A JavaScript value is represented as one of:
'true–the JavaScript value true
'false–the JavaScript value false
void?–the JavaScript undefined value
null?–the JavaScript null value
string?–a JavaScript primitive string value
number?–a JavaScript primitive number value
object?–a JavaScript object
6.3 Objects
JavaScript objects are represented with the following structure type:
| |||||
call : function? | |||||
construct : function? | |||||
proto : object? | |||||
class : string? | |||||
properties : (hash-of string? property?) |
A JavaScript object.
property-value?
attributed?
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?.
| |||||
value : value? | |||||
attributes : bit-set? |
A bit-set is an efficient representation of a set of booleans.
x : bit-field? |
bit : bit? |
Checks for a bit in a bit set.
A bit representing the ECMAScript ReadOnly attribute.
A bit representing the ECMAScript DontEnum attribute.
A bit representing the ECMAScript DontDelete attribute.
ref?
value?
A ref is a special property with custom get, set, and delete behavior.
x : any |
Determines whether x is a ref.
x : ref? |
v : value? |
Invoke x’s setter.
x : ref? |
Invoke x’s deleter.
x : ref? |
Invoke x’s getter.
JavaScript array values are represented specially for faster access of numeric properties:
| |||||
vector : (evector-of property?) |
x : any |
Determines whether a value is a callable object.
x : object? |
key : string? |
Checks for the presence of property key in x, searching the prototype chain if necessary.
x : object? |
key : string? |
Checks for the presence of property key in x without searching the prototype chain.
x : property? |
bit : bit? |
Checks for attribute bit in property x.
x : object? |
key : string? |
Attempts to lookup property key in x.
x : object? |
key : string? |
v : value? |
Sets property key in x.
x : object? |
key : string? |
Attempts to delete property key from x.
x : object? |
Produces an enumeration stream consistent with JavaScript’s for..in semantics.
6.4 JavaScript Library
The global object.
global : object? |
Installs the properties of the standard library in global.