From 62f47125236d56855ddb2c6e9936ffd672120105 Mon Sep 17 00:00:00 2001 From: "Lasse R.H. Nielsen" Date: Wed, 10 Nov 2021 21:36:13 +0000 Subject: [PATCH] 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 Commit-Queue: Sigmund Cherem Reviewed-by: Sigmund Cherem --- tests/corelib/error_throw_with_stacktrace_test.dart | 2 +- tests/corelib_2/error_throw_with_stacktrace_test.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/corelib/error_throw_with_stacktrace_test.dart b/tests/corelib/error_throw_with_stacktrace_test.dart index 026df502a89..e74c80c6ce8 100644 --- a/tests/corelib/error_throw_with_stacktrace_test.dart +++ b/tests/corelib/error_throw_with_stacktrace_test.dart @@ -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"); } diff --git a/tests/corelib_2/error_throw_with_stacktrace_test.dart b/tests/corelib_2/error_throw_with_stacktrace_test.dart index 303b06c7db1..d6c3b59bb33 100644 --- a/tests/corelib_2/error_throw_with_stacktrace_test.dart +++ b/tests/corelib_2/error_throw_with_stacktrace_test.dart @@ -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"); }