-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
src: refactor emit before/after/promiseResolve #19295
Conversation
Currently EmitBefore, EmitAfter, EmitPromiseResolve are very similar. This commit suggests extracting the code they have in common to a new function to reduce code duplication.
node-test-commit failure looks unrelated06:10:11 Makefile:475: recipe for target 'run-ci' failed
06:10:11 make: *** [run-ci] Error 2
06:10:11 Build step 'Execute shell' marked build as failure
06:10:11 Run condition [Always] enabling perform for step [[]]
06:10:11 Run condition [Always] enabling perform for step [[]]
06:10:11 TAP Reports Processing: START
06:10:11 Looking for TAP results report in workspace using pattern: *.tap
06:10:11 Did not find any matching files. Setting build result to FAILURE.
06:10:11 Checking ^not ok
06:10:11 Jenkins Text Finder: File set '*.tap' is empty
06:10:11 Notifying upstream projects of job completion
06:10:11 Finished: FAILURE |
@@ -162,19 +162,25 @@ static void DestroyAsyncIdsCallback(void* arg) { | |||
} | |||
|
|||
|
|||
void AsyncWrap::EmitPromiseResolve(Environment* env, double async_id) { | |||
void Emit(Environment* env, double async_id, AsyncHooks::Fields type, |
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.
perhaps inline void Emit(...
?
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.
@jasnell Imo we shouldn’t be adding inline
to functions that aren’t defined in the corresponding -inl.h
header
Also, @bnoordhuis pointed out somewhere else that we should put the inline
specifier on the declarations in the .h
header file
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.
ok, I'm good with that.
Landed in 861285a. |
Currently EmitBefore, EmitAfter, EmitPromiseResolve are very similar. This commit suggests extracting the code they have in common to a new function to reduce code duplication. PR-URL: #19295 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Currently EmitBefore, EmitAfter, EmitPromiseResolve are very similar. This commit suggests extracting the code they have in common to a new function to reduce code duplication. PR-URL: #19295 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Currently EmitBefore, EmitAfter, EmitPromiseResolve are very similar. This commit suggests extracting the code they have in common to a new function to reduce code duplication. PR-URL: #19295 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Currently EmitBefore, EmitAfter, EmitPromiseResolve are very similar. This commit suggests extracting the code they have in common to a new function to reduce code duplication. PR-URL: nodejs#19295 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Currently EmitBefore, EmitAfter, EmitPromiseResolve are very similar.
This commit suggests extracting the code they have in common to a new
function to reduce code duplication.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes