Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2022-11-11 14:07:23 +0300
committerMichaël Zasso <targos@protonmail.com>2022-11-11 14:07:23 +0300
commitd02989389a6addca5329581201f7d851935d1f1b (patch)
tree2bc18e8ae72e7469efb0f9d7444b0a3a80ba67a0
parent218a15e9be431c19c7486d5b1dfdd62962d3f66d (diff)
[hack] fix ArrayBuffer::Detach deprecationcanary-base
-rw-r--r--src/js_native_api_v8.cc2
-rw-r--r--src/node_blob.cc2
-rw-r--r--src/node_buffer.cc6
-rw-r--r--src/node_messaging.cc2
4 files changed, 6 insertions, 6 deletions
diff --git a/src/js_native_api_v8.cc b/src/js_native_api_v8.cc
index 9000175d9d8..79d4f59ee3d 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<v8::Value>()).Check();
return napi_clear_last_error(env);
}
diff --git a/src/node_blob.cc b/src/node_blob.cc
index 61960fee14b..b71ae5aa204 100644
--- a/src/node_blob.cc
+++ b/src/node_blob.cc
@@ -107,7 +107,7 @@ void Blob::New(const FunctionCallbackInfo<Value>& args) {
CHECK_EQ(view->ByteOffset(), 0);
std::shared_ptr<BackingStore> 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<Value>()).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 eb8e541c686..03e65b74b28 100644
--- a/src/node_buffer.cc
+++ b/src/node_buffer.cc
@@ -124,7 +124,7 @@ Local<ArrayBuffer> 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<Value>()).Check();
self->OnBackingStoreFree(); // This calls `callback` asynchronously.
} else {
// Store the ArrayBuffer so that we can detach it later.
@@ -155,7 +155,7 @@ void CallbackInfo::CleanupHook(void* data) {
HandleScope handle_scope(self->env_->isolate());
Local<ArrayBuffer> ab = self->persistent_.Get(self->env_->isolate());
if (!ab.IsEmpty() && ab->IsDetachable()) {
- ab->Detach();
+ ab->Detach(Local<Value>()).Check();
self->persistent_.Reset();
}
}
@@ -1212,7 +1212,7 @@ void DetachArrayBuffer(const FunctionCallbackInfo<Value>& args) {
Local<ArrayBuffer> buf = args[0].As<ArrayBuffer>();
if (buf->IsDetachable()) {
std::shared_ptr<BackingStore> store = buf->GetBackingStore();
- buf->Detach();
+ buf->Detach(Local<Value>()).Check();
args.GetReturnValue().Set(ArrayBuffer::New(env->isolate(), store));
}
}
diff --git a/src/node_messaging.cc b/src/node_messaging.cc
index f88270fc75d..5c163d587ba 100644
--- a/src/node_messaging.cc
+++ b/src/node_messaging.cc
@@ -516,7 +516,7 @@ Maybe<bool> Message::Serialize(Environment* env,
for (Local<ArrayBuffer> ab : array_buffers) {
// If serialization succeeded, we render it inaccessible in this Isolate.
std::shared_ptr<BackingStore> backing_store = ab->GetBackingStore();
- ab->Detach();
+ ab->Detach(Local<Value>()).Check();
array_buffers_.emplace_back(std::move(backing_store));
}