mirror of https://github.com/svaarala/duktape.git
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.
22 lines
400 B
22 lines
400 B
=proto
|
|
duk_idx_t duk_require_top_index(duk_context *ctx);
|
|
|
|
=summary
|
|
<p>Get the absolute index (>= 0) of the topmost value on the stack.
|
|
If the stack is empty, throws an error.</p>
|
|
|
|
=example
|
|
duk_idx_t idx_top;
|
|
|
|
/* throws error if stack is empty */
|
|
idx_top = duk_require_top_index(ctx);
|
|
printf("index of top element: %ld\n", (long) idx_top);
|
|
|
|
=tags
|
|
stack
|
|
|
|
=seealso
|
|
duk_get_top_index
|
|
|
|
=introduced
|
|
1.0.0
|
|
|