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.
 
 
 
 
 
 

31 lines
1006 B

name: duk_push_current_function
proto: |
void duk_push_current_function(duk_context *ctx);
stack: |
[ ... ] -> [ ... func! ] (if current function exists)
[ ... ] -> [ ... undefined! ] (if no current function)
summary: |
<p>Push the currently running function to the stack. The value pushed is
an ECMAScript Function object. If there is no current function,
<code>undefined</code> is pushed instead.</p>
<p>If the current function was called via one or more bound functions or a
Proxy object, the function returned from this call is the final, resolved
function (not the bound function or the Proxy).</p>
<p>This function allows a C function to gain access to its function object.
Since multiple function objects can internally point to the same C function,
a function object is a convenient place for function parameterization and
can also act as an internal state stash.</p>
example: |
duk_push_current_function(ctx);
tags:
- stack
- function
introduced: 1.0.0