JavaScript-1.5 Reference

JS_ValueToId Function

Summary

Converts a JS value to a JS ID.

Syntax

JSBool JS_ValueToId(JSContext *cx, jsval v, jsid *idp);
NameTypeDescription
cxJSContext *Pointer to a JS context from which to derive runtime information.
vjsvalThe JS value to convert.
idpjsid *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

Groups [ Function ]
Documents [ LXR ID Search ]
Entries [ JS_ConvertArguments | JS_ConvertValue | JS_GetTypeName | JS_IdToValue | JS_TypeOfValue | JS_ValueToFunction | JS_ValueToInt32 | JS_ValueToNumber | JS_ValueToObject | JS_ValueToString ]

This page was generated by APIDOC