JavaScript-1.5 Reference

JS_GetElement Function

Summary

Finds specified element or numeric property associated with an object or the object's class and retrieves its current value.

Syntax

JSBool JS_GetElement(JSContext *cx, JSObject *obj, jsint index,
    jsval *vp);
NameTypeDescription
cxJSContext *Pointer to a JS context from which to derive runtime information.
objJSObject *Array object to search on for the element.
indexjsintIndex number of the element to look up.
vpjsval *Pointer to a variable into which to store the current value of the element if it has a value. If not, vp is set to JSVAL_VOID.

Description

JS_GetElement examines a specified JS object, obj, its scope and prototype links, for an element or numeric property numbered index.

If the element exists, JS_GetElement sets vp to the current value of the element if it has a value, or to JSVAL_VOID if it does not, and returns JS_TRUE. If an error occurs during the search, JS_GetElement returns JS_FALSE, and vp is undefined.

See Also

Groups [ Function ]
Documents [ LXR ID Search ]
Entries [ JSVAL_VOID | JS_AliasElement | JS_DefineElement | JS_DeleteElement | JS_GetArrayLength | JS_IsArrayObject | JS_LookupElement | JS_NewArrayObject | JS_SetArrayLength | JS_SetElement ]

This page was generated by APIDOC