diff --git a/doc/api/addons.markdown b/doc/api/addons.markdown index b6f3fd45c01b..3ac3952f06e5 100644 --- a/doc/api/addons.markdown +++ b/doc/api/addons.markdown @@ -401,7 +401,7 @@ prototype: Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); - MyObject* obj = ObjectWrap::Unwrap(args.This()); + MyObject* obj = ObjectWrap::Unwrap(args.Holder()); obj->value_ += 1; args.GetReturnValue().Set(Number::New(obj->value_)); @@ -539,7 +539,7 @@ The implementation is similar to the above in `myobject.cc`: Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); - MyObject* obj = ObjectWrap::Unwrap(args.This()); + MyObject* obj = ObjectWrap::Unwrap(args.Holder()); obj->value_ += 1; args.GetReturnValue().Set(Number::New(obj->value_)); diff --git a/src/fs_event_wrap.cc b/src/fs_event_wrap.cc index ee28c44afb86..751265a48a84 100644 --- a/src/fs_event_wrap.cc +++ b/src/fs_event_wrap.cc @@ -106,7 +106,7 @@ void FSEventWrap::Start(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); HandleScope scope(env->isolate()); - FSEventWrap* wrap = Unwrap(args.This()); + FSEventWrap* wrap = Unwrap(args.Holder()); if (args.Length() < 1 || !args[0]->IsString()) { return env->ThrowTypeError("Bad arguments"); @@ -189,7 +189,7 @@ void FSEventWrap::Close(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); HandleScope scope(env->isolate()); - FSEventWrap* wrap = Unwrap(args.This()); + FSEventWrap* wrap = Unwrap(args.Holder()); if (wrap == NULL || wrap->initialized_ == false) return; diff --git a/src/handle_wrap.cc b/src/handle_wrap.cc index 3df1e497d3e4..554359109e50 100644 --- a/src/handle_wrap.cc +++ b/src/handle_wrap.cc @@ -47,7 +47,7 @@ void HandleWrap::Ref(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); HandleScope scope(env->isolate()); - HandleWrap* wrap = Unwrap(args.This()); + HandleWrap* wrap = Unwrap(args.Holder()); if (wrap != NULL && wrap->handle__ != NULL) { uv_ref(wrap->handle__); @@ -60,7 +60,7 @@ void HandleWrap::Unref(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); HandleScope scope(env->isolate()); - HandleWrap* wrap = Unwrap(args.This()); + HandleWrap* wrap = Unwrap(args.Holder()); if (wrap != NULL && wrap->handle__ != NULL) { uv_unref(wrap->handle__); @@ -73,7 +73,7 @@ void HandleWrap::Close(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); HandleScope scope(env->isolate()); - HandleWrap* wrap = Unwrap(args.This()); + HandleWrap* wrap = Unwrap(args.Holder()); // guard against uninitialized handle or double close if (wrap == NULL || wrap->handle__ == NULL) diff --git a/src/node.h b/src/node.h index d1641f751e2a..4781d634d0e8 100644 --- a/src/node.h +++ b/src/node.h @@ -208,7 +208,9 @@ inline void NODE_SET_PROTOTYPE_METHOD(v8::Handle recv, v8::FunctionCallback callback) { v8::Isolate* isolate = v8::Isolate::GetCurrent(); v8::HandleScope handle_scope(isolate); - v8::Local t = v8::FunctionTemplate::New(callback); + v8::Handle sig = v8::Signature::New(recv); + v8::Local t = v8::FunctionTemplate::New + (callback, v8::Handle(), sig); recv->PrototypeTemplate()->Set(v8::String::NewFromUtf8(isolate, name), t->GetFunction()); } diff --git a/src/node_contextify.cc b/src/node_contextify.cc index 05d2b11c3fc3..7df290b87519 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -618,7 +618,7 @@ class ContextifyScript : public BaseObject { } ContextifyScript* wrapped_script = - Unwrap(args.This()); + Unwrap(args.Holder()); Local