diff --git a/test/addons/async-hello-world/binding.cc b/test/addons/async-hello-world/binding.cc index 049afab7e785bd..aee3a3763f4755 100644 --- a/test/addons/async-hello-world/binding.cc +++ b/test/addons/async-hello-world/binding.cc @@ -7,6 +7,7 @@ struct async_req { uv_work_t req; int input; int output; + v8::Isolate* isolate; v8::Persistent callback; }; @@ -17,9 +18,9 @@ void DoAsync(uv_work_t* r) { } void AfterAsync(uv_work_t* r) { - v8::Isolate* isolate = v8::Isolate::GetCurrent(); - v8::HandleScope scope(isolate); async_req* req = reinterpret_cast(r->data); + v8::Isolate* isolate = req->isolate; + v8::HandleScope scope(isolate); v8::Handle argv[2] = { v8::Null(isolate), @@ -42,7 +43,7 @@ void AfterAsync(uv_work_t* r) { } void Method(const v8::FunctionCallbackInfo& args) { - v8::Isolate* isolate = v8::Isolate::GetCurrent(); + v8::Isolate* isolate = args.GetIsolate(); v8::HandleScope scope(isolate); async_req* req = new async_req; @@ -50,6 +51,7 @@ void Method(const v8::FunctionCallbackInfo& args) { req->input = args[0]->IntegerValue(); req->output = 0; + req->isolate = isolate; v8::Local callback = v8::Local::Cast(args[1]); req->callback.Reset(isolate, callback); diff --git a/test/addons/at-exit/binding.cc b/test/addons/at-exit/binding.cc index 9f192cdb14f864..d300aad3e8256f 100644 --- a/test/addons/at-exit/binding.cc +++ b/test/addons/at-exit/binding.cc @@ -16,10 +16,8 @@ static int at_exit_cb1_called = 0; static int at_exit_cb2_called = 0; static void at_exit_cb1(void* arg) { - // FIXME(bnoordhuis) Isolate::GetCurrent() is on its way out. - Isolate* isolate = Isolate::GetCurrent(); + Isolate* isolate = static_cast(arg); HandleScope handle_scope(isolate); - assert(arg == 0); Local obj = Object::New(isolate); assert(!obj.IsEmpty()); // Assert VM is still alive. assert(obj->IsObject()); @@ -37,7 +35,7 @@ static void sanity_check(void) { } void init(Handle target) { - AtExit(at_exit_cb1); + AtExit(at_exit_cb1, target->CreationContext()->GetIsolate()); AtExit(at_exit_cb2, cookie); AtExit(at_exit_cb2, cookie); atexit(sanity_check); diff --git a/test/addons/hello-world-function-export/binding.cc b/test/addons/hello-world-function-export/binding.cc index 88a6ba599928a4..68db22748fdbd3 100644 --- a/test/addons/hello-world-function-export/binding.cc +++ b/test/addons/hello-world-function-export/binding.cc @@ -2,7 +2,7 @@ #include void Method(const v8::FunctionCallbackInfo& args) { - v8::Isolate* isolate = v8::Isolate::GetCurrent(); + v8::Isolate* isolate = args.GetIsolate(); v8::HandleScope scope(isolate); args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, "world")); } diff --git a/test/addons/hello-world/binding.cc b/test/addons/hello-world/binding.cc index c8bbd554413438..4982bc3e55d84a 100644 --- a/test/addons/hello-world/binding.cc +++ b/test/addons/hello-world/binding.cc @@ -2,7 +2,7 @@ #include void Method(const v8::FunctionCallbackInfo& args) { - v8::Isolate* isolate = v8::Isolate::GetCurrent(); + v8::Isolate* isolate = args.GetIsolate(); v8::HandleScope scope(isolate); args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, "world")); }