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

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

Issue 1819053002: Split loader from the rest of the compiler. This adds several abstractions to (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: add environment.dart Created 4 years, 9 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
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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 Uri resolvedUri, Spannable spannable) => resolvedUri; 261 Uri resolvedUri, Spannable spannable) => resolvedUri;
262 262
263 // The mock library doesn't need any patches. 263 // The mock library doesn't need any patches.
264 Uri resolvePatchUri(String dartLibraryName) { 264 Uri resolvePatchUri(String dartLibraryName) {
265 if (dartLibraryName == 'core') { 265 if (dartLibraryName == 'core') {
266 return PATCH_CORE; 266 return PATCH_CORE;
267 } 267 }
268 return null; 268 return null;
269 } 269 }
270 270
271 Future<Script> readScript(Spannable node, Uri uri) { 271 Future<Script> readScript(Uri uri, [Spannable spannable]) {
272 SourceFile sourceFile = sourceFiles[uri.toString()]; 272 SourceFile sourceFile = sourceFiles[uri.toString()];
273 if (sourceFile == null) throw new ArgumentError(uri); 273 if (sourceFile == null) throw new ArgumentError(uri);
274 return new Future.value(new Script(uri, uri, sourceFile)); 274 return new Future.value(new Script(uri, uri, sourceFile));
275 } 275 }
276 276
277 Element lookupElementIn(ScopeContainerElement container, name) { 277 Element lookupElementIn(ScopeContainerElement container, name) {
278 Element element = container.localLookup(name); 278 Element element = container.localLookup(name);
279 return element != null 279 return element != null
280 ? element 280 ? element
281 : new ErroneousElementX(null, null, name, container); 281 : new ErroneousElementX(null, null, name, container);
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 trustTypeAnnotations: trustTypeAnnotations, 371 trustTypeAnnotations: trustTypeAnnotations,
372 enableTypeAssertions: enableTypeAssertions, 372 enableTypeAssertions: enableTypeAssertions,
373 enableUserAssertions: enableUserAssertions, 373 enableUserAssertions: enableUserAssertions,
374 expectedErrors: expectedErrors, 374 expectedErrors: expectedErrors,
375 expectedWarnings: expectedWarnings, 375 expectedWarnings: expectedWarnings,
376 outputProvider: outputProvider); 376 outputProvider: outputProvider);
377 compiler.registerSource(uri, code); 377 compiler.registerSource(uri, code);
378 compiler.diagnosticHandler = createHandler(compiler, code); 378 compiler.diagnosticHandler = createHandler(compiler, code);
379 return compiler; 379 return compiler;
380 } 380 }
OLDNEW
« pkg/compiler/lib/src/library_loader.dart ('K') | « pkg/compiler/lib/src/serialization/task.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698