-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: #44754 Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
- Loading branch information
1 parent
ce085d7
commit 3474cd8
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
test/js-native-api/test_reference_double_free/test_wrap.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
'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({}); |