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

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

Issue 169703003: Add prefix constraints for deferred imports. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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 406eb4a330ca928292f6cfe7ad2dd419584bf57d..09b27f06dcd506c47a9f2703280cdad9a4120e52 100644
--- a/tests/compiler/dart2js_extra/deferred/deferred_function_test.dart
+++ b/tests/compiler/dart2js_extra/deferred/deferred_function_test.dart
@@ -10,7 +10,7 @@ import 'package:expect/expect.dart';
import 'dart:async';
-@lazy import 'deferred_function_library.dart';
+@lazy import 'deferred_function_library.dart' as lib;
const lazy = const DeferredLibrary('deferred_function_library');
@@ -20,11 +20,11 @@ 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 foo;
+ return lib.foo;
}
main() {
- Expect.throws(() { foo('a'); }, isNoSuchMethodError);
+ Expect.throws(() { lib.foo('a'); }, isNoSuchMethodError);
Expect.throws(readFoo, isNoSuchMethodError);
int counter = 0;
asyncStart();
@@ -32,7 +32,7 @@ main() {
Expect.isTrue(didLoad);
Expect.equals(1, ++counter);
print('lazy was loaded');
- Expect.equals(42, foo('b'));
+ Expect.equals(42, lib.foo('b'));
Expect.isNotNull(readFoo());
asyncEnd();
});
@@ -42,11 +42,11 @@ main() {
Expect.isFalse(didLoad);
Expect.equals(2, ++counter);
print('lazy was loaded');
- Expect.equals(42, foo('b'));
+ Expect.equals(42, lib.foo('b'));
Expect.isNotNull(readFoo());
asyncEnd();
});
Expect.equals(0, counter);
- Expect.throws(() { foo('a'); }, isNoSuchMethodError);
+ Expect.throws(() { lib.foo('a'); }, isNoSuchMethodError);
Expect.throws(readFoo, isNoSuchMethodError);
}

Powered by Google App Engine
This is Rietveld 408576698