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.
19 lines
361 B
19 lines
361 B
=proto
|
|
int 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
|
|
int idx_top;
|
|
|
|
/* throws error if stack is empty */
|
|
idx_top = duk_require_top_index(ctx);
|
|
printf("index of top element: %d\n", idx_top);
|
|
|
|
=tags
|
|
stack
|
|
|
|
=seealso
|
|
duk_get_top_index
|
|
|