Don't assume that a stack overflow is an Error.

A new test captures a stack overflow error and rethrows it.
It assumed that it would be a Dart `Error`, but on dartdevk it's not.
Now just catches whatever it is and checks that it's the same
object again.

Bug: http://dartbug.com/47664
Change-Id: I2355ab1b43adf82806b0b76fc26aa5879ddb0d87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219788
Auto-Submit: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This commit is contained in:
Lasse R.H. Nielsen 2021-11-10 21:36:13 +00:00 committed by commit-bot@chromium.org
parent 1edd60da35
commit 62f4712523
2 changed files with 2 additions and 2 deletions

View file

@ -131,7 +131,7 @@ main() {
// Should work with whichever object gets here.
try {
Error.throwWithStackTrace(error, systemStack);
} on Error catch (e, s) {
} catch (e, s) {
Expect.identical(error, e);
Expect.equals("$systemStack", "$s");
}

View file

@ -132,7 +132,7 @@ main() {
// Should work with whichever object gets here.
try {
Error.throwWithStackTrace(error, systemStack);
} on Error catch (e, s) {
} catch (e, s) {
Expect.identical(error, e);
Expect.equals("$systemStack", "$s");
}