Skip to content

Commit 312ad07

Browse files
committed
Ensure that the object with the finalizer is not kept alive in test_finalizer.
1 parent 45ff691 commit 312ad07

File tree

1 file changed

+2
-1
lines changed
  • graal-nodejs/test/js-native-api/test_finalizer

1 file changed

+2
-1
lines changed

graal-nodejs/test/js-native-api/test_finalizer/test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ async function runAsyncTests() {
3333
// We use IIFE for the obj scope instead of {} to be compatible with
3434
// non-V8 JS engines that do not support scoped variables.
3535
(() => {
36-
const obj = {};
36+
let obj = {};
3737
test_finalizer.addFinalizerWithJS(obj, () => { js_is_called = true; });
38+
obj = null;
3839
})();
3940
await common.gcUntil('ensure JS finalizer called',
4041
() => (test_finalizer.getFinalizerCallCount() === 2));

0 commit comments

Comments
 (0)