MCPcopy Create free account
hub / github.com/nodejs/node-addon-api / test

Function test

test/object/finalizer.js:12–28  ·  view source on GitHub ↗
(binding)

Source from the content-addressed store, hash-verified

10}
11
12function test (binding) {
13 let obj1;
14 let obj2;
15 return testUtil.runGCTests([
16 'addFinalizer',
17 () => {
18 obj1 = createWeakRef(binding, 'addFinalizer');
19 },
20 () => assert.deepStrictEqual(obj1, { finalizerCalled: true }),
21
22 'addFinalizerWithHint',
23 () => {
24 obj2 = createWeakRef(binding, 'addFinalizerWithHint');
25 },
26 () => assert.deepStrictEqual(obj2, { finalizerCalledWithCorrectHint: true })
27 ]);
28}

Callers

nothing calls this directly

Calls 1

createWeakRefFunction · 0.85

Tested by

no test coverage detected