node/test/js-native-api/test_reference_double_free/test_wrap.js
Chengzhong Wu 987176298e
test: verify napi_remove_wrap with napi_delete_reference
Verify that napi_remove_wrap and napi_delete_reference should be safe
to be called consecutively on the in-out params of napi_wrap.

PR-URL: https://github.com/nodejs/node/pull/44754
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2022-09-26 14:20:20 +00:00

11 lines
311 B
JavaScript

'use strict';
// This test makes no assertions. It tests that calling napi_remove_wrap and
// napi_delete_reference consecutively doesn't crash the process.
const { buildType } = require('../../common');
const addon = require(`./build/${buildType}/test_reference_double_free`);
addon.deleteImmediately({});