=proto void duk_push_current_function(duk_context *ctx); =stack [ ... ] -> [ ... func! ] (if current function exists) [ ... ] -> [ ... undefined! ] (if no current function) =summary

Push the currently running function to the stack. The value pushed is an Ecmascript Function object. If there is no current function, undefined is pushed instead.

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.

=example duk_push_current_function(ctx); =tags stack function