mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
src: merge fn_name
in NODE_SET_PROTOTYPE_METHOD
Merge two duplicate `fn_name` into one in NODE_SET_PROTOTYPE_METHOD, it may improve a bit performance. PR-URL: https://github.com/nodejs/node/pull/13547 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
871e4d0280
commit
b5d8d7c6f9
@ -293,7 +293,7 @@ inline void NODE_SET_PROTOTYPE_METHOD(v8::Local<v8::FunctionTemplate> recv,
|
||||
v8::FunctionTemplate::New(isolate, callback, v8::Local<v8::Value>(), s);
|
||||
v8::Local<v8::String> fn_name = v8::String::NewFromUtf8(isolate, name);
|
||||
t->SetClassName(fn_name);
|
||||
recv->PrototypeTemplate()->Set(v8::String::NewFromUtf8(isolate, name), t);
|
||||
recv->PrototypeTemplate()->Set(fn_name, t);
|
||||
}
|
||||
#define NODE_SET_PROTOTYPE_METHOD node::NODE_SET_PROTOTYPE_METHOD
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user