JS_NewDoubleValue |
Function |
|
Summary
Creates a JS value based on a JS double.
|
Syntax
JSBool JS_NewDoubleValue(JSContext *cx, jsdouble d,
jsval *rval);
Name | Type | Description |
cx | JSContext * | Pointer to a JS context from which to derive runtime information.
|
d | jsdouble | An existing double to assign as a value to the jsval .
|
rval | jsval * | Pointer to a previously declared jsval into which to store the double value.
|
|
Description
JS_NewDoubleValue creates a jsval containing a double value that corresponds to the double passed in as an argument. cx is the executable script context in which this call is made. d is the double value to assign to the jsval , and rval is the jsval into which the new JS double value is stored. Space for the new value is allocated from the JS garbage collection heap.JS_NewDoubleValue attempts to creates a temporary copy of the double value. If the copy is successful, then the jsval is created, and the function returns JS_TRUE .Otherwise it returns JS_FALSE .
|
Notes
After you create it, a JS double is subject to garbage collection until you protect
against it using a local root, an object property, or the JS_AddRoot function.
|
See Also
|