Skip to content

Commit d71df7a

Browse files
joyeecheungjuanarbol
authored andcommitted
test: pass data into napi_create_external
Since v8 10.1 v8::External::New DCHECKs that the data passed into it cannot be a nullptr because that's not serializable as external references. This updates the test to pass a dummy data pointer to the call - which does not matter for the test since we only care about whether the finalizer is called. Refs: https://chromium-review.googlesource.com/c/v8/v8/+/3513234 PR-URL: #42532 Refs: #42115 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
1 parent 3734b64 commit d71df7a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/js-native-api/test_exception/test_exception.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "../common.h"
33

44
static bool exceptionWasPending = false;
5+
static int num = 0x23432;
56

67
static napi_value returnException(napi_env env, napi_callback_info info) {
78
size_t argc = 1;
@@ -83,7 +84,7 @@ static napi_value createExternal(napi_env env, napi_callback_info info) {
8384
napi_value external;
8485

8586
NODE_API_CALL(env,
86-
napi_create_external(env, NULL, finalizer, NULL, &external));
87+
napi_create_external(env, &num, finalizer, NULL, &external));
8788

8889
return external;
8990
}

0 commit comments

Comments
 (0)