Skip to content

Commit f691647

Browse files
authored
Fixes #1595. Expect TypeError in place of NullThrownError in co19_2 tests (#1597)
Authored by @sgrekhov.
1 parent fa1aa99 commit f691647

File tree

8 files changed

+18
-18
lines changed

8 files changed

+18
-18
lines changed

Language/Expressions/Throw/evaluation_t01.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/// @assertion Evaluation of a throw expression of the form throw e; proceeds as
88
/// follows:
99
/// The expression e is evaluated yielding a value v.
10-
/// If v evaluates to null, then a NullThrownError is thrown. Otherwise, control
10+
/// If v evaluates to null, then a TypeError is thrown. Otherwise, control
1111
/// is transferred to the nearest dynamically enclosing exception handler, with
1212
/// the current exception set to v and the current return value becomes
1313
/// undefined.

Language/Expressions/Throw/evaluation_t02.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/// @assertion Evaluation of a throw expression of the form throw e; proceeds as
88
/// follows:
99
/// The expression e is evaluated yielding a value v.
10-
/// If v evaluates to null, then a NullThrownError is thrown. Otherwise, control
10+
/// If v evaluates to null, then a TypeError is thrown. Otherwise, control
1111
/// is transferred to the nearest dynamically enclosing exception handler, with
1212
/// the current exception set to v and the current return value becomes
1313
/// undefined.

Language/Expressions/Throw/evaluation_t03.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/// @assertion Evaluation of a throw expression of the form throw e; proceeds as
88
/// follows:
99
/// The expression e is evaluated yielding a value v.
10-
/// If v evaluates to null, then a NullThrownError is thrown. Otherwise, control
10+
/// If v evaluates to null, then a TypeError is thrown. Otherwise, control
1111
/// is transferred to the nearest dynamically enclosing exception handler, with
1212
/// the current exception set to v and the current return value becomes
1313
/// undefined.

Language/Expressions/Throw/evaluation_t04.dart

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
/// @assertion Evaluation of a throw expression of the form throw e; proceeds as
88
/// follows:
99
/// The expression e is evaluated yielding a value v.
10-
/// If v evaluates to null, then a NullThrownError is thrown. Otherwise, control
10+
/// If v evaluates to null, then a TypeError is thrown. Otherwise, control
1111
/// is transferred to the nearest dynamically enclosing exception handler, with
1212
/// the current exception set to v and the current return value becomes
1313
/// undefined.
1414
/// @description Checks that attempting to throw null in any manner results in
15-
/// NullThrownError being thrown instead.
15+
/// TypeError being thrown instead.
1616
/// @author rodionov
1717
/// @reviewer kaigorodov
1818
@@ -27,21 +27,21 @@ n2() {}
2727
main() {
2828
try {
2929
throw null;
30-
Expect.fail("NullThrownError expected.");
31-
} on NullThrownError catch (ok) {}
30+
Expect.fail("TypeError expected.");
31+
} on TypeError catch (ok) {}
3232

3333
try {
3434
throw n();
35-
Expect.fail("NullThrownError expected.");
36-
} on NullThrownError catch (ok) {}
35+
Expect.fail("TypeError expected.");
36+
} on TypeError catch (ok) {}
3737

3838
try {
3939
throw n2();
40-
Expect.fail("NullThrownError expected.");
41-
} on NullThrownError catch (ok) {}
40+
Expect.fail("TypeError expected.");
41+
} on TypeError catch (ok) {}
4242

4343
try {
4444
throw (true ? null : null);
45-
Expect.fail("NullThrownError expected.");
46-
} on NullThrownError catch (ok) {}
45+
Expect.fail("TypeError expected.");
46+
} on TypeError catch (ok) {}
4747
}

Language/Expressions/Throw/evaluation_t05.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/// @assertion Evaluation of a throw expression of the form throw e; proceeds as
88
/// follows:
99
/// The expression e is evaluated yielding a value v.
10-
/// If v evaluates to null, then a NullThrownError is thrown. Otherwise, control
10+
/// If v evaluates to null, then a TypeError is thrown. Otherwise, control
1111
/// is transferred to the nearest dynamically enclosing exception handler, with
1212
/// the current exception set to v and the current return value becomes
1313
/// undefined.

LibTest/async/Future/Future.error_A01_t01.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ check(value) {
2020
new Future.error(value)
2121
.catchError((error) {
2222
if (value == null) {
23-
Expect.isTrue(error is NullThrownError);
23+
Expect.isTrue(error is TypeError);
2424
} else {
2525
Expect.identical(value, error);
2626
}

LibTest/async/Future/Future.sync_A01_t03.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ check(value) {
2828
Expect.fail("Created future should complete with error");
2929
},
3030
onError: (e) {
31-
if (value==null){
32-
Expect.isTrue(e is NullThrownError);
31+
if (value == null){
32+
Expect.isTrue(e is TypeError);
3333
} else {
3434
Expect.identical(value, e);
3535
}

Utils/tests/Expect/throws_A01_t03.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ main() {
4343
check(badboy2, (e) => false);
4444

4545
Expect.throws(badboy3);
46-
Expect.throws(badboy3, (e) => e is NullThrownError, "");
46+
Expect.throws(badboy3, (e) => e is TypeError, "");
4747
check(badboy3, (e) => false, "not empty");
4848
}
4949

0 commit comments

Comments
 (0)