Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
src,node-api: update napi_is_detached_arraybuffer
This gets `napi_is_detached_arraybuffer(..)` to use the new API,
`ArrayBuffer::WasDetached`, that looks more straightforward.

Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
PR-URL: #45538
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
  • Loading branch information
daeyeon authored and danielleadams committed Jan 3, 2023
1 parent 610341f commit c5630e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js_native_api_v8.cc
Expand Up @@ -3254,7 +3254,7 @@ napi_status NAPI_CDECL napi_is_detached_arraybuffer(napi_env env,
v8::Local<v8::Value> value = v8impl::V8LocalValueFromJsValue(arraybuffer);

*result =
value->IsArrayBuffer() && value.As<v8::ArrayBuffer>()->Data() == nullptr;
value->IsArrayBuffer() && value.As<v8::ArrayBuffer>()->WasDetached();

return napi_clear_last_error(env);
}

0 comments on commit c5630e2

Please sign in to comment.