Entry: JS_NewStringCopyZ (Function)
Summary: Creates a new JS string and ensures that the resulting string is null-terminated.
Syntax:
JSString * JS_NewStringCopyZ(JSContext *cx, const char *s);
Argument Type Description
cx JSContext * Pointer to a JS context from which to derive runtime information.
s const char * Pointer to the character array containing the text for the JS string to create.
Description:
JS_NewStringCopyZ allocates space for a new JS string and its underlying storage, and then copies the contents of a C character array, s, into the new string. The new JS string is guaranteed to be null-terminated.
If the allocation is successful, JS_NewStringCopyZ returns a pointer to the JS string. Otherwise it returns an empty string.
See also:
|
|
|