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

Unified Diff: tests/compiler/dart2js/serialization/test_data.dart

Issue 2116473002: Handle invalid deferred prefix declarations. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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 | « pkg/compiler/lib/src/compiler.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/serialization/test_data.dart
diff --git a/tests/compiler/dart2js/serialization/test_data.dart b/tests/compiler/dart2js/serialization/test_data.dart
index e0fca607d07630bbfa0b1212d5c21d7617ab6750..74ec44f5c161a0f2d9b43ccc4aa1280b0d89dbdb 100644
--- a/tests/compiler/dart2js/serialization/test_data.dart
+++ b/tests/compiler/dart2js/serialization/test_data.dart
@@ -484,7 +484,7 @@ class D = A with B, C;
const Test('Deferred prefix loadLibrary', const {
'main.dart': '''
- import 'a.dart';
+import 'a.dart';
main() {
test();
@@ -500,6 +500,43 @@ test() {
'b.dart': '''
''',
}),
+
+ const Test('Deferred without prefix', const {
+ 'main.dart': '''
+import 'a.dart';
+
+main() {
+ test();
+}
+''',
+ }, preserializedSourceFiles: const {
+ 'a.dart': '''
+import 'b.dart' deferred;
+test() {}
+''',
+ 'b.dart': '''
+''',
+ }, expectedErrorCount: 1),
+
+ const Test('Deferred with duplicate prefix', const {
+ 'main.dart': '''
+import 'a.dart';
+
+main() {
+ test();
+}
+''',
+ }, preserializedSourceFiles: const {
+ 'a.dart': '''
+import 'b.dart' deferred as pre;
+import 'c.dart' deferred as pre;
+test() {}
+''',
+ 'b.dart': '''
+''',
+ 'c.dart': '''
+''',
+ }, expectedErrorCount: 1),
];
class Test {
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698