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.

23 lines
641 B

=proto
unsigned int duk_get_magic(duk_context *ctx);
=summary
<p>Get the 16-bit "magic" value associated with a Duktape/C function. If
there is no current activation, zero is returned.</p>
<p>The magic function allows the same Duktape/C function to be used with slightly
different behavior; behavior flags or other parameters can be passed in the
magic field. This is less expensive than having behavior related flags or
properties in the function object as normal properties.</p>
=example
unsigned int my_flags = duk_get_magic(ctx);
if (my_flags & 0x01) {
printf("flag set\n");
} else {
printf("flag not set\n");
}
=tags
omit