From ad305266edc4c878a0f91640de1af76c808ffde8 Mon Sep 17 00:00:00 2001 From: toyobayashi Date: Tue, 3 Oct 2023 23:00:52 +0800 Subject: [PATCH] fix: add missing `CHECK_ARG(env, cbinfo);` --- packages/emnapi/src/function.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/emnapi/src/function.ts b/packages/emnapi/src/function.ts index 56ada1ee..17559f50 100644 --- a/packages/emnapi/src/function.ts +++ b/packages/emnapi/src/function.ts @@ -23,7 +23,7 @@ function napi_create_function (env: napi_env, utf8name: Pointer, len function napi_get_cb_info (env: napi_env, cbinfo: napi_callback_info, argc: Pointer, argv: Pointer, this_arg: Pointer, data: void_pp): napi_status { $CHECK_ENV!(env) const envObject = emnapiCtx.envStore.get(env)! - + if (!cbinfo) return envObject.setLastError(napi_status.napi_invalid_arg) const cbinfoValue = emnapiCtx.cbinfoStack.get(cbinfo)! $from64('argc') @@ -165,7 +165,7 @@ function napi_get_new_target ( ): napi_status { $CHECK_ENV!(env) const envObject = emnapiCtx.envStore.get(env)! - // if (!cbinfo) return envObject.setLastError(napi_status.napi_invalid_arg) + if (!cbinfo) return envObject.setLastError(napi_status.napi_invalid_arg) $CHECK_ARG!(envObject, result) envObject.checkGCAccess()