JavaScript-1.5 Reference

JS_DefineProperties Function

Summary

Creates one or more properties for an object.

Syntax

JSBool JS_DefineProperties(JSContext *cx, JSObject *obj,
    JSPropertySpec *ps);
NameTypeDescription
cxJSContext *Pointer to a JS context from which to derive runtime information.
objJSObject *Object for which to create new properties.
psJSPropertySpec *Pointer to an array containing names, ids, flags, and getProperty and setProperty method for the properties to create. The last array element must contain zero-valued members.

Description

JS_DefineProperties creates one or more properties in a specified object, obj.

ps is a pointer to the first element of an array of JSPropertySpec structures. Each array element defines a single property: its name, id, flags, and getProperty and setProperty methods. The name field of the last array element must contain zero-valued members. JS_DefineProperties creates one property for each element in the array with a non-zero name field.

If successful, JS_DefineProperties 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 [ JSPropertySpec | JS_DefineConstDoubles | JS_DefineElement | JS_DefineFunction | JS_DefineFunctions | JS_DefineObject | JS_DefineProperty | JS_DefinePropertyWithTinyId ]

This page was generated by APIDOC