Skip to content

Commit

Permalink
fix: add missing CHECK_ARG(env, cbinfo); (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
toyobayashi authored Oct 3, 2023
1 parent 694562c commit 6c3f952
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/emnapi/src/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function napi_create_function (env: napi_env, utf8name: Pointer<const_char>, len
function napi_get_cb_info (env: napi_env, cbinfo: napi_callback_info, argc: Pointer<size_t>, argv: Pointer<napi_value>, this_arg: Pointer<napi_value>, 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')
Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit 6c3f952

Please sign in to comment.