|
Summary
Creates a new double value.
|
Syntax
jsdouble * JS_NewDouble(JSContext *cx, jsdouble d);
Name | Type | Description |
cx | JSContext * | Pointer to a JS context from which to derive runtime information.
|
d | jsdouble | An existing double value to duplicate.
|
|
Description
JS_NewDouble creates a copy of a JS double, d , for a given executable script context, cx . Space for the new value is allocated from the JS garbage collection heap.
If the duplication is successful, JS_NewDouble returns a pointer to the copy of the double. Otherwise it returns NULL .
|
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
|