Define multiple properties for a single object.
JSBool JS_DefineProperties(JSContext *cx, JSObject *obj, const JSPropertySpec *ps);
||The context in which to define the properties. Requires request. In a
||The object on which to define new properties.|
||Pointer to the first element of an array containing names, ids, flags, and
JS_DefinePropetieswas not const.
JS_DefineProperties creates properties on a specified object,
ps is a pointer to the first element of an array of
JSPropertySpec structures. Each array element defines a single property: its name, tiny id, attributes, getter, and setter. The
name field of the last array element must be
JS_DefineProperties creates one property for each element in the array before the element with a null
name field. Each property is defined as though by calling
The initial stored value of each property created is
JS_TRUE, indicating it has created all properties listed in the array. Otherwise it returns