Skip to content

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

Closed
Trott wants to merge 1 commit into
nodejs:masterfrom
Trott:deep
Closed

process: fix incorrect usage of assert.fail()#6211
Trott wants to merge 1 commit into
nodejs:masterfrom
Trott:deep

Conversation

@Trott

Copy link
Copy Markdown
Member
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.
@TrottTrott 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
Copy Markdown
MemberAuthor

rejectionHandled(promise);
else
require('assert').fail('unexpected PromiseRejectEvent');
require('assert').fail(null, null, 'unexpected PromiseRejectEvent');

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

1 nit, but otherwise LGTM

@bnoordhuis

Copy link
Copy Markdown
Member

LGTM

3 similar comments
@jasnell

Copy link
Copy Markdown
Member

LGTM

@evanlucas

Copy link
Copy Markdown
Contributor

LGTM

@cjihrig

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Member

Landed in b7f4b1b

@jasnelljasnell 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>
@MylesBorinsMylesBorins 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
Copy Markdown
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
Copy Markdown
MemberAuthor

@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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

processIssues and PRs related to the process subsystem.promisesIssues and PRs related to ECMAScript promises.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@Trott@mscdex@bnoordhuis@jasnell@evanlucas@cjihrig@MylesBorins