diff --git a/src/spawn_sync.cc b/src/spawn_sync.cc index 901a4a001df051..15e4fe8b103b0d 100644 --- a/src/spawn_sync.cc +++ b/src/spawn_sync.cc @@ -165,9 +165,9 @@ void SyncProcessStdioPipe::Close() { } -Local SyncProcessStdioPipe::GetOutputAsBuffer(Isolate* isolate) const { +Local SyncProcessStdioPipe::GetOutputAsBuffer(Environment* env) const { size_t length = OutputLength(); - Local js_buffer = Buffer::New(isolate, length); + Local js_buffer = Buffer::New(env, 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(env()->isolate())); + js_output->Set(i, h->GetOutputAsBuffer(env())); else js_output->Set(i, Null(env()->isolate())); } diff --git a/src/spawn_sync.h b/src/spawn_sync.h index 9a544fa0576402..3069df610ffb8a 100644 --- a/src/spawn_sync.h +++ b/src/spawn_sync.h @@ -72,7 +72,7 @@ class SyncProcessStdioPipe { int Start(); void Close(); - Local GetOutputAsBuffer(Isolate* isolate) const; + Local GetOutputAsBuffer(Environment* env) const; inline bool readable() const; inline bool writable() const; diff --git a/src/string_bytes.cc b/src/string_bytes.cc index 4f896ace3fb693..0042e9ac1c3f8f 100644 --- a/src/string_bytes.cc +++ b/src/string_bytes.cc @@ -681,7 +681,7 @@ Local StringBytes::Encode(Isolate* isolate, Local val; switch (encoding) { case BUFFER: - return scope.Escape(Buffer::New(buf, buflen)); + return scope.Escape(Buffer::New(isolate, buf, buflen)); case ASCII: if (contains_non_ascii(buf, buflen)) {