Skip to content

Commit 95bb134

Browse files
committed
test: gate GC loop on finalizer firing, drop redundant counter
1 parent 7ee5921 commit 95bb134

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

tests/js-native-api/test_exception/testFinalizerException.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@ const binding = (function() {
1313
return resultingException.binding;
1414
})();
1515

16+
let finalized = false;
1617
onUncaughtException(mustCall((err) => {
1718
assert.match(err.message, /Error during Finalize/);
19+
finalized = true;
1820
}));
1921

2022
(async function() {
2123
binding.createExternal();
22-
23-
// GC until the finalizer fires; the counter just bounds the loop.
24-
let gcCount = 10;
25-
await gcUntil('test', () => --gcCount <= 0);
24+
await gcUntil('finalizer throws', () => finalized);
2625
})().then(mustCall());

0 commit comments

Comments
 (0)