name: duk_instanceof proto: | duk_bool_t duk_instanceof(duk_context *ctx, duk_idx_t index1, duk_idx_t index2); stack: | [ ... val1! ... val2! ... ] summary: |
Compare values at index1
and index2
using the
Ecmascript instanceof
operator. Returns 1 if val1 instanceof val2
, 0 if not. Throws an error
if either index is invalid; instanceof
itself also throws errors for
invalid argument types.
duk_equals()
, and matches the strictness of instanceof
.
For example, if rval (index2) is not a callable object instanceof
throws a TypeError. Throwing an error for an invalid index is consistent with
instanceof strictness.