diff --git a/src/node.h b/src/node.h index 8937706d9d..4eaaa07859 100644 --- a/src/node.h +++ b/src/node.h @@ -232,8 +232,10 @@ inline void NODE_SET_PROTOTYPE_METHOD(v8::Handle recv, 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()); + v8::Local fn = t->GetFunction(); + recv->PrototypeTemplate()->Set(v8::String::NewFromUtf8(isolate, name), fn); + v8::Local fn_name = v8::String::NewFromUtf8(isolate, name); + fn->SetName(fn_name); } #define NODE_SET_PROTOTYPE_METHOD node::NODE_SET_PROTOTYPE_METHOD