diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2014-10-13 17:19:55 +0400 |
---|---|---|
committer | Fedor Indutny <fedor@indutny.com> | 2014-10-13 23:46:46 +0400 |
commit | d3c317e08ac6a624fde8b242905992eafdd954ac (patch) | |
tree | 1dd2756855ab5b4513503acc660705fa898c5c64 /src/fs_event_wrap.cc | |
parent | b45d33617b569bf5fa84c9343da9f7d129756968 (diff) |
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 <fedor@indutny.com>
Diffstat (limited to 'src/fs_event_wrap.cc')
-rw-r--r-- | src/fs_event_wrap.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/fs_event_wrap.cc b/src/fs_event_wrap.cc index b054b86a6c3..06e5ef44d93 100644 --- a/src/fs_event_wrap.cc +++ b/src/fs_event_wrap.cc @@ -83,12 +83,12 @@ void FSEventWrap::Initialize(Handle<Object> target, Handle<Context> context) { Environment* env = Environment::GetCurrent(context); - Local<FunctionTemplate> t = FunctionTemplate::New(env->isolate(), New); + Local<FunctionTemplate> 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<Object> target, void FSEventWrap::New(const FunctionCallbackInfo<Value>& 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<Value>& args) { - Environment* env = Environment::GetCurrent(args.GetIsolate()); + Environment* env = Environment::GetCurrent(args); FSEventWrap* wrap = Unwrap<FSEventWrap>(args.Holder()); |