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

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

Issue 11967010: Internal libraries supported. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update MockCompiler 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:uri'; 7 import 'dart:uri';
8 8
9 import '../../../sdk/lib/_internal/compiler/compiler.dart' as api; 9 import '../../../sdk/lib/_internal/compiler/compiler.dart' as api;
10 import '../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar t'; 10 import '../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar t';
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 } 250 }
251 251
252 LibraryElement scanBuiltinLibrary(String name) { 252 LibraryElement scanBuiltinLibrary(String name) {
253 // Do nothing. The mock core library is already handled in the constructor. 253 // Do nothing. The mock core library is already handled in the constructor.
254 } 254 }
255 255
256 void importCoreLibrary(LibraryElement library) { 256 void importCoreLibrary(LibraryElement library) {
257 scanner.importLibrary(library, coreLibrary, null); 257 scanner.importLibrary(library, coreLibrary, null);
258 } 258 }
259 259
260 Uri resolveAbsoluteUri(LibraryElement importingLibrary,
261 Uri absoluteUri, Node node) => absoluteUri;
262
260 // The mock library doesn't need any patches. 263 // The mock library doesn't need any patches.
261 Uri resolvePatchUri(String dartLibraryName) => null; 264 Uri resolvePatchUri(String dartLibraryName) => null;
262 265
263 Script readScript(Uri uri, [ScriptTag node]) { 266 Script readScript(Uri uri, [ScriptTag node]) {
264 SourceFile sourceFile = sourceFiles[uri.toString()]; 267 SourceFile sourceFile = sourceFiles[uri.toString()];
265 if (sourceFile == null) throw new ArgumentError(uri); 268 if (sourceFile == null) throw new ArgumentError(uri);
266 return new Script(uri, sourceFile); 269 return new Script(uri, sourceFile);
267 } 270 }
268 271
269 Element lookupElementIn(ScopeContainerElement container, name) { 272 Element lookupElementIn(ScopeContainerElement container, name) {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 operator []=(Node node, Element element) { 324 operator []=(Node node, Element element) {
322 map[node] = element; 325 map[node] = element;
323 } 326 }
324 327
325 operator [](Node node) => map[node]; 328 operator [](Node node) => map[node];
326 329
327 void remove(Node node) { 330 void remove(Node node) {
328 map.remove(node); 331 map.remove(node);
329 } 332 }
330 } 333 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698