Class JSObject

A JavaScript Object reference.

class JSObject
  : JSValue ;

Adapted from JSObjectRef in Apple's JavaScriptCore.

Constructors

NameDescription
this (machine, value, data) Constructs an Object given a value slot.

Fields

NameTypeDescription
id const(short)ID of this value in it's Machine.
slot const(xs.bindings.xsSlotRecord)Machine slot of this value.

Properties

NameTypeDescription
constructor[get] boolWhether this Object can be called as a constructor.
data[get] void*This Object’s private data.
extensible[get] bool
function_[get] boolWhether this Object can be called as a function.
propertyNames[get] string[]The names of this Object’s enumerable properties.
prototype[get] JSValueGets this Object’s prototype.
prototypeName[get] stringGets this Object's prototype's constructor's name.
boolean[get] boolConvert this value to a bool value.
convertableToObject[get] boolWhether this value is convertable to a JSObject value.
integer[get] intConvert this value to an int value.
number[get] doubleConvert this value to a double value.
object[get] JSObjectConvert this value to a JSObject value.
string_[get] stringConvert this value to a string value.
unsigned[get] uintConvert this value to an uint value.

Methods

NameDescription
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.