name: duk_get_magic proto: | duk_int_t duk_get_magic(duk_context *ctx, duk_idx_t index); stack: | [ ... val! ... ] summary: |

Get the 16-bit signed "magic" value associated with the Duktape/C function at index. If the value is not a Duktape/C function, an error is thrown.

Lightweight functions have space for only 8 magic value bits which is interpreted as a signed integer (-128 to 127).
example: | duk_int_t my_flags = duk_get_magic(ctx, -3); tags: - function - magic seealso: - duk_get_current_magic - duk_set_magic introduced: 1.0.0