diff --git a/src/node_buffer.cc b/src/node_buffer.cc index 61b80c622a809e..a0618675872aac 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -98,7 +98,7 @@ Local New(Isolate* isolate, Handle string, enum encoding enc) { size_t length = StringBytes::Size(isolate, string, enc); - Local buf = New(length); + Local buf = New(isolate, length); char* data = Buffer::Data(buf); StringBytes::Write(isolate, data, length, string, enc); diff --git a/src/node_crypto.cc b/src/node_crypto.cc index b6cb4f10e5698f..04b50361bab264 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -4593,7 +4593,7 @@ void RandomBytesCheck(RandomBytesRequest* req, Local argv[2]) { size_t size; req->return_memory(&data, &size); argv[0] = Null(req->env()->isolate()); - argv[1] = Buffer::Use(data, size); + argv[1] = Buffer::Use(req->env()->isolate(), data, size); } } diff --git a/src/spawn_sync.cc b/src/spawn_sync.cc index b014bae40dffc9..901a4a001df051 100644 --- a/src/spawn_sync.cc +++ b/src/spawn_sync.cc @@ -165,9 +165,9 @@ void SyncProcessStdioPipe::Close() { } -Local SyncProcessStdioPipe::GetOutputAsBuffer() const { +Local SyncProcessStdioPipe::GetOutputAsBuffer(Isolate* isolate) const { size_t length = OutputLength(); - Local js_buffer = Buffer::New(length); + Local js_buffer = Buffer::New(isolate, length); CopyOutput(Buffer::Data(js_buffer)); return js_buffer; } @@ -679,7 +679,7 @@ Local SyncProcessRunner::BuildOutputArray() { for (uint32_t i = 0; i < stdio_count_; i++) { SyncProcessStdioPipe* h = stdio_pipes_[i]; if (h != nullptr && h->writable()) - js_output->Set(i, h->GetOutputAsBuffer()); + js_output->Set(i, h->GetOutputAsBuffer(env()->isolate())); else js_output->Set(i, Null(env()->isolate())); } diff --git a/src/spawn_sync.h b/src/spawn_sync.h index 4a71b75202b5b2..9a544fa0576402 100644 --- a/src/spawn_sync.h +++ b/src/spawn_sync.h @@ -72,7 +72,7 @@ class SyncProcessStdioPipe { int Start(); void Close(); - Local GetOutputAsBuffer() const; + Local GetOutputAsBuffer(Isolate* isolate) const; inline bool readable() const; inline bool writable() const; diff --git a/src/util.cc b/src/util.cc index f382b3d565a8cf..a793368c2cdfa8 100644 --- a/src/util.cc +++ b/src/util.cc @@ -13,7 +13,7 @@ Utf8Value::Utf8Value(v8::Isolate* isolate, v8::Handle value) return; // Allocate enough space to include the null terminator - size_t len = StringBytes::StorageSize(string, UTF8) + 1; + size_t len = StringBytes::StorageSize(isolate, string, UTF8) + 1; if (len > sizeof(str_st_)) { str_ = static_cast(malloc(len)); CHECK_NE(str_, nullptr);