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

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

Issue 59073003: Version 0.8.10.4 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
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
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>[]);
470 return library; 471 return library;
471 } 472 }
472 473
473 class CollectingTreeElements extends TreeElementMapping { 474 class CollectingTreeElements extends TreeElementMapping {
474 final Map<Node, Element> map = new LinkedHashMap<Node, Element>(); 475 final Map<Node, Element> map = new LinkedHashMap<Node, Element>();
475 476
476 CollectingTreeElements(Element currentElement) : super(currentElement); 477 CollectingTreeElements(Element currentElement) : super(currentElement);
477 478
478 operator []=(Node node, Element element) { 479 operator []=(Node node, Element element) {
479 map[node] = element; 480 map[node] = element;
(...skipping 22 matching lines...) Expand all
502 } else { 503 } else {
503 sourceFile = compiler.sourceFiles[uri.toString()]; 504 sourceFile = compiler.sourceFiles[uri.toString()];
504 } 505 }
505 if (sourceFile != null && begin != null && end != null) { 506 if (sourceFile != null && begin != null && end != null) {
506 print(sourceFile.getLocationMessage(message, begin, end, true, (x) => x)); 507 print(sourceFile.getLocationMessage(message, begin, end, true, (x) => x));
507 } else { 508 } else {
508 print(message); 509 print(message);
509 } 510 }
510 }; 511 };
511 } 512 }
OLDNEW
« no previous file with comments | « dart/tests/compiler/dart2js/cpa_inference_test.dart ('k') | dart/tests/compiler/dart2js/type_combination_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698