Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/spawn_sync.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ void SyncProcessStdioPipe::Close() {
}


Local<Object> SyncProcessStdioPipe::GetOutputAsBuffer(Isolate* isolate) const {
Local<Object> SyncProcessStdioPipe::GetOutputAsBuffer(Environment* env) const {
size_t length = OutputLength();
Local<Object> js_buffer = Buffer::New(isolate, length);
Local<Object> js_buffer = Buffer::New(env, length);
CopyOutput(Buffer::Data(js_buffer));
return js_buffer;
}
Expand Down Expand Up @@ -679,7 +679,7 @@ Local<Array> 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()));
}
Expand Down
2 changes: 1 addition & 1 deletion src/spawn_sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class SyncProcessStdioPipe {
int Start();
void Close();

Local<Object> GetOutputAsBuffer(Isolate* isolate) const;
Local<Object> GetOutputAsBuffer(Environment* env) const;

inline bool readable() const;
inline bool writable() const;
Expand Down
2 changes: 1 addition & 1 deletion src/string_bytes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ Local<Value> StringBytes::Encode(Isolate* isolate,
Local<String> 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)) {
Expand Down