Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

danbev
Copy link
Contributor

@danbev danbev commented Mar 12, 2018

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), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

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.
@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Mar 12, 2018
@danbev
Copy link
Contributor Author

danbev commented Mar 12, 2018

@danbev
Copy link
Contributor Author

danbev commented Mar 12, 2018

node-test-commit failure looks unrelated

console output:

06: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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps inline void Emit(...?

Copy link
Member

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

Copy link
Member

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.

@danbev
Copy link
Contributor Author

danbev commented Mar 14, 2018

Landed in 861285a.

@danbev danbev closed this Mar 14, 2018
danbev added a commit that referenced this pull request Mar 14, 2018
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>
@danbev danbev deleted the async_wrap_emit branch March 14, 2018 09:49
targos pushed a commit that referenced this pull request Mar 17, 2018
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>
@targos targos mentioned this pull request Mar 18, 2018
MylesBorins pushed a commit that referenced this pull request Mar 20, 2018
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>
MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants