You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
856 B

name: duk_push_global_stash
proto: |
void duk_push_global_stash(duk_context *ctx);
stack: |
[ ... ] -> [ ... stash! ]
summary: |
<p>Push the global stash object to the stack. The global stash is an internal
object which can be used to store key/value pairs from C code so that they are
reachable for garbage collection, but are not accessible from ECMAScript code.
The stash is only accessible from C code with a <code>ctx</code> argument
associated with the same global object.</p>
example: |
duk_ret_t set_timer_callback(duk_context *ctx) {
duk_push_global_stash(ctx);
duk_dup(ctx, 0); /* timer callback */
duk_put_prop_string(ctx, -2, "timerCallback");
return 0;
}
tags:
- stack
- stash
- object
- module
- sandbox
seealso:
- duk_push_heap_stash
- duk_push_thread_stash
introduced: 1.0.0