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

Side by Side Diff: tests/compiler/dart2js/mock_compiler.dart

Issue 10989013: Change IllegalArgumentException to ArgumentError. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated co19 test expectations. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #library('mock_compiler'); 5 #library('mock_compiler');
6 6
7 #import("dart:uri"); 7 #import("dart:uri");
8 8
9 #import("../../../lib/compiler/implementation/elements/elements.dart"); 9 #import("../../../lib/compiler/implementation/elements/elements.dart");
10 #import("../../../lib/compiler/implementation/leg.dart"); 10 #import("../../../lib/compiler/implementation/leg.dart");
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 173
174 void importCoreLibrary(LibraryElement library) { 174 void importCoreLibrary(LibraryElement library) {
175 scanner.importLibrary(library, coreLibrary, null); 175 scanner.importLibrary(library, coreLibrary, null);
176 } 176 }
177 177
178 // The mock library doesn't need any patches. 178 // The mock library doesn't need any patches.
179 Uri resolvePatchUri(String dartLibraryName) => null; 179 Uri resolvePatchUri(String dartLibraryName) => null;
180 180
181 Script readScript(Uri uri, [ScriptTag node]) { 181 Script readScript(Uri uri, [ScriptTag node]) {
182 SourceFile sourceFile = sourceFiles[uri.toString()]; 182 SourceFile sourceFile = sourceFiles[uri.toString()];
183 if (sourceFile === null) throw new IllegalArgumentException(uri); 183 if (sourceFile === null) throw new ArgumentError(uri);
184 return new Script(uri, sourceFile); 184 return new Script(uri, sourceFile);
185 } 185 }
186 } 186 }
187 187
188 void compareWarningKinds(String text, expectedWarnings, foundWarnings) { 188 void compareWarningKinds(String text, expectedWarnings, foundWarnings) {
189 var fail = (message) => Expect.fail('$text: $message'); 189 var fail = (message) => Expect.fail('$text: $message');
190 Iterator<MessageKind> expected = expectedWarnings.iterator(); 190 Iterator<MessageKind> expected = expectedWarnings.iterator();
191 Iterator<WarningMessage> found = foundWarnings.iterator(); 191 Iterator<WarningMessage> found = foundWarnings.iterator();
192 while (expected.hasNext() && found.hasNext()) { 192 while (expected.hasNext() && found.hasNext()) {
193 Expect.equals(expected.next(), found.next().message.kind); 193 Expect.equals(expected.next(), found.next().message.kind);
(...skipping 20 matching lines...) Expand all
214 }); 214 });
215 } 215 }
216 } 216 }
217 217
218 LibraryElement mockLibrary(Compiler compiler, String source) { 218 LibraryElement mockLibrary(Compiler compiler, String source) {
219 Uri uri = new Uri.fromComponents(scheme: "source"); 219 Uri uri = new Uri.fromComponents(scheme: "source");
220 var library = new LibraryElement(new Script(uri, new MockFile(source))); 220 var library = new LibraryElement(new Script(uri, new MockFile(source)));
221 importLibrary(library, compiler.coreLibrary, compiler); 221 importLibrary(library, compiler.coreLibrary, compiler);
222 return library; 222 return library;
223 } 223 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698