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);
Name | Type | Description |
cx | JSContext * | Pointer to a JS context from which to derive runtime information.
|
obj | JSObject * | Object to search on for the element.
|
index | jsint | Index number of the element to look up.
|
vp | jsval * | 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
|