Entry: JSPropertySpec (Data Structure)
Summary: Defines a single property for an object.
Syntax:
struct JSPropertySpec {
const char *name;
int8 tinyid;
uint8 flags;
JSPropertyOp getter;
JSPropertyOp setter;
};
Argument Type Description
*name const char Name to assign to the property.
tinyid int8 Unique ID number for the property to aid in resolving getProperty and setProperty method calls.
flags uint8 Property attributes. If 0, no flags are set. Otherwise, the following attributes can be used singly or OR'd together:
JSPROP_ENUMERATE: property is visible in for loops.
JSPROP_READONLY: property is read-only.
JSPROP_PERMANENT: property cannot be deleted.
JSPROP_EXPORTED: property can be exported outside its object.
JSPROP_INDEX: property is actual an array element.
getter JSPropertyOp getProperty method for the property.
setter JSPropertyOp setProperty method for the property. Read-only properties should not have a setProperty method.
Description:
JSPropertySpec defines the attributes for a single JS property to associate with an object. Generally, you populate an array of JSPropertySpec to define all the properties for an object, and then call JS_DefineProperties to create the properties and assign them to an object.
See also:
|
|
|