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

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

Issue 11879039: Fix error message for library name mismatch. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Unittest added. Created 7 years, 11 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:collection'; 7 import 'dart:collection';
8 import 'dart:uri'; 8 import 'dart:uri';
9 9
10 import '../../../sdk/lib/_internal/compiler/compiler.dart' as api; 10 import '../../../sdk/lib/_internal/compiler/compiler.dart' as api;
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 // Do nothing. The mock core library is already handled in the constructor. 261 // Do nothing. The mock core library is already handled in the constructor.
262 } 262 }
263 263
264 void importCoreLibrary(LibraryElement library) { 264 void importCoreLibrary(LibraryElement library) {
265 scanner.importLibrary(library, coreLibrary, null); 265 scanner.importLibrary(library, coreLibrary, null);
266 } 266 }
267 267
268 // The mock library doesn't need any patches. 268 // The mock library doesn't need any patches.
269 Uri resolvePatchUri(String dartLibraryName) => null; 269 Uri resolvePatchUri(String dartLibraryName) => null;
270 270
271 Script readScript(Uri uri, [ScriptTag node]) { 271 Script readScript(Uri uri, [Node node]) {
272 SourceFile sourceFile = sourceFiles[uri.toString()]; 272 SourceFile sourceFile = sourceFiles[uri.toString()];
273 if (sourceFile == null) throw new ArgumentError(uri); 273 if (sourceFile == null) throw new ArgumentError(uri);
274 return new Script(uri, sourceFile); 274 return new Script(uri, sourceFile);
275 } 275 }
276 276
277 Element lookupElementIn(ScopeContainerElement container, name) { 277 Element lookupElementIn(ScopeContainerElement container, name) {
278 Element element = container.localLookup(name); 278 Element element = container.localLookup(name);
279 return element != null 279 return element != null
280 ? element 280 ? element
281 : new ErroneousElementX(null, null, name, container); 281 : new ErroneousElementX(null, null, name, container);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 operator []=(Node node, Element element) { 329 operator []=(Node node, Element element) {
330 map[node] = element; 330 map[node] = element;
331 } 331 }
332 332
333 operator [](Node node) => map[node]; 333 operator [](Node node) => map[node];
334 334
335 void remove(Node node) { 335 void remove(Node node) {
336 map.remove(node); 336 map.remove(node);
337 } 337 }
338 } 338 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698