-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
assert: minor assert improvements #27525
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This comment has been minimized.
This comment has been minimized.
nodejs-github-bot
added
the
assert
Issues and PRs related to the assert subsystem.
label
May 1, 2019
4 tasks
This comment has been minimized.
This comment has been minimized.
This makes sure the error message visible in the error stack created when using `assert.fail()` without any arguments or the message set to `undefined` or `null` as only argument. That was masked before due to other changes.
This makes sure that the error message is more appropriate than before by checking closer what operator is used and which is not. It also increases the total number of lines printed to the user.
This reduces the total amount of reads when using `assert.ok()` with a falsy value. That increases the read performance significantly. Also remove a comment that can not be addressed.
BridgeAR
force-pushed
the
minor-assert-improvements
branch
from
May 2, 2019 21:32
aca30b0
to
d993bb9
Compare
Trott
approved these changes
May 3, 2019
This comment has been minimized.
This comment has been minimized.
BridgeAR
added
the
author ready
PRs that have at least one approval, no pending requests for changes, and a CI started.
label
May 3, 2019
targos
approved these changes
May 3, 2019
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Landed in 7cfcf80...d099f2f |
Trott
pushed a commit
to Trott/io.js
that referenced
this pull request
May 5, 2019
This makes sure the error message visible in the error stack created when using `assert.fail()` without any arguments or the message set to `undefined` or `null` as only argument. That was masked before due to other changes. PR-URL: nodejs#27525 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
Trott
pushed a commit
to Trott/io.js
that referenced
this pull request
May 5, 2019
This makes sure that the error message is more appropriate than before by checking closer what operator is used and which is not. It also increases the total number of lines printed to the user. PR-URL: nodejs#27525 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
Trott
pushed a commit
to Trott/io.js
that referenced
this pull request
May 5, 2019
This reduces the total amount of reads when using `assert.ok()` with a falsy value. That increases the read performance significantly. Also remove a comment that can not be addressed. PR-URL: nodejs#27525 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
This needs to be backported to land on v12.x:
|
BridgeAR
added a commit
that referenced
this pull request
May 6, 2019
This makes sure the error message visible in the error stack created when using `assert.fail()` without any arguments or the message set to `undefined` or `null` as only argument. That was masked before due to other changes. PR-URL: #27525 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
BridgeAR
added a commit
that referenced
this pull request
May 6, 2019
This makes sure that the error message is more appropriate than before by checking closer what operator is used and which is not. It also increases the total number of lines printed to the user. PR-URL: #27525 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
BridgeAR
added a commit
that referenced
this pull request
May 6, 2019
This reduces the total amount of reads when using `assert.ok()` with a falsy value. That increases the read performance significantly. Also remove a comment that can not be addressed. PR-URL: #27525 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
@targos I pushed the backport directly onto the staging branch. It was just a very tiny conflict. --- a/test/parallel/test-assert.js
+++ b/test/parallel/test-assert.js
@@ -291,13 +291,13 @@ testShortAssertionMessage(0, '0');
testShortAssertionMessage(Symbol(), 'Symbol()');
testShortAssertionMessage(undefined, 'undefined');
testShortAssertionMessage(-Infinity, '-Infinity');
+testShortAssertionMessage(function() {}, '[Function]');
testAssertionMessage([], '[]');
testAssertionMessage(/a/, '/a/');
testAssertionMessage(/abc/gim, '/abc/gim');
testAssertionMessage({}, '{}');
testAssertionMessage([1, 2, 3], '[\n+ 1,\n+ 2,\n+ 3\n+ ]');
testAssertionMessage(function f() {}, '[Function: f]');
-testAssertionMessage(function() {}, '[Function]');
testAssertionMessage(circular, '{\n+ x: [Circular],\n+ y: 1\n+ }');
testAssertionMessage({ a: undefined, b: null },
'{\n+ a: undefined,\n+ b: null\n+ }'); |
targos
pushed a commit
that referenced
this pull request
May 7, 2019
This makes sure the error message visible in the error stack created when using `assert.fail()` without any arguments or the message set to `undefined` or `null` as only argument. That was masked before due to other changes. PR-URL: #27525 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
targos
pushed a commit
that referenced
this pull request
May 7, 2019
This makes sure that the error message is more appropriate than before by checking closer what operator is used and which is not. It also increases the total number of lines printed to the user. PR-URL: #27525 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
targos
pushed a commit
that referenced
this pull request
May 7, 2019
This reduces the total amount of reads when using `assert.ok()` with a falsy value. That increases the read performance significantly. Also remove a comment that can not be addressed. PR-URL: #27525 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
assert
Issues and PRs related to the assert subsystem.
author ready
PRs that have at least one approval, no pending requests for changes, and a CI started.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See commit messages for further details.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes