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

Unified Diff: lib/src/compiler/compiler.dart

Issue 1886393003: add command test, fix relative paths (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/command/hello.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/compiler/compiler.dart
diff --git a/lib/src/compiler/compiler.dart b/lib/src/compiler/compiler.dart
index 86009d52dfc97ea2403591f842d583e85ad726ea..41a05f72b3927b949dfcf08176856255bc536018 100644
--- a/lib/src/compiler/compiler.dart
+++ b/lib/src/compiler/compiler.dart
@@ -53,11 +53,11 @@ class ModuleCompiler {
var errors = <AnalysisError>[];
for (var sourcePath in unit.sources) {
- String sourceUri = sourcePath;
- if (path.isAbsolute(sourcePath)) {
- sourceUri = path.toUri(sourcePath).toString();
+ var sourceUri = Uri.parse(sourcePath);
+ if (sourceUri.scheme == '') {
+ sourceUri = path.toUri(path.absolute(sourcePath));
}
- Source source = context.sourceFactory.forUri(sourceUri);
+ Source source = context.sourceFactory.forUri(sourceUri.toString());
if (source == null) {
throw new AnalysisException('could not create a source for $sourcePath.'
' The file name is in the wrong format or was not found.');
« no previous file with comments | « no previous file | test/command/hello.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698