From 75adde07f9a2de7f38a67bec72bd377d450bdb52 Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Fri, 21 Feb 2014 17:02:42 +0400 Subject: src: remove `node_isolate` from source fix #6899 --- src/tty_wrap.cc | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'src/tty_wrap.cc') diff --git a/src/tty_wrap.cc b/src/tty_wrap.cc index 4b5b8587c0..cd6e319fc0 100644 --- a/src/tty_wrap.cc +++ b/src/tty_wrap.cc @@ -54,12 +54,12 @@ void TTYWrap::Initialize(Handle target, Environment* env = Environment::GetCurrent(context); Local t = FunctionTemplate::New(New); - t->SetClassName(FIXED_ONE_BYTE_STRING(node_isolate, "TTY")); + t->SetClassName(FIXED_ONE_BYTE_STRING(env->isolate(), "TTY")); t->InstanceTemplate()->SetInternalFieldCount(1); enum PropertyAttribute attributes = static_cast(v8::ReadOnly | v8::DontDelete); - t->InstanceTemplate()->SetAccessor(FIXED_ONE_BYTE_STRING(node_isolate, "fd"), + t->InstanceTemplate()->SetAccessor(env->fd_string(), StreamWrap::GetFD, NULL, Handle(), @@ -85,7 +85,7 @@ void TTYWrap::Initialize(Handle target, NODE_SET_METHOD(target, "isTTY", IsTTY); NODE_SET_METHOD(target, "guessHandleType", GuessHandleType); - target->Set(FIXED_ONE_BYTE_STRING(node_isolate, "TTY"), t->GetFunction()); + target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "TTY"), t->GetFunction()); env->set_tty_constructor_template(t); } @@ -96,7 +96,8 @@ uv_tty_t* TTYWrap::UVHandle() { void TTYWrap::GuessHandleType(const FunctionCallbackInfo& args) { - HandleScope scope(node_isolate); + Environment* env = Environment::GetCurrent(args.GetIsolate()); + HandleScope scope(env->isolate()); int fd = args[0]->Int32Value(); assert(fd >= 0); @@ -114,12 +115,13 @@ void TTYWrap::GuessHandleType(const FunctionCallbackInfo& args) { abort(); } - args.GetReturnValue().Set(OneByteString(node_isolate, type)); + args.GetReturnValue().Set(OneByteString(env->isolate(), type)); } void TTYWrap::IsTTY(const FunctionCallbackInfo& args) { - HandleScope scope(node_isolate); + Environment* env = Environment::GetCurrent(args.GetIsolate()); + HandleScope scope(env->isolate()); int fd = args[0]->Int32Value(); assert(fd >= 0); bool rc = uv_guess_handle(fd) == UV_TTY; @@ -128,7 +130,8 @@ void TTYWrap::IsTTY(const FunctionCallbackInfo& args) { void TTYWrap::GetWindowSize(const FunctionCallbackInfo& args) { - HandleScope scope(node_isolate); + Environment* env = Environment::GetCurrent(args.GetIsolate()); + HandleScope scope(env->isolate()); TTYWrap* wrap = Unwrap(args.This()); assert(args[0]->IsArray()); @@ -138,8 +141,8 @@ void TTYWrap::GetWindowSize(const FunctionCallbackInfo& args) { if (err == 0) { Local a = args[0].As(); - a->Set(0, Integer::New(width, node_isolate)); - a->Set(1, Integer::New(height, node_isolate)); + a->Set(0, Integer::New(width, env->isolate())); + a->Set(1, Integer::New(height, env->isolate())); } args.GetReturnValue().Set(err); @@ -147,7 +150,8 @@ void TTYWrap::GetWindowSize(const FunctionCallbackInfo& args) { void TTYWrap::SetRawMode(const FunctionCallbackInfo& args) { - HandleScope scope(node_isolate); + Environment* env = Environment::GetCurrent(args.GetIsolate()); + HandleScope scope(env->isolate()); TTYWrap* wrap = Unwrap(args.This()); -- cgit v1.2.3