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

Unified Diff: tests/compiler/dart2js_extra/deferred/deferred_function_test.dart

Issue 232563006: Insert checks before deferred calls and accesses. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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
Index: tests/compiler/dart2js_extra/deferred/deferred_function_test.dart
diff --git a/tests/compiler/dart2js_extra/deferred/deferred_function_test.dart b/tests/compiler/dart2js_extra/deferred/deferred_function_test.dart
index aad0c5739eb49cf49f602cee8e777f464ae5d2eb..e6f7f8827c8153204f08defedf3f41db687ef94d 100644
--- a/tests/compiler/dart2js_extra/deferred/deferred_function_test.dart
+++ b/tests/compiler/dart2js_extra/deferred/deferred_function_test.dart
@@ -14,18 +14,15 @@ import 'dart:async';
const lazy = const DeferredLibrary('deferred_function_library');
-isNoSuchMethodError(e) => e is NoSuchMethodError;
+isError(e) => e is Error;
floitsch 2014/04/14 12:04:08 Can we be more specific?
sigurdm 2014/04/22 11:22:48 I leave it for now in this CL - and then we try to
readFoo() {
- // TODO(ahe): There is a problem with type inference of deferred
- // function closures. We think they are never null.
- if (new DateTime.now().millisecondsSinceEpoch == 87) return null;
return lib.foo;
}
main() {
- Expect.throws(() { lib.foo('a'); }, isNoSuchMethodError);
- Expect.throws(readFoo, isNoSuchMethodError);
+ Expect.throws(() { lib.foo('a'); }, isError);
+ Expect.throws(readFoo, isError);
int counter = 0;
asyncStart();
lazy.load().then((_) {
@@ -45,6 +42,6 @@ main() {
asyncEnd();
});
Expect.equals(0, counter);
- Expect.throws(() { lib.foo('a'); }, isNoSuchMethodError);
- Expect.throws(readFoo, isNoSuchMethodError);
+ Expect.throws(() { lib.foo('a'); }, isError);
+ Expect.throws(readFoo, isError);
}

Powered by Google App Engine
This is Rietveld 408576698