On this page:
7.2Values
7.3Objects
top
up

7Runtime SystemπŸ”— i

This library implements the JavaScript runtime system. It can be required via:

7.1NamespacesπŸ”— i

procedure

( make-js-namespace )namespace?

Creates a PLT namespace containing the standard JavaScript top-level bindings.

procedure

( reset-js-namespace! ns)any

Resets the global object in JavaScript namespace ns.

7.2ValuesπŸ”— i

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.3ObjectsπŸ”— i

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.

A property is one of:

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 (valueattributes)
#:extra-constructor-namemake-attributed )
value:value?
attributes:bit-set?

A bit-set is an efficient representation of a vector of booleans.

procedure

( bit-flag-set? xbit)boolean?

x:bit-field?
bit:bit?
Checks for a bit in a bit set.

value

READ-ONLY? :bit?

A bit representing the ECMAScript ReadOnly attribute.

value

DONT-ENUM? :bit?

A bit representing the ECMAScript DontEnum attribute.

value

DONT-DELETE? :bit?

A bit representing the ECMAScript DontDelete attribute.

A property-value is one of:

A ref is a special property with custom get, set, and delete behavior.

procedure

( ref? x)boolean?

x:any
Determines whether x is a ref.

procedure

( set-ref! xv)any

x:ref?
v:value?
Invoke x’s setter.

procedure

( delete-ref! x)any

x:ref?
Invoke x’s deleter.

procedure

( deref x)any

x:ref?
Invoke x’s getter.

procedure

( has-property? xkey)boolean?

x:object?
key:string?
Checks for the presence of property key in x, searching the prototype chain if necessary.

procedure

( has-own-property? xkey)boolean?

x:object?
key:string?
Checks for the presence of property key in x without searching the prototype chain.

procedure

( has-attribute? xbit)boolean?

x:property?
bit:bit?
Checks for attribute bit in property x.

procedure

( object-get xkey)(optional/cvalue?)

x:object?
key:string?
Attempts to lookup property key in x.

procedure

( object-set! xkeyv)any

x:object?
key:string?
v:value?
Sets property key in x.

procedure

( object-delete! xkey)any

x:object?
key:string?
Attempts to delete property key from x.

procedure

( object-keys-stream x)(-> string? )

x:object?
Produces an enumeration stream consistent with JavaScript’s for..in semantics.

7.4JavaScript LibraryπŸ”— i

value

global-object :object?

The global object.

procedure

( install-standard-library! global)any

global:object?
Installs the properties of the standard library in global.

top
up

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /