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

Issue 1309543011: Add support for assert statements with messages to the analyzer.

Created:
5 years, 3 months ago by Paul Berry
Modified:
5 years, 3 months ago
Reviewers:
Brian Wilkerson
CC:
reviews_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Add support for assert statements with messages to the analyzer. Support is disabled by default.

Patch Set 1 #

Total comments: 16

Patch Set 2 : Address review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2072 lines, -876 lines) Patch
M pkg/analyzer/lib/src/context/context.dart View 1 2 chunks +2 lines, -0 lines 0 comments Download
M pkg/analyzer/lib/src/generated/ast.dart View 1 93 chunks +935 lines, -432 lines 0 comments Download
M pkg/analyzer/lib/src/generated/engine.dart View 1 8 chunks +19 lines, -2 lines 0 comments Download
M pkg/analyzer/lib/src/generated/error.dart View 1 7 chunks +29 lines, -7 lines 0 comments Download
M pkg/analyzer/lib/src/generated/error_verifier.dart View 1 76 chunks +252 lines, -144 lines 0 comments Download
M pkg/analyzer/lib/src/generated/html.dart View 1 4 chunks +37 lines, -15 lines 0 comments Download
M pkg/analyzer/lib/src/generated/incremental_resolution_validator.dart View 1 1 chunk +1 line, -0 lines 0 comments Download
M pkg/analyzer/lib/src/generated/incremental_resolver.dart View 1 1 chunk +2 lines, -1 line 0 comments Download
M pkg/analyzer/lib/src/generated/parser.dart View 1 115 chunks +618 lines, -259 lines 0 comments Download
M pkg/analyzer/lib/src/generated/testing/ast_factory.dart View 1 1 chunk +5 lines, -2 lines 0 comments Download
M pkg/analyzer/lib/src/task/dart.dart View 1 1 chunk +2 lines, -1 line 0 comments Download
M pkg/analyzer/test/generated/ast_test.dart View 1 1 chunk +7 lines, -0 lines 0 comments Download
M pkg/analyzer/test/generated/compile_time_error_code_test.dart View 1 1 chunk +13 lines, -0 lines 0 comments Download
M pkg/analyzer/test/generated/non_error_resolver_test.dart View 1 chunk +64 lines, -0 lines 0 comments Download
M pkg/analyzer/test/generated/parser_test.dart View 1 3 chunks +41 lines, -11 lines 0 comments Download
M pkg/analyzer/test/generated/static_type_warning_code_test.dart View 1 chunk +36 lines, -0 lines 0 comments Download
M pkg/analyzer/test/generated/utilities_test.dart View 1 2 chunks +9 lines, -2 lines 0 comments Download

Messages

Total messages: 8 (1 generated)
Paul Berry
Note: since the spec and VM changes to support this feature are still under review ...
5 years, 3 months ago (2015-09-02 15:10:19 UTC) #2
Brian Wilkerson
It would be good to have some parser tests. https://codereview.chromium.org/1309543011/diff/1/pkg/analyzer/lib/src/generated/ast.dart File pkg/analyzer/lib/src/generated/ast.dart (right): https://codereview.chromium.org/1309543011/diff/1/pkg/analyzer/lib/src/generated/ast.dart#newcode686 pkg/analyzer/lib/src/generated/ast.dart:686: ...
5 years, 3 months ago (2015-09-02 15:49:16 UTC) #3
Paul Berry
https://codereview.chromium.org/1309543011/diff/1/pkg/analyzer/lib/src/generated/ast.dart File pkg/analyzer/lib/src/generated/ast.dart (right): https://codereview.chromium.org/1309543011/diff/1/pkg/analyzer/lib/src/generated/ast.dart#newcode686 pkg/analyzer/lib/src/generated/ast.dart:686: {this.comma, Expression message}) { On 2015/09/02 15:49:15, Brian Wilkerson ...
5 years, 3 months ago (2015-09-02 17:20:04 UTC) #4
Brian Wilkerson
https://codereview.chromium.org/1309543011/diff/1/pkg/analyzer/lib/src/generated/ast.dart File pkg/analyzer/lib/src/generated/ast.dart (right): https://codereview.chromium.org/1309543011/diff/1/pkg/analyzer/lib/src/generated/ast.dart#newcode686 pkg/analyzer/lib/src/generated/ast.dart:686: {this.comma, Expression message}) { I wish I could answer ...
5 years, 3 months ago (2015-09-02 17:35:26 UTC) #5
Paul Berry
On 2015/09/02 17:35:26, Brian Wilkerson wrote: > https://codereview.chromium.org/1309543011/diff/1/pkg/analyzer/lib/src/generated/ast.dart > File pkg/analyzer/lib/src/generated/ast.dart (right): > > https://codereview.chromium.org/1309543011/diff/1/pkg/analyzer/lib/src/generated/ast.dart#newcode686 ...
5 years, 3 months ago (2015-09-02 17:44:20 UTC) #6
Paul Berry
PTAL https://codereview.chromium.org/1309543011/diff/1/pkg/analyzer/lib/src/generated/ast.dart File pkg/analyzer/lib/src/generated/ast.dart (right): https://codereview.chromium.org/1309543011/diff/1/pkg/analyzer/lib/src/generated/ast.dart#newcode686 pkg/analyzer/lib/src/generated/ast.dart:686: {this.comma, Expression message}) { On 2015/09/02 17:35:26, Brian ...
5 years, 3 months ago (2015-09-07 19:44:30 UTC) #7
Brian Wilkerson
5 years, 3 months ago (2015-09-07 21:01:49 UTC) #8
> ... as a backwards compatible change, make a new API
> (possibly with an ugly name) and deprecate the old one.  Then, at a later date
> when enough backwards compatible changes have accumulated, make a single
> backwards-breaking change that deletes the deprecated API and renames the new
> one to the old name.

While I understand the value of their suggestion, I'm still not convinced that
this is a good idea in the case of syntactic changes. All of the missed code
changes that I caught in the last review would have been caught by the compiler
if the constructor had been changed to have additional required parameters. (I
can't help but wonder what additional missed changes I didn't catch that the
compiler could have.)

I think we might be doing our clients a disservice, trading off an explicit
breaking change for an implicit breaking change that's harder to detect. For
example, the formatter needs to be updated, but by not making this a breaking
change there won't even be a hint that something significant changed. While it's
true that most clients could roll forward without compilation errors (even the
breaking change to the constructor would only affect clients that are creating
AST nodes, of which there are probably few), at least they'd have some
indication that there was a breaking change that might affect them.

With reservations, then, I'll give it a LGTM.

Powered by Google App Engine
This is Rietveld 408576698