-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
process: fix incorrect usage of assert.fail() #6211
Conversation
The message argument for `assert.fail()` is the third argument, not the first. Correct minor misuse in internal module.
@@ -13,7 +13,7 @@ function setupPromises(scheduleMicrotasks) { | |||
else if (event === promiseRejectEvent.handled) | |||
rejectionHandled(promise); | |||
else | |||
require('assert').fail('unexpected PromiseRejectEvent'); | |||
require('assert').fail(null, null, 'unexpected PromiseRejectEvent'); |
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.
Why is the require()
here instead of at the top of the 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.
To avoid the hit of require('assert')
in the common case.
1 nit, but otherwise LGTM |
LGTM |
3 similar comments
LGTM |
LGTM |
LGTM |
The message argument for `assert.fail()` is the third argument, not the first. Correct minor misuse in internal module. PR-URL: #6211 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Landed in b7f4b1b |
The message argument for `assert.fail()` is the third argument, not the first. Correct minor misuse in internal module. PR-URL: #6211 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
The message argument for `assert.fail()` is the third argument, not the first. Correct minor misuse in internal module. PR-URL: #6211 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
The message argument for `assert.fail()` is the third argument, not the first. Correct minor misuse in internal module. PR-URL: #6211 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
The message argument for `assert.fail()` is the third argument, not the first. Correct minor misuse in internal module. PR-URL: #6211 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
The message argument for `assert.fail()` is the third argument, not the first. Correct minor misuse in internal module. PR-URL: #6211 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
The message argument for `assert.fail()` is the third argument, not the first. Correct minor misuse in internal module. PR-URL: nodejs#6211 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
The message argument for `assert.fail()` is the third argument, not the first. Correct minor misuse in internal module. PR-URL: #6211 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
this file does not exist on v4.x @Trott up to you if you want to figure out where the code lives |
@thealphanerd I think v4.x will somehow manage to get by without this patch. |
Checklist
Affected core subsystem(s)
process, promises
Description of change
The message argument for
assert.fail()
is the third argument, not thefirst. Correct minor misuse in internal module.