JavaScript-1.5 Reference

JS_NewDouble Function

Summary

Creates a new double value.

Syntax

jsdouble * JS_NewDouble(JSContext *cx, jsdouble d);
NameTypeDescription
cxJSContext *Pointer to a JS context from which to derive runtime information.
djsdoubleAn 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

Groups [ Function ]
Documents [ LXR ID Search ]
Entries [ JS_AddRoot | JS_NewDoubleValue | JS_NewNumberValue | JS_strdup ]

This page was generated by APIDOC