Browse Source

node: always set function name

For easier debugging it's helpful to always have the function name.
These were not set for methods coming from cc.
v0.11.5-release
Trevor Norris 11 years ago
parent
commit
46d11510ad
  1. 5
      src/node.h

5
src/node.h

@ -141,7 +141,10 @@ inline void NODE_SET_METHOD(TypeName& recv,
const char* name,
v8::FunctionCallback callback) {
v8::Local<v8::FunctionTemplate> t = v8::FunctionTemplate::New(callback);
recv->Set(v8::String::New(name), t->GetFunction());
v8::Local<v8::Function> fn = t->GetFunction();
v8::Local<v8::String> fn_name = v8::String::New(name);
fn->SetName(fn_name);
recv->Set(fn_name, fn);
}
#define NODE_SET_METHOD node::NODE_SET_METHOD

Loading…
Cancel
Save