From dc4edc8464589cfcfacf2a4d0cb2f63afdc028ce Mon Sep 17 00:00:00 2001 From: toyobayashi Date: Sat, 13 May 2023 11:55:51 +0800 Subject: [PATCH] napi_ref for all value types is experimental (nodejs/node#47975) --- packages/emnapi/src/life.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/emnapi/src/life.ts b/packages/emnapi/src/life.ts index c5bf42b0..495e7696 100644 --- a/packages/emnapi/src/life.ts +++ b/packages/emnapi/src/life.ts @@ -76,7 +76,7 @@ function napi_create_reference ( $CHECK_ARG!(envObject, result) const handle = emnapiCtx.handleStore.get(value)! - if (!('moduleApiVersion' in envObject) || (envObject.moduleApiVersion <= 8)) { + if (envObject.moduleApiVersion !== Version.NAPI_VERSION_EXPERIMENTAL) { if (!(handle.isObject() || handle.isFunction() || handle.isSymbol())) { return envObject.setLastError(napi_status.napi_invalid_arg) }