JavaScript-1.5 Reference

JS_LookupElement Function

Summary

Determines if a specified element or numeric property exists.

Syntax

JSBool JS_LookupElement(JSContext *cx, JSObject *obj,
    jsint index, jsval *vp);
NameTypeDescription
cxJSContext *Pointer to a JS context from which to derive runtime information.
objJSObject *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_LookupElement examines a specified JS object, obj, for an element or numeric property numbered index. If the element exists, vp is set either to the current value of the property if it has a value, or to JSVAL_VOID if it does not, and JS_LookupElement returns JS_TRUE. On error, such as running out of memory during the search, JS_LookupElement returns JS_FALSE, and vp is undefined.

Notes

JS_LookupElement does not distunguish between a property with a value of undefined and a property that does not exist.

See Also

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

This page was generated by APIDOC