Skip to content

Commit

Permalink
src: fix deprecation warnings
Browse files Browse the repository at this point in the history
The previous commit enables deprecation warnings, this commit fixes
the handful of offending sites where the isolate was not explicitly
being passed around.

PR-URL: nodejs#1565
Reviewed-By: Trevor Norris <[email protected]>
  • Loading branch information
bnoordhuis authored and Fishrock123 committed May 19, 2015
1 parent 1ab65e4 commit 3c9f63f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/node_buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Local<Object> New(Isolate* isolate, Handle<String> string, enum encoding enc) {

size_t length = StringBytes::Size(isolate, string, enc);

Local<Object> buf = New(length);
Local<Object> buf = New(isolate, length);
char* data = Buffer::Data(buf);
StringBytes::Write(isolate, data, length, string, enc);

Expand Down
2 changes: 1 addition & 1 deletion src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4613,7 +4613,7 @@ void RandomBytesCheck(RandomBytesRequest* req, Local<Value> 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);
}
}

Expand Down
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() const {
Local<Object> SyncProcessStdioPipe::GetOutputAsBuffer(Isolate* isolate) const {
size_t length = OutputLength();
Local<Object> js_buffer = Buffer::New(length);
Local<Object> js_buffer = Buffer::New(isolate, 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());
js_output->Set(i, h->GetOutputAsBuffer(env()->isolate()));
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() const;
Local<Object> GetOutputAsBuffer(Isolate* isolate) const;

inline bool readable() const;
inline bool writable() const;
Expand Down
2 changes: 1 addition & 1 deletion src/util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Utf8Value::Utf8Value(v8::Isolate* isolate, v8::Handle<v8::Value> 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<char*>(malloc(len));
CHECK_NE(str_, nullptr);
Expand Down

0 comments on commit 3c9f63f

Please sign in to comment.