Class JSObject
A JavaScript Object reference.
Adapted from JSObjectRef
in Apple's JavaScriptCore.
Constructors
Name | Description |
---|---|
this
(machine, value, data)
|
Constructs an Object given a value slot. |
Fields
Name | Type | Description |
---|---|---|
id
|
const(short) | ID of this value in it's Machine .
|
slot
|
const(xs | Machine slot of this value. |
Properties
Name | Type | Description |
---|---|---|
constructor [get]
|
bool | Whether this Object can be called as a constructor. |
data [get]
|
void* | This Object’s private data. |
extensible [get]
|
bool | |
function_ [get]
|
bool | Whether this Object can be called as a function. |
propertyNames [get]
|
string[] | The names of this Object’s enumerable properties. |
prototype [get]
|
JSValue | Gets this Object’s prototype. |
prototypeName [get]
|
string | Gets this Object's prototype's constructor's name. |
boolean [get]
|
bool | Convert this value to a bool value.
|
convertableToObject [get]
|
bool | Whether this value is convertable to a JSObject value.
|
integer [get]
|
int | Convert this value to an int value.
|
number [get]
|
double | Convert this value to a double value.
|
object [get]
|
JSObject | Convert this value to a JSObject value.
|
string_ [get]
|
string | Convert this value to a string value.
|
unsigned [get]
|
uint | Convert this value to an uint value.
|
Methods
Name | Description |
---|---|
callAsContructor
(target, params)
|
Calls this Object as a constructor. |
callAsFunction
(target, params)
|
Calls this Object as a Function. |
callAsFunction_noResult
(target, params)
|
Calls this Object as a Function. |
deleteProperty
(key)
|
Deletes a property from this Object. |
deletePropertyAt
(id)
|
Deletes a property from this Object given its numeric index. |
getProperty
(key)
|
Gets a property from this Object. |
getPropertyAt
(id)
|
Gets a property from this Object given its numeric index. |
hasProperty
(key)
|
Tests whether this Object has a given property. |
hasPropertyAt
(id)
|
Tests whether this Object has a property given its numeric index. |
make
(machine, data)
|
Creates a JavaScript Object. |
makeArray
(machine, length)
|
Creates a JavaScript Array object. |
makeDate
(machine, arguments)
|
Creates a JavaScript Date object, as if by invoking the built-in Date constructor. |
makeError
(machine, arguments)
|
Creates a JavaScript Error object, as if by invoking the built-in Error constructor. |
makeFunction
(machine)
|
Creates a function with the given callback, Func as its implementation.
|
makeRegExp
(machine)
|
Creates a JavaScript RegExp object, as if by invoking the built-in RegExp constructor. |
setProperty
(key, value)
|
Sets a property from this Object. |
setPropertyAt
(id, value)
|
Sets a property from this Object given its numeric index. |