diff --git a/src/js_native_api_v8.cc b/src/js_native_api_v8.cc index abc9e56d6b0bbb..bf38108c6b0fab 100644 --- a/src/js_native_api_v8.cc +++ b/src/js_native_api_v8.cc @@ -3239,7 +3239,7 @@ napi_status NAPI_CDECL napi_detach_arraybuffer(napi_env env, RETURN_STATUS_IF_FALSE( env, it->IsDetachable(), napi_detachable_arraybuffer_expected); - it->Detach(); + it->Detach(v8::Local()).Check(); return napi_clear_last_error(env); } diff --git a/src/node_blob.cc b/src/node_blob.cc index 61960fee14b6c6..8a4373b06ba7be 100644 --- a/src/node_blob.cc +++ b/src/node_blob.cc @@ -107,7 +107,9 @@ void Blob::New(const FunctionCallbackInfo& args) { CHECK_EQ(view->ByteOffset(), 0); std::shared_ptr store = view->Buffer()->GetBackingStore(); size_t byte_length = view->ByteLength(); - view->Buffer()->Detach(); // The Blob will own the backing store now. + view->Buffer() + ->Detach(Local()) + .Check(); // The Blob will own the backing store now. entries.emplace_back(BlobEntry{std::move(store), byte_length, 0}); len += byte_length; } else { diff --git a/src/node_buffer.cc b/src/node_buffer.cc index acec3c420ce1d2..bdc06a73e2e4bc 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -125,7 +125,7 @@ Local CallbackInfo::CreateTrackedArrayBuffer( // V8 simply ignores the BackingStore deleter callback if data == nullptr, // but our API contract requires it being called. if (data == nullptr) { - ab->Detach(); + ab->Detach(Local()).Check(); self->OnBackingStoreFree(); // This calls `callback` asynchronously. } else { // Store the ArrayBuffer so that we can detach it later. @@ -156,7 +156,7 @@ void CallbackInfo::CleanupHook(void* data) { HandleScope handle_scope(self->env_->isolate()); Local ab = self->persistent_.Get(self->env_->isolate()); if (!ab.IsEmpty() && ab->IsDetachable()) { - ab->Detach(); + ab->Detach(Local()).Check(); self->persistent_.Reset(); } } @@ -1255,7 +1255,7 @@ void DetachArrayBuffer(const FunctionCallbackInfo& args) { Local buf = args[0].As(); if (buf->IsDetachable()) { std::shared_ptr store = buf->GetBackingStore(); - buf->Detach(); + buf->Detach(Local()).Check(); args.GetReturnValue().Set(ArrayBuffer::New(env->isolate(), store)); } } diff --git a/src/node_messaging.cc b/src/node_messaging.cc index f88270fc75de91..5c163d587ba196 100644 --- a/src/node_messaging.cc +++ b/src/node_messaging.cc @@ -516,7 +516,7 @@ Maybe Message::Serialize(Environment* env, for (Local ab : array_buffers) { // If serialization succeeded, we render it inaccessible in this Isolate. std::shared_ptr backing_store = ab->GetBackingStore(); - ab->Detach(); + ab->Detach(Local()).Check(); array_buffers_.emplace_back(std::move(backing_store)); }