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

Unified Diff: pkg/analyzer_experimental/lib/src/services/formatter_impl.dart

Issue 24488004: Implement correct scoping rules for variables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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
Index: pkg/analyzer_experimental/lib/src/services/formatter_impl.dart
diff --git a/pkg/analyzer_experimental/lib/src/services/formatter_impl.dart b/pkg/analyzer_experimental/lib/src/services/formatter_impl.dart
index 032d5e768e71e413d00e22ee0f81e1879106d3fb..aeb1ba4fca76f7f57b4ea605a0c241917360fe2e 100644
--- a/pkg/analyzer_experimental/lib/src/services/formatter_impl.dart
+++ b/pkg/analyzer_experimental/lib/src/services/formatter_impl.dart
@@ -1294,11 +1294,11 @@ class SourceVisitor implements ASTVisitor {
var lines = max(min, countNewlinesBetween(previousToken, currentToken));
writer.newlines(lines);
- var previousToken = currentToken.previous;
+ var newPreviousToken = currentToken.previous;
while (comment != null) {
- emitComment(comment, previousToken);
+ emitComment(comment, newPreviousToken);
var nextToken = comment.next != null ? comment.next : token;
var newlines = calculateNewlinesBetweenComments(comment, nextToken);
@@ -1309,11 +1309,11 @@ class SourceVisitor implements ASTVisitor {
space();
}
- previousToken = comment;
+ newPreviousToken = comment;
comment = comment.next;
}
- previousToken = token;
karlklose 2013/09/26 07:05:43 @pquitslund: This looks like a bug.
ngeoffray 2013/09/26 07:48:38 Why did you have to fix it? Isn't it OK to shadow
pquitslund 2013/09/30 16:12:48 Hmmm, I agree this doesn't look right. I have ano
pquitslund 2013/09/30 17:23:34 And here's that fix: https://codereview.chromium.o
+ newPreviousToken = token;
return lines;
}

Powered by Google App Engine
This is Rietveld 408576698