diff --git a/test/js-native-api/test_reference/test_reference.c b/test/js-native-api/test_reference/test_reference.c index 6a02eb3d005a6f..05d5ae3eab8eb5 100644 --- a/test/js-native-api/test_reference/test_reference.c +++ b/test/js-native-api/test_reference/test_reference.c @@ -1,4 +1,5 @@ #include +#include #include #include "../common.h" @@ -135,6 +136,9 @@ static napi_value GetReferenceValue(napi_env env, napi_callback_info info) { static void DeleteBeforeFinalizeFinalizer( napi_env env, void* finalize_data, void* finalize_hint) { napi_ref* ref = (napi_ref*)finalize_data; + napi_value value; + assert(napi_get_reference_value(env, *ref, &value) == napi_ok); + assert(value == NULL); napi_delete_reference(env, *ref); free(ref); }