-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
async_hooks: replace string concatenation with template literals #15968
Conversation
f1fbc91
to
3f5a3cb
Compare
8bf9e77
to
81e5a13
Compare
test/async-hooks/init-hooks.js
Outdated
'\nExpected "init" to be called at most once'); | ||
v(`Activity inited twice | ||
${tempActivityString} | ||
Expected "init" to be called at most once`); |
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.
Please prevent use multiline template strings. This adds lots and lots of whitespace infront of line 2 + 3. Instead, keep the +
for each new line and use \n
if necessary..
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.
@BridgeAR Thanks for the feedback. Removed the multiline template strings and went back to using +
and \n
.
updated test/async-hooks/init-hooks.js
81e5a13
to
d818b46
Compare
updated test/async-hooks/init-hooks.js PR-URL: #15968 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Landed in 3ea3c08 |
@@ -65,49 +65,52 @@ class ActivityCollector { | |||
} | |||
|
|||
const violations = []; | |||
let tempActivityString; |
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.
Is there a reason this is scoped outside the loop?
'\nExpected "destroy" to be called at most once'); | ||
} | ||
if (a.before && a.after) { | ||
if (a.before.length < a.after.length) { | ||
v('Activity called "after" without calling "before"\n' + | ||
activityString(a) + | ||
`${tempActivityString}` + |
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.
Equivalent to tempActivityString
?
updated test/async-hooks/init-hooks.js PR-URL: nodejs/node#15968 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
updated test/async-hooks/init-hooks.js PR-URL: #15968 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
updated test/async-hooks/init-hooks.js PR-URL: #15968 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
updated test/async-hooks/init-hooks.js
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test, async_hooks