From be049df0555a679b7c2d19a113325b1dfa732c19 Mon Sep 17 00:00:00 2001 From: Daeyeon Jeong Date: Tue, 22 Nov 2022 16:14:59 +0900 Subject: [PATCH] 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 PR-URL: https://github.com/nodejs/node/pull/45538 Reviewed-By: Yagiz Nizipli Reviewed-By: Chengzhong Wu Reviewed-By: Michael Dawson --- src/js_native_api_v8.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js_native_api_v8.cc b/src/js_native_api_v8.cc index 9000175d9d869a..abc9e56d6b0bbb 100644 --- a/src/js_native_api_v8.cc +++ b/src/js_native_api_v8.cc @@ -3254,7 +3254,7 @@ napi_status NAPI_CDECL napi_is_detached_arraybuffer(napi_env env, v8::Local value = v8impl::V8LocalValueFromJsValue(arraybuffer); *result = - value->IsArrayBuffer() && value.As()->Data() == nullptr; + value->IsArrayBuffer() && value.As()->WasDetached(); return napi_clear_last_error(env); }