| Index: tests/language/call_through_null_getter_test.dart
|
| diff --git a/tests/language/call_through_null_getter_test.dart b/tests/language/call_through_null_getter_test.dart
|
| index 72b33acc28424e884898a75686f24efeb15fb781..05024964b817595059a0ad24df89482e4a4cbea8 100644
|
| --- a/tests/language/call_through_null_getter_test.dart
|
| +++ b/tests/language/call_through_null_getter_test.dart
|
| @@ -19,51 +19,43 @@ class CallThroughNullGetterTest {
|
|
|
| static void testTopLevel() {
|
| topLevel = null;
|
| - expectThrowsObjectNotClosureException(() { topLevel(); });
|
| - expectThrowsObjectNotClosureException(() { (topLevel)(); });
|
| - expectThrowsObjectNotClosureException(() { TOP_LEVEL_NULL(); });
|
| - expectThrowsObjectNotClosureException(() { (TOP_LEVEL_NULL)(); });
|
| + expectThrowsNullPointerException(() { topLevel(); });
|
| + expectThrowsNullPointerException(() { (topLevel)(); });
|
| + expectThrowsNullPointerException(() { TOP_LEVEL_NULL(); });
|
| + expectThrowsNullPointerException(() { (TOP_LEVEL_NULL)(); });
|
| }
|
|
|
| static void testField() {
|
| A a = new A();
|
|
|
| a.field = null;
|
| - expectThrowsObjectNotClosureException(() { a.field(); });
|
| - expectThrowsObjectNotClosureException(() { (a.field)(); });
|
| + expectThrowsNullPointerException(() { a.field(); });
|
| + expectThrowsNullPointerException(() { (a.field)(); });
|
| }
|
|
|
| static void testGetter() {
|
| A a = new A();
|
|
|
| a.field = null;
|
| - expectThrowsObjectNotClosureException(() { a.getter(); });
|
| - expectThrowsObjectNotClosureException(() { (a.getter)(); });
|
| + expectThrowsNullPointerException(() { a.getter(); });
|
| + expectThrowsNullPointerException(() { (a.getter)(); });
|
| }
|
|
|
| static void testMethod() {
|
| A a = new A();
|
|
|
| a.field = null;
|
| - expectThrowsObjectNotClosureException(() { a.method()(); });
|
| + expectThrowsNullPointerException(() { a.method()(); });
|
| }
|
|
|
| static void expectThrowsNullPointerException(fn) {
|
| var exception = catchException(fn);
|
| - if (!(exception is NullPointerException)) {
|
| + if (exception is! NullPointerException) {
|
| Expect.fail("Wrong exception. Expected: NullPointerException"
|
| " got: ${exception}");
|
| }
|
| }
|
|
|
| - static void expectThrowsObjectNotClosureException(fn) {
|
| - var exception = catchException(fn);
|
| - if (!(exception is ObjectNotClosureException)) {
|
| - Expect.fail("Wrong exception. Expected: ObjectNotClosureException"
|
| - " got: ${exception}");
|
| - }
|
| - }
|
| -
|
| static catchException(fn) {
|
| bool caught = false;
|
| var result = null;
|
|
|