[tests] Update expectation to TypeError

TypeError is now expected in the place of NullThrownError which is
being removed in Dart 3.0.

Change-Id: Ibb7188d993216067650d4b994a303f2bcd1d2298
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275742
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
This commit is contained in:
Nicholas Shahan 2022-12-14 21:37:27 +00:00 committed by Commit Queue
parent f30e5de558
commit faf8027465

View file

@ -26,11 +26,12 @@ class ExceptionTest {
bool correctCatch = false;
try {
// This throws NullThrownError
// This used to throw a NullThrownError but that error was removed in
// Dart 3.0. Now it throws a TypeError.
throw null;
} on String catch (s) {
correctCatch = false;
} on NullThrownError catch (e) {
} on TypeError catch (e) {
correctCatch = true;
} catch (x) {
correctCatch = false;