From d3c317e08ac6a624fde8b242905992eafdd954ac Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 13 Oct 2014 15:19:55 +0200 Subject: src: attach env directly to api functions Attach the per-context execution environment directly to API functions. Rationale: * Gets node one step closer to multi-isolate readiness. * Avoids multi-context confusion, e.g. when the caller and callee live in different contexts. * Avoids expensive calls to pthread_getspecific() on platforms where V8 does not know how to use the thread-local storage directly. (Linux, the BSDs.) PR-URL: https://github.com/node-forward/node/pull/18 Reviewed-By: Fedor Indutny --- src/fs_event_wrap.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/fs_event_wrap.cc') diff --git a/src/fs_event_wrap.cc b/src/fs_event_wrap.cc index b054b86a6c..06e5ef44d9 100644 --- a/src/fs_event_wrap.cc +++ b/src/fs_event_wrap.cc @@ -83,12 +83,12 @@ void FSEventWrap::Initialize(Handle target, Handle context) { Environment* env = Environment::GetCurrent(context); - Local t = FunctionTemplate::New(env->isolate(), New); + Local t = env->NewFunctionTemplate(New); t->InstanceTemplate()->SetInternalFieldCount(1); t->SetClassName(env->fsevent_string()); - NODE_SET_PROTOTYPE_METHOD(t, "start", Start); - NODE_SET_PROTOTYPE_METHOD(t, "close", Close); + env->SetProtoMethod(t, "start", Start); + env->SetProtoMethod(t, "close", Close); target->Set(env->fsevent_string(), t->GetFunction()); } @@ -96,13 +96,13 @@ void FSEventWrap::Initialize(Handle target, void FSEventWrap::New(const FunctionCallbackInfo& args) { CHECK(args.IsConstructCall()); - Environment* env = Environment::GetCurrent(args.GetIsolate()); + Environment* env = Environment::GetCurrent(args); new FSEventWrap(env, args.This()); } void FSEventWrap::Start(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); + Environment* env = Environment::GetCurrent(args); FSEventWrap* wrap = Unwrap(args.Holder()); -- cgit v1.2.3