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: https://github.com/nodejs/node/pull/45538 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
This commit is contained in:
parent
20b3152e20
commit
be049df055
@ -3254,7 +3254,7 @@ napi_status NAPI_CDECL napi_is_detached_arraybuffer(napi_env env,
|
|||||||
v8::Local<v8::Value> value = v8impl::V8LocalValueFromJsValue(arraybuffer);
|
v8::Local<v8::Value> value = v8impl::V8LocalValueFromJsValue(arraybuffer);
|
||||||
|
|
||||||
*result =
|
*result =
|
||||||
value->IsArrayBuffer() && value.As<v8::ArrayBuffer>()->Data() == nullptr;
|
value->IsArrayBuffer() && value.As<v8::ArrayBuffer>()->WasDetached();
|
||||||
|
|
||||||
return napi_clear_last_error(env);
|
return napi_clear_last_error(env);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user