JavaScript-1.5 Reference

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;
};
NameTypeDescription
*nameconst charName to assign to the property.
tinyidint8Unique ID number for the property to aid in resolving getProperty and setProperty method calls.
flagsuint8Property 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.
getterJSPropertyOpgetProperty method for the property.
setterJSPropertyOpsetProperty 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

Groups [ Data Structure ]
Documents [ LXR ID Search ]
Entries [ JSPROP_ENUMERATE | JSPROP_EXPORTED | JSPROP_INDEX | JSPROP_PERMANENT | JSPROP_READONLY | JS_ConvertStub | JS_DefineProperties | JS_DefineProperty | JS_DefinePropertyWithTinyId | JS_DeleteProperty | JS_EnumerateStub | JS_FinalizeStub | JS_GetProperty | JS_PropertyStub | JS_ResolveStub | JS_SetProperty ]

This page was generated by APIDOC