0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/doc
Rich Trott 758b8b6e5d assert: improve assert.fail() API
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: https://github.com/nodejs/node/pull/12293
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-12 14:25:22 -07:00
..
api assert: improve assert.fail() API 2017-04-12 14:25:22 -07:00
api_assets doc: reduce font size on smaller screens 2017-03-09 10:59:24 +01:00
changelogs 2017-04-11, Version 7.9.0 (Current) 2017-04-11 13:39:32 -04:00
guides doc: edit the benchmark guide 2017-03-27 10:27:08 -07:00
full-white-stripe.jpg build: update Node.js logo on Win installer 2016-03-06 20:22:36 -06:00
node.1 doc, inspector: note that the host is optional 2017-04-04 10:26:00 +01:00
onboarding-extras.md doc: document the performance team 2017-04-08 10:55:45 +01:00
onboarding.md doc: add personal pronouns option 2017-02-02 11:38:42 -08:00
osx_installer_logo.png
releases.md doc: update Mac OS X references in releases.md 2017-04-04 10:14:40 -07:00
STYLE_GUIDE.md doc: change Mac OS X to macOS 2017-04-04 10:14:24 -07:00
template.html tools,doc: add Google Analytics tracking. 2017-01-25 21:54:34 +01:00
thin-white-stripe.jpg build: update Node.js logo on Win installer 2016-03-06 20:22:36 -06:00