JavaScript-1.5 Reference

JS_DefineConstDoubles Function

Summary

Creates one or more constant double-valued properties for an object.

Syntax

JSBool JS_DefineConstDoubles(JSContext *cx, JSObject *obj,
    JSConstDoubleSpec *cds);
NameTypeDescription
cxJSContext *Pointer to a JS context from which to derive runtime information.
objJSObject *Object for which to create new properties.
*cdsJSConstDoubleSpec *Pointer to an array of structs containing double property values and property names to create. The last array element must contain zero-valued members.

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 struct pointed to by cds. If flags is set to zero, 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 JSConstDoubleSpecs. Each array element defines a single property name and property value to create. The name field of last element of the array must contain a zero value. JS_DefineConstDoubles creates one property for each element in the array what contains a non-zero name field.

If successful, JS_DefineConstDoubles returns JS_TRUE, indicating it has created all properties listed in the array. Otherwise it returns JS_FALSE.

See Also

Groups [ Function ]
Documents [ LXR ID Search ]
Entries [ JSConstDoubleSpec | JS_DefineElement | JS_DefineFunction | JS_DefineFunctions | JS_DefineObject | JS_DefineProperties | JS_DefineProperty | JS_DefinePropertyWithTinyId ]

This page was generated by APIDOC