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

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

Issue 1529173004: - Fix usage of Platform.packageRoot. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 dart2js.test.memory_compiler; 5 library dart2js.test.memory_compiler;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:compiler/compiler.dart' show 9 import 'package:compiler/compiler.dart' show
10 DiagnosticHandler; 10 DiagnosticHandler;
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 List<String> options: const <String>[], 108 List<String> options: const <String>[],
109 CompilerImpl cachedCompiler, 109 CompilerImpl cachedCompiler,
110 bool showDiagnostics: true, 110 bool showDiagnostics: true,
111 Uri packageRoot, 111 Uri packageRoot,
112 Uri packageConfig, 112 Uri packageConfig,
113 PackagesDiscoveryProvider packagesDiscoveryProvider}) { 113 PackagesDiscoveryProvider packagesDiscoveryProvider}) {
114 Uri libraryRoot = Uri.base.resolve('sdk/'); 114 Uri libraryRoot = Uri.base.resolve('sdk/');
115 if (packageRoot == null && 115 if (packageRoot == null &&
116 packageConfig == null && 116 packageConfig == null &&
117 packagesDiscoveryProvider == null) { 117 packagesDiscoveryProvider == null) {
118 packageRoot = Uri.base.resolveUri(new Uri.file('${Platform.packageRoot}/')); 118 packageRoot = Uri.base.resolveUri(Uri.parse(Platform.packageRoot));
119 } 119 }
120 120
121 MemorySourceFileProvider provider; 121 MemorySourceFileProvider provider;
122 if (cachedCompiler == null) { 122 if (cachedCompiler == null) {
123 provider = new MemorySourceFileProvider(memorySourceFiles); 123 provider = new MemorySourceFileProvider(memorySourceFiles);
124 // Saving the provider in case we need it later for a cached compiler. 124 // Saving the provider in case we need it later for a cached compiler.
125 expando[provider] = provider; 125 expando[provider] = provider;
126 } else { 126 } else {
127 // When using a cached compiler, it has read a number of files from disk 127 // When using a cached compiler, it has read a number of files from disk
128 // already (and will not attempt to read them again due to caching). These 128 // already (and will not attempt to read them again due to caching). These
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 createDiagnosticHandler(diagnosticHandler, provider, showDiagnostics); 273 createDiagnosticHandler(diagnosticHandler, provider, showDiagnostics);
274 274
275 List<Uri> libraries = <Uri>[]; 275 List<Uri> libraries = <Uri>[];
276 memorySourceFiles.forEach((String path, _) { 276 memorySourceFiles.forEach((String path, _) {
277 libraries.add(new Uri(scheme: 'memory', path: path)); 277 libraries.add(new Uri(scheme: 'memory', path: path));
278 }); 278 });
279 279
280 return analyze(libraries, libraryRoot, packageRoot, 280 return analyze(libraries, libraryRoot, packageRoot,
281 provider, handler, options); 281 provider, handler, options);
282 } 282 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698