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

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

Issue 10689063: Revert "Revert "First step towards having patch files for generic libraries."" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 } 149 }
150 150
151 void scanBuiltinLibraries() { 151 void scanBuiltinLibraries() {
152 // Do nothing. The mock core library is already handled in the constructor. 152 // Do nothing. The mock core library is already handled in the constructor.
153 } 153 }
154 154
155 LibraryElement scanBuiltinLibrary(String name) { 155 LibraryElement scanBuiltinLibrary(String name) {
156 // Do nothing. The mock core library is already handled in the constructor. 156 // Do nothing. The mock core library is already handled in the constructor.
157 } 157 }
158 158
159 // The mock library doesn't need any patches.
160 Uri resolvePatchUri(String dartLibraryName) => null;
161
159 Script readScript(Uri uri, [ScriptTag node]) { 162 Script readScript(Uri uri, [ScriptTag node]) {
160 String code = sources[uri.toString()]; 163 String code = sources[uri.toString()];
161 if (code === null) throw new IllegalArgumentException(uri); 164 if (code === null) throw new IllegalArgumentException(uri);
162 return new StringScript(code); 165 return new StringScript(code);
163 } 166 }
164 } 167 }
165 168
166 void compareWarningKinds(String text, expectedWarnings, foundWarnings) { 169 void compareWarningKinds(String text, expectedWarnings, foundWarnings) {
167 var fail = (message) => Expect.fail('$text: $message'); 170 var fail = (message) => Expect.fail('$text: $message');
168 Iterator<MessageKind> expected = expectedWarnings.iterator(); 171 Iterator<MessageKind> expected = expectedWarnings.iterator();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 importLibrary(library, compiler.coreLibrary, compiler); 203 importLibrary(library, compiler.coreLibrary, compiler);
201 return library; 204 return library;
202 } 205 }
203 206
204 class StringScript extends Script { 207 class StringScript extends Script {
205 final String code; 208 final String code;
206 StringScript(this.code) : super(null, null); 209 StringScript(this.code) : super(null, null);
207 String get text() => code; 210 String get text() => code;
208 String get name() => "mock script"; 211 String get name() => "mock script";
209 } 212 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698