AcornSearch - Acorn and RISC OS information searching
RISC OS Search
containing
"Nutty quip goes here!"
Home  |  About  |  Filebase Archive  |  StrongHelp Manuals  |  Newsgroups  |  Module Database
Entry:     JS_ValueToObject (Function)
Summary:     Converts a JS value to a JS object.
Syntax:
JSBool JS_ValueToObject(JSContext *cx, jsval v,
JSObject **objp);

     Argument     Type     Description
     cx     JSContext *     Pointer to a JS context from which to derive runtime information.
                 
     v     jsval     The JS value to convert.
                 
     objp     JSObject **     Pointer to the JS object into which to store the converted value.
                 
Description:
JS_ValueToObject converts a specified JS value, v, to a JS object. The converted object is stored in the object pointed to by objp. If the conversion is successful, JS_ValueToObject returns JS_TRUE. Otherwise it returns JS_FALSE.

You can successfully convert a JS value to an object if the JS value to convert is one of JSVAL_INTJSVAL_DOUBLEJSVAL_STRINGJSVAL_BOOLEAN, or JSVAL_OBJECT. Note that if v is already an object, the object returned in objp represents a converted version of v, rather than original version of v.


See also:
JS_AddRoot
JS_ConvertArguments
JS_ConvertValue
JS_GetTypeName
JS_TypeOfValue
JS_ValueToBoolean
JS_ValueToFunction
JS_ValueToInt32
JS_ValueToNumber
JS_ValueToString

[sh-index] Back to list of manuals