@@ -85,12 +85,12 @@ class PreferConstWalker extends Lint.RuleWalker {
85
85
86
86
visitBinaryExpression ( node : ts . BinaryExpression ) {
87
87
if ( isAssignmentOperator ( node . operatorToken . kind ) ) {
88
- this . visitLHSExpressions ( node . left ) ;
88
+ this . visitLeftHandSideExpression ( node . left ) ;
89
89
}
90
90
super . visitBinaryExpression ( node ) ;
91
91
}
92
92
93
- private visitLHSExpressions ( node : ts . Expression ) {
93
+ private visitLeftHandSideExpression ( node : ts . Expression ) {
94
94
while ( node . kind === ts . SyntaxKind . ParenthesizedExpression ) {
95
95
node = ( node as ts . ParenthesizedExpression ) . expression ;
96
96
}
@@ -112,7 +112,7 @@ class PreferConstWalker extends Lint.RuleWalker {
112
112
this . markAssignment ( ( element as ts . ShorthandPropertyAssignment ) . name ) ;
113
113
}
114
114
else if ( kind === ts . SyntaxKind . PropertyAssignment ) {
115
- this . visitLHSExpressions ( ( element as ts . PropertyAssignment ) . initializer ) ;
115
+ this . visitLeftHandSideExpression ( ( element as ts . PropertyAssignment ) . initializer ) ;
116
116
}
117
117
else {
118
118
// Should we throw an exception?
@@ -122,7 +122,7 @@ class PreferConstWalker extends Lint.RuleWalker {
122
122
else if ( node . kind === ts . SyntaxKind . ArrayLiteralExpression ) {
123
123
const pattern = node as ts . ArrayLiteralExpression ;
124
124
for ( const element of pattern . elements ) {
125
- this . visitLHSExpressions ( element ) ;
125
+ this . visitLeftHandSideExpression ( element ) ;
126
126
}
127
127
}
128
128
}
@@ -150,7 +150,7 @@ class PreferConstWalker extends Lint.RuleWalker {
150
150
151
151
private visitAnyUnaryExpression ( node : ts . PrefixUnaryExpression | ts . PostfixUnaryExpression ) {
152
152
if ( node . operator === ts . SyntaxKind . PlusPlusToken || node . operator === ts . SyntaxKind . MinusMinusToken ) {
153
- this . visitLHSExpressions ( node . operand ) ;
153
+ this . visitLeftHandSideExpression ( node . operand ) ;
154
154
}
155
155
}
156
156
@@ -216,12 +216,12 @@ class PreferConstWalker extends Lint.RuleWalker {
216
216
}
217
217
}
218
218
219
- private collectNameIdentifiers ( value : ts . VariableDeclaration , node : ts . Identifier | ts . BindingPattern , table : ts . Map < DeclarationUsages > ) {
219
+ private collectNameIdentifiers ( declaration : ts . VariableDeclaration , node : ts . Identifier | ts . BindingPattern , table : ts . Map < DeclarationUsages > ) {
220
220
if ( node . kind === ts . SyntaxKind . Identifier ) {
221
- table [ ( node as ts . Identifier ) . text ] = { declaration : value , usages : 0 } ;
221
+ table [ ( node as ts . Identifier ) . text ] = { declaration , usages : 0 } ;
222
222
}
223
223
else {
224
- this . collectBindingPatternIdentifiers ( value , node as ts . BindingPattern , table ) ;
224
+ this . collectBindingPatternIdentifiers ( declaration , node as ts . BindingPattern , table ) ;
225
225
}
226
226
}
227
227
0 commit comments