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

Issue 2162523003: Use the new StaticWarningCode.UNDEFINED_IDENTIFIER_AWAIT error. (Closed)

Created:
4 years, 5 months ago by scheglov
Modified:
4 years, 5 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

Use the new StaticWarningCode.UNDEFINED_IDENTIFIER_AWAIT error. ...instead of StaticWarningCode.UNDEFINED_IDENTIFIER R=brianwilkerson@google.com BUG= Committed: https://github.com/dart-lang/sdk/commit/55fcc035720a40ed2bda726eb9ecad78fd6fb08f

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+48 lines, -48 lines) Patch
M pkg/analysis_server/lib/src/services/correction/fix_internal.dart View 2 chunks +17 lines, -19 lines 4 comments Download
M pkg/analysis_server/test/services/correction/fix_test.dart View 5 chunks +30 lines, -28 lines 0 comments Download
M pkg/analyzer/lib/src/generated/error.dart View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 8 (1 generated)
scheglov
4 years, 5 months ago (2016-07-18 17:24:15 UTC) #1
Brian Wilkerson
lgtm https://codereview.chromium.org/2162523003/diff/1/pkg/analysis_server/lib/src/services/correction/fix_internal.dart File pkg/analysis_server/lib/src/services/correction/fix_internal.dart (right): https://codereview.chromium.org/2162523003/diff/1/pkg/analysis_server/lib/src/services/correction/fix_internal.dart#newcode296 pkg/analysis_server/lib/src/services/correction/fix_internal.dart:296: _addFix_addAsync(); Shouldn't the fixes for UNDEFINED_IDENTIFIER also be ...
4 years, 5 months ago (2016-07-18 17:39:40 UTC) #2
scheglov
https://codereview.chromium.org/2162523003/diff/1/pkg/analysis_server/lib/src/services/correction/fix_internal.dart File pkg/analysis_server/lib/src/services/correction/fix_internal.dart (right): https://codereview.chromium.org/2162523003/diff/1/pkg/analysis_server/lib/src/services/correction/fix_internal.dart#newcode296 pkg/analysis_server/lib/src/services/correction/fix_internal.dart:296: _addFix_addAsync(); On 2016/07/18 17:39:40, Brian Wilkerson wrote: > Shouldn't ...
4 years, 5 months ago (2016-07-18 17:47:43 UTC) #3
scheglov
Committed patchset #1 (id:1) manually as 55fcc035720a40ed2bda726eb9ecad78fd6fb08f (presubmit successful).
4 years, 5 months ago (2016-07-18 17:49:01 UTC) #5
Brian Wilkerson
https://codereview.chromium.org/2162523003/diff/1/pkg/analysis_server/lib/src/services/correction/fix_internal.dart File pkg/analysis_server/lib/src/services/correction/fix_internal.dart (right): https://codereview.chromium.org/2162523003/diff/1/pkg/analysis_server/lib/src/services/correction/fix_internal.dart#newcode296 pkg/analysis_server/lib/src/services/correction/fix_internal.dart:296: _addFix_addAsync(); > ... only UNDEFINED_IDENTIFIER_AWAIT is reported for undefined ...
4 years, 5 months ago (2016-07-18 17:56:21 UTC) #6
srawlins
On 2016/07/18 17:39:40, Brian Wilkerson wrote: > lgtm > > https://codereview.chromium.org/2162523003/diff/1/pkg/analysis_server/lib/src/services/correction/fix_internal.dart > File pkg/analysis_server/lib/src/services/correction/fix_internal.dart (right): ...
4 years, 5 months ago (2016-07-18 18:00:37 UTC) #7
scheglov
4 years, 5 months ago (2016-07-18 18:10:11 UTC) #8
Message was sent while issue was closed.
https://codereview.chromium.org/2162523003/diff/1/pkg/analysis_server/lib/src...
File pkg/analysis_server/lib/src/services/correction/fix_internal.dart (right):

https://codereview.chromium.org/2162523003/diff/1/pkg/analysis_server/lib/src...
pkg/analysis_server/lib/src/services/correction/fix_internal.dart:296:
_addFix_addAsync();
On 2016/07/18 17:56:20, Brian Wilkerson wrote:
> > ... only UNDEFINED_IDENTIFIER_AWAIT is reported for undefined "await"
> identifiers.
> 
> Exactly. But given that 'await' is a valid name for an identifier in some
> contexts it seems like the same options we provide for any other identifier
> ought to be available for it. They used to be, and now they're not. Sounds
like
> a regression.

You are right, it is possible to use "await" in some contexts as a normal
identifier.
But I don't think it's a regression.
The old code ran other fixes only if _addFix_addAsync() returned false.
And it returned false only if _isAwaitNode() returns false or we're outside of a
function body.
_isAwaitNode() is equivalent to the code added now in ElementResolver - just
checking the identifier name for "await".

Powered by Google App Engine
This is Rietveld 408576698