-
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
[v6.x backport] assert.fail() accept a single argument or two arguments #15479
Conversation
is this semver-minor? original was semver-major |
ping @Trott |
@MylesBorins Original was labeled I'm not seeing anyone arguing that it is semver major or that it shouldn't be backported with the possible exception of @refack. |
To clarify, assuming you're talking about #12293 (comment), I was just saying that if this is backported to v6.x, then it should come with #12343. Given #12293 (comment) though, I would say that IMO this isn't |
b811464
to
2c8fe97
Compare
assert.fail() has two possible function signatures, both of which are not intuitive. It virtually guarantees that people who try to use assert.fail() without carefully reading the docs will end up using it incorrectly. This change maintains backwards compatibility with the two valid uses (arguments 1 2 and 4 supplied but argument 3 falsy, and argument 3 supplied but arguments 1 2 and 4 all falsy) but also adds the far more intuitive first-argument-only and first-two-arguments-only possibilities. assert.fail('boom'); // AssertionError: boom assert.fail('a', 'b'); // AssertionError: 'a' != 'b' PR-URL: nodejs#12293 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
assert.fail() has been updated to accept a single argument so that is no longer an error. Remove lint rule that checks for assert.fail() with a single argument. PR-URL: nodejs#12293 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
common.fail() was added to paste over issues with assert.fail() function signature. assert.fail() has been updated to accept a single argument so common.fail() is no longer necessary. PR-URL: nodejs#12293 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
a27528e
to
e5b11f8
Compare
If the current working directory is removed, Node cannot start normally because the module system calls uv_cwd(). Refs: nodejs#12022 PR-URL: nodejs#12343 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
355249a
to
0597d3f
Compare
assert.fail() has two possible function signatures, both of which are not intuitive. It virtually guarantees that people who try to use assert.fail() without carefully reading the docs will end up using it incorrectly. This change maintains backwards compatibility with the two valid uses (arguments 1 2 and 4 supplied but argument 3 falsy, and argument 3 supplied but arguments 1 2 and 4 all falsy) but also adds the far more intuitive first-argument-only and first-two-arguments-only possibilities. assert.fail('boom'); // AssertionError: boom assert.fail('a', 'b'); // AssertionError: 'a' != 'b' Backport-PR-URL: #15479 PR-URL: #12293 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
assert.fail() has been updated to accept a single argument so that is no longer an error. Remove lint rule that checks for assert.fail() with a single argument. Backport-PR-URL: #15479 PR-URL: #12293 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
common.fail() was added to paste over issues with assert.fail() function signature. assert.fail() has been updated to accept a single argument so common.fail() is no longer necessary. Backport-PR-URL: #15479 PR-URL: #12293 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
If the current working directory is removed, Node cannot start normally because the module system calls uv_cwd(). Backport-PR-URL: #15479 Refs: #12022 PR-URL: #12343 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
landed in 1213f38...0597d3f |
assert.fail() has two possible function signatures, both of which are not intuitive. It virtually guarantees that people who try to use assert.fail() without carefully reading the docs will end up using it incorrectly. This change maintains backwards compatibility with the two valid uses (arguments 1 2 and 4 supplied but argument 3 falsy, and argument 3 supplied but arguments 1 2 and 4 all falsy) but also adds the far more intuitive first-argument-only and first-two-arguments-only possibilities. assert.fail('boom'); // AssertionError: boom assert.fail('a', 'b'); // AssertionError: 'a' != 'b' Backport-PR-URL: #15479 PR-URL: #12293 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
assert.fail() has been updated to accept a single argument so that is no longer an error. Remove lint rule that checks for assert.fail() with a single argument. Backport-PR-URL: #15479 PR-URL: #12293 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
common.fail() was added to paste over issues with assert.fail() function signature. assert.fail() has been updated to accept a single argument so common.fail() is no longer necessary. Backport-PR-URL: #15479 PR-URL: #12293 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
If the current working directory is removed, Node cannot start normally because the module system calls uv_cwd(). Backport-PR-URL: #15479 Refs: #12022 PR-URL: #12343 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Backport of #12293
First commit:
Second commit: Remove lint rule that flags use of assert.fail() with a single argument.
Third commit: Remove common.fail() in tests since assert.fail() with a single argument works as expected.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)