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

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

Issue 45763004: Revert "Re-land "Search for main in the exported names of the main library, not in the library itse… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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/co19/co19-dart2js.status ('k') | tests/language/export_ambiguous_main_a.dart » ('j') | 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) 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 "package:expect/expect.dart"; 7 import "package:expect/expect.dart";
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:collection'; 9 import 'dart:collection';
10 10
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 compiler.withCurrentElement(element, () { 460 compiler.withCurrentElement(element, () {
461 target.addToScope(element, compiler); 461 target.addToScope(element, compiler);
462 }); 462 });
463 } 463 }
464 } 464 }
465 465
466 LibraryElement mockLibrary(Compiler compiler, String source) { 466 LibraryElement mockLibrary(Compiler compiler, String source) {
467 Uri uri = new Uri(scheme: "source"); 467 Uri uri = new Uri(scheme: "source");
468 var library = new LibraryElementX(new Script(uri, new MockFile(source))); 468 var library = new LibraryElementX(new Script(uri, new MockFile(source)));
469 importLibrary(library, compiler.coreLibrary, compiler); 469 importLibrary(library, compiler.coreLibrary, compiler);
470 library.setExports(<Element>[]);
471 return library; 470 return library;
472 } 471 }
473 472
474 class CollectingTreeElements extends TreeElementMapping { 473 class CollectingTreeElements extends TreeElementMapping {
475 final Map<Node, Element> map = new LinkedHashMap<Node, Element>(); 474 final Map<Node, Element> map = new LinkedHashMap<Node, Element>();
476 475
477 CollectingTreeElements(Element currentElement) : super(currentElement); 476 CollectingTreeElements(Element currentElement) : super(currentElement);
478 477
479 operator []=(Node node, Element element) { 478 operator []=(Node node, Element element) {
480 map[node] = element; 479 map[node] = element;
(...skipping 22 matching lines...) Expand all
503 } else { 502 } else {
504 sourceFile = compiler.sourceFiles[uri.toString()]; 503 sourceFile = compiler.sourceFiles[uri.toString()];
505 } 504 }
506 if (sourceFile != null && begin != null && end != null) { 505 if (sourceFile != null && begin != null && end != null) {
507 print(sourceFile.getLocationMessage(message, begin, end, true, (x) => x)); 506 print(sourceFile.getLocationMessage(message, begin, end, true, (x) => x));
508 } else { 507 } else {
509 print(message); 508 print(message);
510 } 509 }
511 }; 510 };
512 } 511 }
OLDNEW
« no previous file with comments | « tests/co19/co19-dart2js.status ('k') | tests/language/export_ambiguous_main_a.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698