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

Unified Diff: pkg/analysis_server/lib/src/services/correction/fix_internal.dart

Issue 1040733002: Test that the target node is a SimpleIdentifier. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/correction/fix_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/services/correction/fix_internal.dart
diff --git a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
index 0ff70e6780fa60b6437482d7759b815884533100..64fb1d6d92e4f0ae02c78c61ad5a4f7454740fc4 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
@@ -675,6 +675,9 @@ class FixProcessor {
}
void _addFix_createField() {
+ if (node is! SimpleIdentifier) {
+ return;
+ }
SimpleIdentifier nameNode = node;
String name = nameNode.name;
// prepare target Expression
@@ -802,6 +805,9 @@ class FixProcessor {
}
void _addFix_createGetter() {
+ if (node is! SimpleIdentifier) {
+ return;
+ }
SimpleIdentifier nameNode = node;
String name = nameNode.name;
if (!nameNode.inGetterContext()) {
@@ -902,6 +908,9 @@ class FixProcessor {
}
void _addFix_createLocalVariable() {
+ if (node is! SimpleIdentifier) {
+ return;
+ }
SimpleIdentifier nameNode = node;
String name = nameNode.name;
// if variable is assigned, convert assignment into declaration
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/correction/fix_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698