name: duk_require_c_function proto: | duk_c_function duk_require_c_function(duk_context *ctx, duk_idx_t idx); stack: | [ ... val! ... ] summary: |

Like duk_get_c_function(), but throws an error if the value at idx is not an Ecmascript function associated with a Duktape/C function or if the index is invalid.

example: | duk_c_function funcptr; funcptr = duk_require_c_function(ctx, -3); tags: - stack - function introduced: 1.0.0