Skip to content

Commit ccb199a

Browse files
committed
src: fix deprecation warnings
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: #1565 Reviewed-By: Trevor Norris <[email protected]>
1 parent 609fa0d commit ccb199a

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

src/node_buffer.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Local<Object> New(Isolate* isolate, Handle<String> string, enum encoding enc) {
9898

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

101-
Local<Object> buf = New(length);
101+
Local<Object> buf = New(isolate, length);
102102
char* data = Buffer::Data(buf);
103103
StringBytes::Write(isolate, data, length, string, enc);
104104

src/node_crypto.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -4593,7 +4593,7 @@ void RandomBytesCheck(RandomBytesRequest* req, Local<Value> argv[2]) {
45934593
size_t size;
45944594
req->return_memory(&data, &size);
45954595
argv[0] = Null(req->env()->isolate());
4596-
argv[1] = Buffer::Use(data, size);
4596+
argv[1] = Buffer::Use(req->env()->isolate(), data, size);
45974597
}
45984598
}
45994599

src/spawn_sync.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ void SyncProcessStdioPipe::Close() {
165165
}
166166

167167

168-
Local<Object> SyncProcessStdioPipe::GetOutputAsBuffer() const {
168+
Local<Object> SyncProcessStdioPipe::GetOutputAsBuffer(Isolate* isolate) const {
169169
size_t length = OutputLength();
170-
Local<Object> js_buffer = Buffer::New(length);
170+
Local<Object> js_buffer = Buffer::New(isolate, length);
171171
CopyOutput(Buffer::Data(js_buffer));
172172
return js_buffer;
173173
}
@@ -679,7 +679,7 @@ Local<Array> SyncProcessRunner::BuildOutputArray() {
679679
for (uint32_t i = 0; i < stdio_count_; i++) {
680680
SyncProcessStdioPipe* h = stdio_pipes_[i];
681681
if (h != nullptr && h->writable())
682-
js_output->Set(i, h->GetOutputAsBuffer());
682+
js_output->Set(i, h->GetOutputAsBuffer(env()->isolate()));
683683
else
684684
js_output->Set(i, Null(env()->isolate()));
685685
}

src/spawn_sync.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class SyncProcessStdioPipe {
7272
int Start();
7373
void Close();
7474

75-
Local<Object> GetOutputAsBuffer() const;
75+
Local<Object> GetOutputAsBuffer(Isolate* isolate) const;
7676

7777
inline bool readable() const;
7878
inline bool writable() const;

src/util.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Utf8Value::Utf8Value(v8::Isolate* isolate, v8::Handle<v8::Value> value)
1313
return;
1414

1515
// Allocate enough space to include the null terminator
16-
size_t len = StringBytes::StorageSize(string, UTF8) + 1;
16+
size_t len = StringBytes::StorageSize(isolate, string, UTF8) + 1;
1717
if (len > sizeof(str_st_)) {
1818
str_ = static_cast<char*>(malloc(len));
1919
CHECK_NE(str_, nullptr);

0 commit comments

Comments
 (0)