JS DefineConstDoubles
From MDC
Create multiple constant double-valued properties on an object.
[edit] Syntax
JSBool JS_DefineConstDoubles(JSContext *cx, JSObject *obj, JSConstDoubleSpec *cds);
| Name | Type | Description |
|---|---|---|
cx |
JSContext * |
The context in which to define the new properties.
Requires request. (In a |
obj |
JSObject * |
Object for which to create new properties. |
cds |
JSConstDoubleSpec * |
Pointer to an array of JSConstDoubleSpec records containing property names and values to create. The last array element must contain zero-valued members. |
[edit] Description
JS_DefineConstDoubles creates one or more properties for a specified object, obj, where each property consists of a double value. Each property is automatically assigned attributes as specified in the flags field of the JSConstDoubleSpec structure pointed to by cds. If flags is set to 0, the attributes for the property are automatically set to JSPROP_PERMANENT | JSPROP_READONLY.
cds is a pointer to the first element of an array of JSConstDoubleSpec structures. Each array element defines a single property name and property value to create. The name field of the last element of the array must contain 0. JS_DefineConstDoubles creates one property for each element in the array what contains a non-zero name field.
On success, JS_DefineConstDoubles returns JS_TRUE, indicating it has created all properties listed in the array. Otherwise it returns JS_FALSE.
[edit] See Also
LXR ID Search for JS_DefineConstDoubles
JS_DefineElement, JS_DefineProperties, JS_DefineProperty, JS_DefinePropertyWithTinyId