Entry: JS_ValueToId (Function)
Summary: Converts a JS value to a JS ID.
Syntax:
JSBool JS_ValueToId(JSContext *cx, jsval v, jsid *idp);
Argument Type Description
cx JSContext * Pointer to a JS context from which to derive runtime information.
v jsval The JS value to convert.
idp jsid * Pointer to the JS ID that contains the converted value when the function returns.
Description:
JS_ValueToId converts a specified JS value, v, to a JS ID. If v already contains a JS_INT value, idp is set to point at v. Otherwise, JS_ValueToId attempts to generate an ID value based on the current value of v.
The converted value is stored in the jsid pointed to by idp. If the conversion is successful, JS_ValueToId returns JS_TRUE. Otherwise, it returns JS_FALSE.
See also:
|
|
|