mirror of
https://github.com/nodejs/node.git
synced 2025-08-18 07:08:50 +02:00

Generalize the finalizer's second pass callback to make it cancellable and simplify the code around the second pass callback. With this change, it is determined that Reference::Finalize or RefBase::Finalize are called once, either from the env's shutdown, or from the env's second pass callback. All existing node-api js tests should pass without a touch. The js_native_api cctest is no longer applicable with this change, just removing it. PR-URL: https://github.com/nodejs/node/pull/44141 Refs: https://github.com/nodejs/node/issues/44071 Reviewed-By: Michael Dawson <midawson@redhat.com>
13 lines
310 B
JavaScript
13 lines
310 B
JavaScript
// Flags: --expose-gc
|
|
|
|
'use strict';
|
|
const common = require('../../common');
|
|
const addon = require(`./build/${common.buildType}/6_object_wrap`);
|
|
|
|
(function scope() {
|
|
addon.objectWrapDanglingReference({});
|
|
})();
|
|
|
|
common.gcUntil('object-wrap-ref', () => {
|
|
return addon.objectWrapDanglingReferenceTest();
|
|
});
|