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

Issue 2186343003: Enforce a blank line after local function declarations. (Closed)

Created:
4 years, 4 months ago by Bob Nystrom
Modified:
4 years, 4 months ago
Reviewers:
nweiz
CC:
reviews_dartlang.org
Base URL:
https://github.com/dart-lang/dart_style.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Patch Set 1 #

Total comments: 4

Patch Set 2 : Revise. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+149 lines, -74 lines) Patch
M CHANGELOG.md View 1 1 chunk +1 line, -0 lines 0 comments Download
M lib/src/source_visitor.dart View 1 6 chunks +95 lines, -74 lines 0 comments Download
A test/regression/0400/0488.stmt View 1 chunk +13 lines, -0 lines 0 comments Download
M test/whitespace/blocks.stmt View 1 chunk +40 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (2 generated)
Bob Nystrom
4 years, 4 months ago (2016-07-28 20:07:51 UTC) #2
nweiz
lgtm https://codereview.chromium.org/2186343003/diff/1/lib/src/source_visitor.dart File lib/src/source_visitor.dart (left): https://codereview.chromium.org/2186343003/diff/1/lib/src/source_visitor.dart#oldcode2164 lib/src/source_visitor.dart:2164: void _writeBody(Token leftBracket, Token rightBracket, Why not keep ...
4 years, 4 months ago (2016-07-28 21:00:45 UTC) #3
nweiz
Oh also: should this get a changelog entry?
4 years, 4 months ago (2016-07-28 21:01:44 UTC) #4
Bob Nystrom
On 2016/07/28 21:01:44, nweiz wrote: > Oh also: should this get a changelog entry? Yes, ...
4 years, 4 months ago (2016-07-28 21:26:31 UTC) #5
Bob Nystrom
Committed patchset #2 (id:20001) manually as 8b5aa7e9d090def190d4ae44a21c9d689928935f (presubmit successful).
4 years, 4 months ago (2016-07-28 21:27:37 UTC) #7
Bob Nystrom
4 years, 4 months ago (2016-07-28 21:27:51 UTC) #8
Message was sent while issue was closed.
https://codereview.chromium.org/2186343003/diff/1/lib/src/source_visitor.dart
File lib/src/source_visitor.dart (left):

https://codereview.chromium.org/2186343003/diff/1/lib/src/source_visitor.dart...
lib/src/source_visitor.dart:2164: void _writeBody(Token leftBracket, Token
rightBracket,
On 2016/07/28 21:00:45, nweiz wrote:
> Why not keep `_writeBody` and just define it in terms of [_beginBody] and
> [_endBody]?

I could, but it's only used in like two other places so it doesn't really
justify having a helper for it. Also, in one of the places, I found the big
nested function literal actually harder to read.

https://codereview.chromium.org/2186343003/diff/1/lib/src/source_visitor.dart
File lib/src/source_visitor.dart (right):

https://codereview.chromium.org/2186343003/diff/1/lib/src/source_visitor.dart...
lib/src/source_visitor.dart:279: var body =
statement.functionDeclaration.functionExpression.body as BlockFunctionBody;
On 2016/07/28 21:00:45, nweiz wrote:
> Long lines.

Done.

> If you assign `body` outside the inner if statement, you can avoid the cast
here
> since the `is` check will propagate.

Done.

Powered by Google App Engine
This is Rietveld 408576698