Chromium Code Reviews| 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; |
| } |