-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
async_hooks: rename currentId to currentAsyncId #13490
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
Changes from 1 commit
d84177e
d7fdd11
9478347
3328e2c
11d0705
aac29f7
ed9a42e
829f009
038b070
767008f
96818e4
248bc1d
1566af0
86bff35
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -530,18 +530,14 @@ NODE_EXTERN void AddPromiseHook(v8::Isolate* isolate, | |
| * I/O from native code. */ | ||
| NODE_EXTERN async_uid AsyncHooksGetExecutionAsyncId(v8::Isolate* isolate); | ||
| /* legacy alias */ | ||
| NODE_DEPRECATED("Use AsyncHooksGetExecutionAsyncId(isolate)", | ||
| inline async_uid AsyncHooksGetCurrentId(v8::Isolate* isolate) { | ||
| return AsyncHooksGetExecutionAsyncId(isolate); | ||
| }) | ||
| [[deprecated("Use AsyncHooksGetExecutionAsyncId(isolate)")]] | ||
| NODE_EXTERN async_uid AsyncHooksGetCurrentId(v8::Isolate* isolate); | ||
|
|
||
| /* Return same value as async_hooks.triggerAsyncId(); */ | ||
| NODE_EXTERN async_uid AsyncHooksGetTriggerAsyncId(v8::Isolate* isolate); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe just one extra thought, if you want to do this in a ABI/API-compatible way, you could just add // legacy
#define AsyncHooksGetExecutionAsyncId AsyncHooksGetCurrentId
#define AsyncHooksGetTriggerAsyncId AsyncHooksGetTriggerIdbefore these definitions
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we want to do this without a deprecation warning?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can do that too, sure (just keep in mind that the deprecated methods would need definitions in our .cc files, we can’t get away with a header-only change in that case). I think this is going to be fine, though.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we start using
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @AndreasMadsen Any thoughts on the above? The way the PR is written right now it’s both breakaging ABI and API, which I guess will be okay because it only came out with 8.1.0, but I wouldn’t see anything wrong with fixing that up by using
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If there is not an annoyance with using legacy API, there is no incentive to move on. An alias with a deprecation warning sounds good.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That’s still true. If you’re adding the aliases as inline methods in the header, the Node binary will still stop exporting them.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, of course. Then I'm not sure how I can desperate them. Do we allow C++14 deprecation syntax?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I think something like
Not yet, I am afraid.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ABI compatibility: e841a8c |
||
| /* legacy alias */ | ||
| NODE_DEPRECATED("Use AsyncHooksGetTriggerAsyncId(isolate)", | ||
| inline async_uid AsyncHooksGetTriggerId(v8::Isolate* isolate) { | ||
| return AsyncHooksGetTriggerAsyncId(isolate); | ||
| }) | ||
| [[deprecated("Use AsyncHooksGetTriggerAsyncId(isolate)")]] | ||
| NODE_EXTERN async_uid AsyncHooksGetTriggerId(v8::Isolate* isolate); | ||
|
|
||
|
|
||
| /* If the native API doesn't inherit from the helper class then the callbacks | ||
|
|
||
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.
No need for
v8::