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

Unified Diff: pkg/analyzer/lib/src/analyzer_impl.dart

Issue 688593005: Convert analysis starting point to an absolute path before analyzing. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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/analyzer/lib/src/analyzer_impl.dart
diff --git a/pkg/analyzer/lib/src/analyzer_impl.dart b/pkg/analyzer/lib/src/analyzer_impl.dart
index 40df537b7e29d2f9913865118c5d4bfec387fd18..25bac6ec833330acd646510f10e4c2a464036a81 100644
--- a/pkg/analyzer/lib/src/analyzer_impl.dart
+++ b/pkg/analyzer/lib/src/analyzer_impl.dart
@@ -68,7 +68,8 @@ class AnalyzerImpl {
final HashMap<Source, AnalysisErrorInfo> sourceErrorsMap =
new HashMap<Source, AnalysisErrorInfo>();
- AnalyzerImpl(this.sourcePath, this.options, this.startTime) {
+ AnalyzerImpl(String sourcePath, this.options, this.startTime)
+ : sourcePath = _normalizeSourcePath(sourcePath) {
if (sdk == null) {
sdk = new DirectoryBasedDartSdk(new JavaFile(options.dartSdkPath));
}
@@ -112,6 +113,13 @@ class AnalyzerImpl {
prepareAnalysisContext(sourceFile, librarySource);
}
+ /**
+ * Convert [sourcePath] into an absolute path.
+ */
+ static String _normalizeSourcePath(String sourcePath) {
+ return new File(sourcePath).absolute.path;
+ }
+
/// The sync version of analysis.
ErrorSeverity _analyzeSync(int printMode) {
// don't try to analyze parts
« 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