Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Unified Diff: tests/language/call_through_null_getter_test.dart

Issue 11175032: Revert "Removing reference to ObjectNotClosureException from dart2js." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/language/call_through_getter_test.dart ('k') | tests/language/language.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 05024964b817595059a0ad24df89482e4a4cbea8..72b33acc28424e884898a75686f24efeb15fb781 100644
--- a/tests/language/call_through_null_getter_test.dart
+++ b/tests/language/call_through_null_getter_test.dart
@@ -19,43 +19,51 @@ class CallThroughNullGetterTest {
static void testTopLevel() {
topLevel = null;
- expectThrowsNullPointerException(() { topLevel(); });
- expectThrowsNullPointerException(() { (topLevel)(); });
- expectThrowsNullPointerException(() { TOP_LEVEL_NULL(); });
- expectThrowsNullPointerException(() { (TOP_LEVEL_NULL)(); });
+ expectThrowsObjectNotClosureException(() { topLevel(); });
+ expectThrowsObjectNotClosureException(() { (topLevel)(); });
+ expectThrowsObjectNotClosureException(() { TOP_LEVEL_NULL(); });
+ expectThrowsObjectNotClosureException(() { (TOP_LEVEL_NULL)(); });
}
static void testField() {
A a = new A();
a.field = null;
- expectThrowsNullPointerException(() { a.field(); });
- expectThrowsNullPointerException(() { (a.field)(); });
+ expectThrowsObjectNotClosureException(() { a.field(); });
+ expectThrowsObjectNotClosureException(() { (a.field)(); });
}
static void testGetter() {
A a = new A();
a.field = null;
- expectThrowsNullPointerException(() { a.getter(); });
- expectThrowsNullPointerException(() { (a.getter)(); });
+ expectThrowsObjectNotClosureException(() { a.getter(); });
+ expectThrowsObjectNotClosureException(() { (a.getter)(); });
}
static void testMethod() {
A a = new A();
a.field = null;
- expectThrowsNullPointerException(() { a.method()(); });
+ expectThrowsObjectNotClosureException(() { 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;
« no previous file with comments | « tests/language/call_through_getter_test.dart ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698