From c3da39f3548ec2ca4d9eba71fc6a4b6e0ede737b Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Thu, 31 Mar 2022 01:40:57 +0800 Subject: [PATCH] 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 --- test/js-native-api/test_exception/test_exception.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/js-native-api/test_exception/test_exception.c b/test/js-native-api/test_exception/test_exception.c index 844f4475ac4d4c..053f048466d930 100644 --- a/test/js-native-api/test_exception/test_exception.c +++ b/test/js-native-api/test_exception/test_exception.c @@ -2,6 +2,7 @@ #include "../common.h" static bool exceptionWasPending = false; +static int num = 0x23432; static napi_value returnException(napi_env env, napi_callback_info info) { size_t argc = 1; @@ -83,7 +84,7 @@ static napi_value createExternal(napi_env env, napi_callback_info info) { napi_value external; NODE_API_CALL(env, - napi_create_external(env, NULL, finalizer, NULL, &external)); + napi_create_external(env, &num, finalizer, NULL, &external)); return external; }