-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core: set PROVIDER type as Persistent class id #1730
core: set PROVIDER type as Persistent class id #1730
Conversation
Pass along the PROVIDER type, that is already passed to AsyncWrap, along to BaseObject to set the handle_'s class id. This will allow all Persistents to be transversed and uniquely identified by what type they are using APIs such as v8::PersistentHandleVisitor.
For anyone wondering about possible performance implications, I haven't been able to measure any difference at even the nanosecond level of any micro-benchmarks. |
inline BaseObject::BaseObject(Environment* env, v8::Local<v8::Object> handle) | ||
inline BaseObject::BaseObject(Environment* env, | ||
v8::Local<v8::Object> handle, | ||
const uint16_t p_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I suggest you call it class_id
? p_id
leaves the reader guessing.
LGTM with a suggestion. |
Pass along the PROVIDER type, that is already passed to AsyncWrap, along to BaseObject to set the handle_'s class id. This will allow all Persistents to be transversed and uniquely identified by what type they are using APIs such as v8::PersistentHandleVisitor. PR-URL: #1730 Reviewed-By: Ben Noordhuis <[email protected]>
Thanks. Landed w/ suggestion in 3c44100. |
Pass along the PROVIDER type, that is already passed to AsyncWrap, along to BaseObject to set the handle_'s class id. This will allow all Persistents to be transversed and uniquely identified by what type they are using APIs such as v8::PersistentHandleVisitor. PR-URL: nodejs#1730 Reviewed-By: Ben Noordhuis <[email protected]>
Pass along the PROVIDER type, that is already passed to AsyncWrap, along to BaseObject to set the handle_'s class id. This will allow all Persistents to be transversed and uniquely identified by what type they are using APIs such as v8::PersistentHandleVisitor. PR-URL: nodejs/node#1730 Reviewed-By: Ben Noordhuis <[email protected]>
Pass along the PROVIDER type, that is already passed to AsyncWrap, along
to BaseObject to set the handle_'s class id. This will allow all
Persistents to be transversed and uniquely identified by what type they
are using APIs such as v8::PersistentHandleVisitor.
R=@bnoordhuis