name: duk_push_string proto: | const char *duk_push_string(duk_context *ctx, const char *str); stack: | [ ... ] -> [ ... str! ] (if str != NULL) [ ... ] -> [ ... null! ] (if str == NULL) summary: |
Push a C string into the stack. String length is automatically detected
with a strlen()
equivalent (i.e. looking for the first NUL character).
A pointer to the interned string data is returned. If the operation fails,
throws an error.
If str
is NULL
, an ECMAScript null
is pushed
to the stack and NULL
is returned. This behavior differs from
duk_push_lstring
on purpose.
Symbol
for ECMAScript code.
See Symbols for more discussion.
If input string might contain internal NUL characters, use
duk_push_lstring()
instead.