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 <[email protected]>
PR-URL: #45538
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
  • Loading branch information
daeyeon authored and ruyadorno committed Nov 24, 2022
1 parent 81f63c2 commit 42507e6
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 42507e6

Please sign in to comment.