-
Notifications
You must be signed in to change notification settings - Fork 30k
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: fix .throws and .doesNotThrow stack frames #17703
Conversation
The stack frames from .throws and .doesNotThrow got included even though that was not intended.
A combination of try catch and common.expectsError is not necessary as the latter already does everything on its own.
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 might need to be semver-major.
@TimothyGu theoretically someone could rely on that behavior but stack frames change relatively often without it being semver-major. It could be argued that this is specifically semver-major because it is the |
The stack frames from .throws and .doesNotThrow got included even though that was not intended. PR-URL: nodejs#17703 Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
A combination of try catch and common.expectsError is not necessary as the latter already does everything on its own. PR-URL: nodejs#17703 Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This does not land cleanly on v9.x Would someone be willing to backport? |
The stack frames from .throws and .doesNotThrow got included even though that was not intended. PR-URL: nodejs#17703 Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
A combination of try catch and common.expectsError is not necessary as the latter already does everything on its own. PR-URL: nodejs#17703 Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Backport opened in #19230 |
Requested backport to 8.x in #19230 |
The stack frames from .throws and .doesNotThrow got included even though that was not intended. PR-URL: nodejs#17703 Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
All assert functions suppress their own function name from showing up in the stack trace.
That was not the case with
throws
anddoesNotThrow
.On top of that I refactored two
common.expectsError
cases that were less than ideal. I can open a new PR for that if that is requested, but I stumbled upon those when looking for a good place to add a new test, so I thought it would be fine to include it in this PR.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
assert, test