Skip to content

Commit

Permalink
fixup: apply the review
Browse files Browse the repository at this point in the history
Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com
  • Loading branch information
daeyeon committed Jul 13, 2022
1 parent 036ad32 commit cdc61ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/js_native_api_v8.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2457,9 +2457,9 @@ napi_status NAPI_CDECL napi_check_object_type_tag(napi_env env,
*result =
(tag.lower == type_tag->lower && tag.upper == type_tag->upper);
} else if (size == 1) {
*result = (tag.lower == type_tag->lower);
*result = (tag.lower == type_tag->lower && 0 == type_tag->upper);
} else if (size == 0) {
*result = (type_tag->lower == 0 && type_tag->upper == 0);
*result = (0 == type_tag->lower && 0 == type_tag->upper);
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions test/js-native-api/test_object/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ assert.strictEqual(newObject.test_string, 'test string');
// Verify that wrongly tagged objects are rejected.
assert.strictEqual(test_object.CheckTypeTag(0, obj2), false);
assert.strictEqual(test_object.CheckTypeTag(1, obj1), false);
assert.strictEqual(test_object.CheckTypeTag(0, obj3), false);
assert.strictEqual(test_object.CheckTypeTag(1, obj4), false);
assert.strictEqual(test_object.CheckTypeTag(2, obj4), false);
assert.strictEqual(test_object.CheckTypeTag(3, obj3), false);

// Verify that untagged objects are rejected.
assert.strictEqual(test_object.CheckTypeTag(0, {}), false);
Expand Down

0 comments on commit cdc61ed

Please sign in to comment.