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

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

Issue 10908287: Make identical(a,b) a compile-time constant in dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 interface int extends num {} 57 interface int extends num {}
58 interface double extends num {} 58 interface double extends num {}
59 class bool {} 59 class bool {}
60 class String {} 60 class String {}
61 class Object {} 61 class Object {}
62 interface num {} 62 interface num {}
63 class Function {} 63 class Function {}
64 class List {} 64 class List {}
65 class Closure {} 65 class Closure {}
66 class Null {} 66 class Null {}
67 class Dynamic_ {}'''; 67 class Dynamic_ {}
68 bool identical(Object a, Object b) {}''';
68 69
69 class MockCompiler extends Compiler { 70 class MockCompiler extends Compiler {
70 List<WarningMessage> warnings; 71 List<WarningMessage> warnings;
71 List<WarningMessage> errors; 72 List<WarningMessage> errors;
72 final Map<String, SourceFile> sourceFiles; 73 final Map<String, SourceFile> sourceFiles;
73 Node parsedTree; 74 Node parsedTree;
74 75
75 MockCompiler([String coreSource = DEFAULT_CORELIB, 76 MockCompiler([String coreSource = DEFAULT_CORELIB,
76 String helperSource = DEFAULT_HELPERLIB, 77 String helperSource = DEFAULT_HELPERLIB,
77 String interceptorsSource = DEFAULT_INTERCEPTORSLIB, 78 String interceptorsSource = DEFAULT_INTERCEPTORSLIB,
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 }); 214 });
214 } 215 }
215 } 216 }
216 217
217 LibraryElement mockLibrary(Compiler compiler, String source) { 218 LibraryElement mockLibrary(Compiler compiler, String source) {
218 Uri uri = new Uri.fromComponents(scheme: "source"); 219 Uri uri = new Uri.fromComponents(scheme: "source");
219 var library = new LibraryElement(new Script(uri, new MockFile(source))); 220 var library = new LibraryElement(new Script(uri, new MockFile(source)));
220 importLibrary(library, compiler.coreLibrary, compiler); 221 importLibrary(library, compiler.coreLibrary, compiler);
221 return library; 222 return library;
222 } 223 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698