Skip to content

Commit

Permalink
test: adapt test-v8-flags to V8 9.3
Browse files Browse the repository at this point in the history
%_IsSmi was removed. %IsSmi can be used instead.

Refs: v8/v8@863a2d6

PR-URL: #39469
Backport-PR-URL: #39947
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
targos committed Sep 1, 2021
1 parent beca890 commit 105bff9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/parallel/test-v8-flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ const vm = require('vm');
// Specifically here, V8 may cache compiled scripts between the flip of the
// flag. We use a different script each time to work around this problem.
v8.setFlagsFromString('--allow_natives_syntax');
assert(eval('%_IsSmi(42)'));
assert(vm.runInThisContext('%_IsSmi(43)'));
assert(eval('%IsSmi(42)'));
assert(vm.runInThisContext('%IsSmi(43)'));

v8.setFlagsFromString('--noallow_natives_syntax');
assert.throws(function() { eval('%_IsSmi(44)'); },
assert.throws(function() { eval('%IsSmi(44)'); },
/^SyntaxError: Unexpected token '%'$/);
assert.throws(function() { vm.runInThisContext('%_IsSmi(45)'); },
assert.throws(function() { vm.runInThisContext('%IsSmi(45)'); },
/^SyntaxError: Unexpected token '%'$/);

0 comments on commit 105bff9

Please sign in to comment.