=proto duk_context *duk_require_context(duk_context *ctx, int index); =stack [ ... val! ... ] =summary

Like duk_get_context(), but throws an error if the value at index is not a Duktape thread or if the index is invalid.

=example duk_context *new_ctx; (void) duk_push_thread(ctx); new_ctx = duk_require_context(ctx, -1); =tags stack