Defines a single property for an object.


struct JSPropertySpec {
    const char *name;
    int8 tinyid; Obsolete since JSAPI 31
    uint8 flags;
    JSPropertyOp getter;
    JSPropertyOp setter;
Name Type Description
name const char * Name to assign the property.
tinyid int8 Obsolete since JSAPI 31 Unique ID number for the property to aid in resolving getProperty and setProperty method calls. This value should be zero if you are not using tinyIDs (i.e. the getter/setter function is only used by one property).
flags uint8 Property attributes.
getter JSPropertyOp Getter method for the property.
setter JSPropertyOp Setter method for the property. If a property is read-only, its setter is never called.


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.

MXR ID Search for JSPropertySpec

Document Tags and Contributors

Last updated by: Jorend,