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

process: fix incorrect usage of assert.fail() #6211

Closed
wants to merge 1 commit into from
Closed

Conversation

Trott
Copy link
Member

@Trott Trott commented Apr 15, 2016

Checklist
  • tests and code linting passes
  • the commit message follows commit guidelines
Affected core subsystem(s)

process, promises

Description of change

The message argument for assert.fail() is the third argument, not the
first. Correct minor misuse in internal module.

The message argument for `assert.fail()` is the third argument, not the
first. Correct minor misuse in internal module.
@Trott Trott added process Issues and PRs related to the process subsystem. promises Issues and PRs related to ECMAScript promises. labels Apr 15, 2016
@Trott
Copy link
Member Author

Trott commented Apr 15, 2016

@@ -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');
Copy link
Contributor

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?

Copy link
Member

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.

@mscdex
Copy link
Contributor

mscdex commented Apr 15, 2016

1 nit, but otherwise LGTM

@bnoordhuis
Copy link
Member

LGTM

3 similar comments
@jasnell
Copy link
Member

jasnell commented Apr 15, 2016

LGTM

@evanlucas
Copy link
Contributor

LGTM

@cjihrig
Copy link
Contributor

cjihrig commented Apr 18, 2016

LGTM

jasnell pushed a commit that referenced this pull request Apr 18, 2016
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>
@jasnell
Copy link
Member

jasnell commented Apr 18, 2016

Landed in b7f4b1b

@jasnell jasnell closed this Apr 18, 2016
MylesBorins pushed a commit that referenced this pull request Apr 19, 2016
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>
MylesBorins pushed a commit that referenced this pull request Apr 20, 2016
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>
MylesBorins pushed a commit that referenced this pull request Apr 20, 2016
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>
@MylesBorins MylesBorins mentioned this pull request Apr 20, 2016
MylesBorins pushed a commit that referenced this pull request Apr 20, 2016
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 was referenced Apr 21, 2016
MylesBorins pushed a commit that referenced this pull request Apr 21, 2016
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>
joelostrowski pushed a commit to joelostrowski/node that referenced this pull request Apr 25, 2016
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>
jasnell pushed a commit that referenced this pull request Apr 26, 2016
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>
@MylesBorins
Copy link
Contributor

this file does not exist on v4.x

@Trott up to you if you want to figure out where the code lives

@Trott
Copy link
Member Author

Trott commented May 18, 2016

@thealphanerd I think v4.x will somehow manage to get by without this patch.

@Trott Trott deleted the deep branch January 13, 2022 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
process Issues and PRs related to the process subsystem. promises Issues and PRs related to ECMAScript promises.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants