-
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
test: refactor /parallel/test-cluster-uncaught-exception.js to ES6 #9239
test: refactor /parallel/test-cluster-uncaught-exception.js to ES6 #9239
Conversation
This commit replaces function expressions with ES6 arrow functions as well as improve the comparison operator to check if operands are of same types.
process.exit(MAGIC_EXIT_CODE); | ||
}); | ||
}); | ||
master.on('exit', common.mustCall(code => assert.strictEqual(code, MAGIC_EXIT_CODE))); |
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.
Are you sure you ran make -j8 test
(or just make test
, either is fine) on these changes? I would expect the linter to complain about this line as being too long.
|
||
var isTestRunner = process.argv[2] != 'child'; | ||
const isTestRunner = process.argv[2] !== 'child'; | ||
|
||
if (isTestRunner) { | ||
var master = fork(__filename, ['child']); |
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.
I think this var
can be a const
too, no?
|
||
} else if (cluster.isMaster) { | ||
process.on('uncaughtException', () => process.nextTick(() => process.exit(MAGIC_EXIT_CODE))); |
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.
I think this is much less readable than the current code.
Correction made to previous commit, correcting a line length restriction.
I updated the test file to fix max line errors and edited the arrow function to make it more readable. |
Nit: The first line of the commit log should not capitalize anything that isn't an acronym or otherwise requires capitalization. In other words "Refactor" should be "refactor". Wouldn't worry much about changing it right now. Whoever lands the code can change it (as they'll be squashing the multiple commits anyway). Just FYI for subsequent contributions. |
LGTM if CI is OK. |
The commit title should include the test name to not be confusing. |
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.
LGTM, can fix the commit log messages when landing
Replaces function expressions with ES6 arrow functions as well as improve the comparison operator to check if operands are of same types. PR-URL: #9239 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Landed with nits addressed and edited commit long in 383e40b |
Replaces function expressions with ES6 arrow functions as well as improve the comparison operator to check if operands are of same types. PR-URL: #9239 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Replaces function expressions with ES6 arrow functions as well as improve the comparison operator to check if operands are of same types. PR-URL: #9239 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Checklist
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
Test
Description of change
This commit replaces function expressions with ES6 arrow
functions as well as improves the comparison operator to
check if operands are of same types.