Browse Source

src: pass node_isolate to Local<>::New

v0.9.6-release
Ben Noordhuis 12 years ago
parent
commit
01c3d0aa88
  1. 6
      src/cares_wrap.cc
  2. 3
      src/fs_event_wrap.cc
  3. 6
      src/node.cc
  4. 2
      src/node_buffer.cc
  5. 13
      src/node_crypto.cc
  6. 2
      src/node_file.cc
  7. 2
      src/node_script.cc
  8. 3
      src/node_zlib.cc
  9. 8
      src/pipe_wrap.cc
  10. 8
      src/stream_wrap.cc
  11. 10
      src/tcp_wrap.cc
  12. 8
      src/udp_wrap.cc

6
src/cares_wrap.cc

@ -677,7 +677,7 @@ static Handle<Value> Query(const Arguments& args) {
// We must cache the wrap's js object here, because cares might make the
// callback from the wrap->Send stack. This will destroy the wrap's internal
// object reference, causing wrap->GetObject() to return undefined.
Local<Object> object = Local<Object>::New(wrap->GetObject());
Local<Object> object = Local<Object>::New(node_isolate, wrap->GetObject());
String::Utf8Value name(args[0]);
@ -706,7 +706,7 @@ static Handle<Value> QueryWithFamily(const Arguments& args) {
// We must cache the wrap's js object here, because cares might make the
// callback from the wrap->Send stack. This will destroy the wrap's internal
// object reference, causing wrap->GetObject() to return undefined.
Local<Object> object = Local<Object>::New(wrap->GetObject());
Local<Object> object = Local<Object>::New(node_isolate, wrap->GetObject());
String::Utf8Value name(args[0]);
int family = args[1]->Int32Value();
@ -732,7 +732,7 @@ void AfterGetAddrInfo(uv_getaddrinfo_t* req, int status, struct addrinfo* res) {
if (status) {
// Error
SetErrno(uv_last_error(uv_default_loop()));
argv[0] = Local<Value>::New(Null());
argv[0] = Local<Value>::New(node_isolate, Null());
} else {
// Success
struct addrinfo *address;

3
src/fs_event_wrap.cc

@ -152,7 +152,8 @@ void FSEventWrap::OnEvent(uv_fs_event_t* handle, const char* filename,
Local<Value> argv[3] = {
Integer::New(status, node_isolate),
eventStr,
filename ? (Local<Value>)String::New(filename) : Local<Value>::New(v8::Null())
filename ? static_cast<Local<Value> >(String::New(filename))
: Local<Value>::New(node_isolate, v8::Null())
};
if (onchange_sym.IsEmpty()) {

6
src/node.cc

@ -947,8 +947,8 @@ MakeCallback(const Handle<Object> object,
argArray->Set(Integer::New(i, node_isolate), argv[i]);
}
Local<Value> object_l = Local<Value>::New(object);
Local<Value> callback_l = Local<Value>::New(callback);
Local<Value> object_l = Local<Value>::New(node_isolate, object);
Local<Value> callback_l = Local<Value>::New(node_isolate, callback);
Local<Value> args[3] = { object_l, callback_l, argArray };
@ -2401,7 +2401,7 @@ void Load(Handle<Object> process_l) {
// Add a reference to the global object
Local<Object> global = v8::Context::GetCurrent()->Global();
Local<Value> args[1] = { Local<Value>::New(process_l) };
Local<Value> args[1] = { Local<Value>::New(node_isolate, process_l) };
#if defined HAVE_DTRACE || defined HAVE_ETW || defined HAVE_SYSTEMTAP
InitDTrace(global);

2
src/node_buffer.cc

@ -116,7 +116,7 @@ Handle<Object> Buffer::New(Handle<String> string) {
assert(bv->IsFunction());
Local<Function> b = Local<Function>::Cast(bv);
Local<Value> argv[1] = { Local<Value>::New(string) };
Local<Value> argv[1] = { Local<Value>::New(node_isolate, string) };
Local<Object> instance = b->NewInstance(1, argv);
return scope.Close(instance);

13
src/node_crypto.cc

@ -1137,7 +1137,8 @@ int Connection::SelectSNIContextCallback_(SSL *s, int *ad, void* arg) {
Local<Value> argv[1] = {*p->servername_};
// Call it
Local<Value> ret = Local<Value>::New(MakeCallback(p->sniObject_,
Local<Value> ret = Local<Value>::New(node_isolate,
MakeCallback(p->sniObject_,
"onselect",
ARRAY_SIZE(argv),
argv));
@ -3713,12 +3714,12 @@ void EIO_PBKDF2(uv_work_t* work_req) {
void EIO_PBKDF2After(pbkdf2_req* req, Local<Value> argv[2]) {
if (req->err) {
argv[0] = Local<Value>::New(Undefined());
argv[0] = Local<Value>::New(node_isolate, Undefined());
argv[1] = Encode(req->key, req->keylen, BUFFER);
memset(req->key, 0, req->keylen);
} else {
argv[0] = Exception::Error(String::New("PBKDF2 error"));
argv[1] = Local<Value>::New(Undefined());
argv[1] = Local<Value>::New(node_isolate, Undefined());
}
delete[] req->pass;
@ -3891,13 +3892,13 @@ void RandomBytesCheck(RandomBytesRequest* req, Local<Value> argv[2]) {
ERR_error_string_n(req->error_, errmsg, sizeof errmsg);
argv[0] = Exception::Error(String::New(errmsg));
argv[1] = Local<Value>::New(Null());
argv[1] = Local<Value>::New(node_isolate, Null());
}
else {
// avoids the malloc + memcpy
Buffer* buffer = Buffer::New(req->data_, req->size_, RandomBytesFree, NULL);
argv[0] = Local<Value>::New(Null());
argv[1] = Local<Object>::New(buffer->handle_);
argv[0] = Local<Value>::New(node_isolate, Null());
argv[1] = Local<Object>::New(node_isolate, buffer->handle_);
}
}

2
src/node_file.cc

@ -113,7 +113,7 @@ static void After(uv_fs_t *req) {
}
} else {
// error value is empty or null for non-error.
argv[0] = Local<Value>::New(Null());
argv[0] = Local<Value>::New(node_isolate, Null());
// All have at least two args now.
argc = 2;

2
src/node_script.cc

@ -363,7 +363,7 @@ Handle<Value> WrappedScript::EvalMachine(const Arguments& args) {
// to a local handle, and then dispose the persistent handle. This ensures
// that when this function exits the context will be disposed.
Persistent<Context> tmp = Context::New();
context = Local<Context>::New(tmp);
context = Local<Context>::New(node_isolate, tmp);
tmp.Dispose();
} else if (context_flag == userContext) {

3
src/node_zlib.cc

@ -270,7 +270,8 @@ class ZCtx : public ObjectWrap {
"Invalid error handler");
HandleScope scope;
Local<Value> args[2] = { String::New(msg),
Local<Value>::New(Number::New(ctx->err_)) };
Local<Value>::New(node_isolate,
Number::New(ctx->err_)) };
MakeCallback(ctx->handle_, onerror_sym, ARRAY_SIZE(args), args);
// no hope of rescue.

8
src/pipe_wrap.cc

@ -239,10 +239,10 @@ void PipeWrap::AfterConnect(uv_connect_t* req, int status) {
Local<Value> argv[5] = {
Integer::New(status, node_isolate),
Local<Value>::New(wrap->object_),
Local<Value>::New(req_wrap->object_),
Local<Value>::New(Boolean::New(readable)),
Local<Value>::New(Boolean::New(writable))
Local<Value>::New(node_isolate, wrap->object_),
Local<Value>::New(node_isolate, req_wrap->object_),
Local<Value>::New(node_isolate, Boolean::New(readable)),
Local<Value>::New(node_isolate, Boolean::New(writable))
};
if (oncomplete_sym.IsEmpty()) {

8
src/stream_wrap.cc

@ -476,8 +476,8 @@ void StreamWrap::AfterWrite(uv_write_t* req, int status) {
Local<Value> argv[] = {
Integer::New(status, node_isolate),
Local<Value>::New(wrap->object_),
Local<Value>::New(req_wrap->object_)
Local<Value>::New(node_isolate, wrap->object_),
Local<Value>::New(node_isolate, req_wrap->object_)
};
MakeCallback(req_wrap->object_, oncomplete_sym, ARRAY_SIZE(argv), argv);
@ -524,8 +524,8 @@ void StreamWrap::AfterShutdown(uv_shutdown_t* req, int status) {
Local<Value> argv[3] = {
Integer::New(status, node_isolate),
Local<Value>::New(wrap->object_),
Local<Value>::New(req_wrap->object_)
Local<Value>::New(node_isolate, wrap->object_),
Local<Value>::New(node_isolate, req_wrap->object_)
};
MakeCallback(req_wrap->object_, oncomplete_sym, ARRAY_SIZE(argv), argv);

10
src/tcp_wrap.cc

@ -325,7 +325,7 @@ void TCPWrap::OnConnection(uv_stream_t* handle, int status) {
argv[0] = client_obj;
} else {
SetErrno(uv_last_error(uv_default_loop()));
argv[0] = Local<Value>::New(Null());
argv[0] = Local<Value>::New(node_isolate, Null());
}
MakeCallback(wrap->object_, onconnection_sym, ARRAY_SIZE(argv), argv);
@ -348,10 +348,10 @@ void TCPWrap::AfterConnect(uv_connect_t* req, int status) {
Local<Value> argv[5] = {
Integer::New(status, node_isolate),
Local<Value>::New(wrap->object_),
Local<Value>::New(req_wrap->object_),
Local<Value>::New(v8::True()),
Local<Value>::New(v8::True())
Local<Value>::New(node_isolate, wrap->object_),
Local<Value>::New(node_isolate, req_wrap->object_),
Local<Value>::New(node_isolate, v8::True()),
Local<Value>::New(node_isolate, v8::True())
};
MakeCallback(req_wrap->object_, oncomplete_sym, ARRAY_SIZE(argv), argv);

8
src/udp_wrap.cc

@ -337,8 +337,8 @@ void UDPWrap::OnSend(uv_udp_send_t* req, int status) {
Local<Value> argv[4] = {
Integer::New(status, node_isolate),
Local<Value>::New(wrap->object_),
Local<Value>::New(req_wrap->object_),
Local<Value>::New(node_isolate, wrap->object_),
Local<Value>::New(node_isolate, req_wrap->object_),
req_wrap->object_->GetHiddenValue(buffer_sym),
};
@ -368,14 +368,14 @@ void UDPWrap::OnRecv(uv_udp_t* handle,
if (nread == 0) return;
if (nread < 0) {
Local<Value> argv[] = { Local<Object>::New(wrap->object_) };
Local<Value> argv[] = { Local<Object>::New(node_isolate, wrap->object_) };
SetErrno(uv_last_error(uv_default_loop()));
MakeCallback(wrap->object_, onmessage_sym, ARRAY_SIZE(argv), argv);
return;
}
Local<Value> argv[] = {
Local<Object>::New(wrap->object_),
Local<Object>::New(node_isolate, wrap->object_),
slab,
Integer::NewFromUnsigned(buf.base - Buffer::Data(slab), node_isolate),
Integer::NewFromUnsigned(nread, node_isolate),

Loading…
Cancel
Save