diff --git a/doc/api/addons.markdown b/doc/api/addons.markdown index e2915b6ceb44e3..0e67ffc5af4cb3 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(isolate, 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(isolate, obj->value_)); diff --git a/src/fs_event_wrap.cc b/src/fs_event_wrap.cc index 9c1a2b6c6f2844..7bd8b310f257f3 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 245c0e10adf9c8..f713750d7f93da 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 ff55cf19e38966..5ba5aa9c86a971 100644 --- a/src/node.h +++ b/src/node.h @@ -212,8 +212,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(isolate, - callback); + v8::Handle s = v8::Signature::New(isolate, recv); + v8::Local t = + v8::FunctionTemplate::New(isolate, callback, v8::Handle(), s); recv->PrototypeTemplate()->Set(v8::String::NewFromUtf8(isolate, name), t->GetFunction()); } diff --git a/src/node_contextify.cc b/src/node_contextify.cc index 0f07e57d4fe260..daeb7c768ad096 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -634,14 +634,13 @@ class ContextifyScript : public BaseObject { const bool display_errors, const FunctionCallbackInfo& args, TryCatch& try_catch) { - if (!ContextifyScript::InstanceOf(env, args.This())) { + if (!ContextifyScript::InstanceOf(env, args.Holder())) { env->ThrowTypeError( "Script methods can only be called on script instances."); return false; } - ContextifyScript* wrapped_script = - Unwrap(args.This()); + ContextifyScript* wrapped_script = Unwrap(args.Holder()); Local unbound_script = PersistentToLocal(env->isolate(), wrapped_script->script_); Local