Skip to content

Commit

Permalink
src,node-api: update napi_is_detached_arraybuffer
Browse files Browse the repository at this point in the history
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 4, 2023
1 parent 95c830d commit c8bbeb3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js_native_api_v8.cc
Original file line number Diff line number Diff line change
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 c8bbeb3

Please sign in to comment.