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.

29 lines
565 B

=proto
int duk_push_object(duk_context *ctx);
=stack
[ ... ] -> [ ... obj! ]
=summary
<p>Push an empty object to the stack. Returns non-negative index (relative to stack bottom)
of the pushed object.</p>
=example
int obj_idx;
obj_idx = duk_push_object(ctx);
duk_push_int(ctx, 42);
duk_put_prop_string(ctx, obj_idx, "meaningOfLife");
/* object is now: { "meaningOfLife": 42 } */
duk_pop(ctx); /* pop object */
=tags
stack
object
=fixme
There is no way to give an initial size for object property table.
This would be useful to minimize memory allocations.