-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
console: make .assert standard compliant #17706
Conversation
The standard has no stack trace. See https://console.spec.whatwg.org/#assert
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will definitely need some good citgm runs on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
doc/api/console.md
Outdated
* `message` {any} | ||
* `...args` {any} | ||
* `value` {any} The value tested for being truthy. | ||
* `...message` {any} All arguments besides the first are used as error message. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels a tiny bit confusing just because it says "all arguments besides the first." Is there a way we could reword?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am open for suggestions ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe something like "All arguments besides value
are used as error message."? Just to make it clear that first = value
not the first argument within message
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
New CI before landing due to weird build failures from before |
And a new CI https://ci.nodejs.org/job/node-test-commit-light/50/ |
Landed in 15d880b |
The standard does not throw and has no stack trace. See https://console.spec.whatwg.org/#assert PR-URL: nodejs#17706 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
The standard does not throw and has no stack trace.
See https://console.spec.whatwg.org/#assert
This was mentioned before and the "documentation fix" in #6169 was not seen as a good solution by everyone and I would also prefer the way the standard behaves.
This is clearly a BC but I doubt that this is really a troublemaker.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
console