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

Side by Side Diff: tests/language/malformed_test.dart

Issue 352523002: Fix parsing and resolving of prefixed names (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/language/language_dart2js.status ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Tests that malformed types are handled as dynamic, and that types with the 5 // Tests that malformed types are handled as dynamic, and that types with the
6 // wrong number of type arguments are handled as raw types. 6 // wrong number of type arguments are handled as raw types.
7 7
8 import 'package:expect/expect.dart'; 8 import 'package:expect/expect.dart';
9 import 'package:expect/expect.dart' as prefix; // Define 'prefix'. 9 import 'package:expect/expect.dart' as prefix; // Define 'prefix'.
10 10
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 checkIsMapDynamic(false, true, new Map<String, prefix.Unresolved<int>>()); 114 checkIsMapDynamic(false, true, new Map<String, prefix.Unresolved<int>>());
115 115
116 Expect.throws(() => new Unresolved(), (e) => true); 116 Expect.throws(() => new Unresolved(), (e) => true);
117 Expect.throws(() => new Unresolved<int>(), (e) => true); 117 Expect.throws(() => new Unresolved<int>(), (e) => true);
118 Expect.throws(() => new prefix.Unresolved(), (e) => true); 118 Expect.throws(() => new prefix.Unresolved(), (e) => true);
119 Expect.throws(() => new prefix.Unresolved<int>(), (e) => true); 119 Expect.throws(() => new prefix.Unresolved<int>(), (e) => true);
120 120
121 // The expression 'undeclared_prefix.Unresolved()' is parsed as the invocation 121 // The expression 'undeclared_prefix.Unresolved()' is parsed as the invocation
122 // of the named constructor 'Unresolved' on the type 'undeclared_prefix'. 122 // of the named constructor 'Unresolved' on the type 'undeclared_prefix'.
123 Expect.throws(() => new undeclared_prefix.Unresolved(), (e) => true); 123 Expect.throws(() => new undeclared_prefix.Unresolved(), (e) => true);
124 // The expression 'undeclared_prefix.Unresolved<int>' cannot be parsed. 124 // The expression 'undeclared_prefix.Unresolved<int>' is a malformed type.
125 Expect.throws(() => new undeclared_prefix.Unresolved<int>(), (e) => true); // / 05: compile-time error 125 Expect.throws(() => new undeclared_prefix.Unresolved<int>(), (e) => true);
126 126
127 try { 127 try {
128 try { 128 try {
129 throw 'foo'; 129 throw 'foo';
130 } on Unresolved catch (e) { 130 } on Unresolved catch (e) {
131 Expect.fail("This code shouldn't be executed"); 131 Expect.fail("This code shouldn't be executed");
132 } 132 }
133 Expect.fail("This code shouldn't be executed"); 133 Expect.fail("This code shouldn't be executed");
134 } on TypeError catch (e) { 134 } on TypeError catch (e) {
135 } 135 }
(...skipping 20 matching lines...) Expand all
156 throw 'foo'; 156 throw 'foo';
157 } on prefix.Unresolved<int> catch (e) { 157 } on prefix.Unresolved<int> catch (e) {
158 Expect.fail("This code shouldn't be executed"); 158 Expect.fail("This code shouldn't be executed");
159 } 159 }
160 Expect.fail("This code shouldn't be executed"); 160 Expect.fail("This code shouldn't be executed");
161 } on TypeError catch (e) { 161 } on TypeError catch (e) {
162 } 162 }
163 try { 163 try {
164 throw 'foo'; 164 throw 'foo';
165 } 165 }
166 on undeclared_prefix.Unresolved<int> /// 06: compile-time error 166 on undeclared_prefix.Unresolved<int> /// 06: runtime error
167 catch (e) { 167 catch (e) {
168 } 168 }
169 } 169 }
OLDNEW
« no previous file with comments | « tests/language/language_dart2js.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698