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

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

Issue 1290903002: dart2js: don't add a trailing slash when reading --packages (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/dart2js.dart
diff --git a/pkg/compiler/lib/src/dart2js.dart b/pkg/compiler/lib/src/dart2js.dart
index 72c40abe80c553f6d041ec29957063eda479a12a..a2f98b7b551aae6ffe08786be5d4299a079204cd 100644
--- a/pkg/compiler/lib/src/dart2js.dart
+++ b/pkg/compiler/lib/src/dart2js.dart
@@ -66,9 +66,9 @@ String extractParameter(String argument, {bool isOptionalArgument: false}) {
return m[2];
}
-String extractPath(String argument) {
+String extractPath(String argument, {bool isDirectory: true}) {
String path = nativeToUriPath(extractParameter(argument));
- return path.endsWith("/") ? path : "$path/";
+ return !path.endsWith("/") && isDirectory ? "$path/" : path;
}
void parseCommandLine(List<OptionHandler> handlers, List<String> argv) {
@@ -143,7 +143,8 @@ Future<api.CompilationResult> compile(List<String> argv) {
}
setPackageConfig(String argument) {
- packageConfig = currentDirectory.resolve(extractPath(argument));
+ packageConfig =
+ currentDirectory.resolve(extractPath(argument, isDirectory: false));
}
setOutput(Iterator<String> arguments) {
« 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