Browse Source

add duk_check_type_mask() api call

pull/1/head
Sami Vaarala 11 years ago
parent
commit
f5b6225a1c
  1. 4
      src/duk_api.c
  2. 1
      src/duktape.h

4
src/duk_api.c

@ -1995,6 +1995,10 @@ int duk_get_type_mask(duk_context *ctx, int index) {
DUK_NEVER_HERE();
}
int duk_check_type_mask(duk_context *ctx, int index, int mask) {
return (duk_get_type_mask(ctx, index) & mask) ? 1 : 0;
}
int duk_is_undefined(duk_context *ctx, int index) {
DUK_ASSERT(ctx != NULL);
return _tag_check(ctx, index, DUK_TAG_UNDEFINED);

1
src/duktape.h

@ -267,6 +267,7 @@ void duk_pop_3(duk_context *ctx);
int duk_get_type(duk_context *ctx, int index);
int duk_get_type_mask(duk_context *ctx, int index);
int duk_check_type_mask(duk_context *ctx, int index, int mask);
int duk_is_undefined(duk_context *ctx, int index);
int duk_is_null(duk_context *ctx, int index);

Loading…
Cancel
Save