@@ -90,13 +90,13 @@ pp.checkPropClash = function(prop, propHash, refDestructuringErrors) {
90
90
// and object pattern might appear (so it's possible to raise
91
91
// delayed syntax error at correct position).
92
92
93
- pp . parseExpression = function ( noIn , refDestructuringErrors ) {
93
+ pp . parseExpression = function ( forInit , refDestructuringErrors ) {
94
94
let startPos = this . start , startLoc = this . startLoc
95
- let expr = this . parseMaybeAssign ( noIn , refDestructuringErrors )
95
+ let expr = this . parseMaybeAssign ( forInit , refDestructuringErrors )
96
96
if ( this . type === tt . comma ) {
97
97
let node = this . startNodeAt ( startPos , startLoc )
98
98
node . expressions = [ expr ]
99
- while ( this . eat ( tt . comma ) ) node . expressions . push ( this . parseMaybeAssign ( noIn , refDestructuringErrors ) )
99
+ while ( this . eat ( tt . comma ) ) node . expressions . push ( this . parseMaybeAssign ( forInit , refDestructuringErrors ) )
100
100
return this . finishNode ( node , "SequenceExpression" )
101
101
}
102
102
return expr
@@ -105,9 +105,9 @@ pp.parseExpression = function(noIn, refDestructuringErrors) {
105
105
// Parse an assignment expression. This includes applications of
106
106
// operators like `+=`.
107
107
108
- pp . parseMaybeAssign = function ( noIn , refDestructuringErrors , afterLeftParse ) {
108
+ pp . parseMaybeAssign = function ( forInit , refDestructuringErrors , afterLeftParse ) {
109
109
if ( this . isContextual ( "yield" ) ) {
110
- if ( this . inGenerator ) return this . parseYield ( noIn )
110
+ if ( this . inGenerator ) return this . parseYield ( forInit )
111
111
// The tokenizer will assume an expression is allowed after
112
112
// `yield`, but this isn't that kind of yield
113
113
else this . exprAllowed = false
@@ -126,7 +126,7 @@ pp.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) {
126
126
let startPos = this . start , startLoc = this . startLoc
127
127
if ( this . type === tt . parenL || this . type === tt . name )
128
128
this . potentialArrowAt = this . start
129
- let left = this . parseMaybeConditional ( noIn , refDestructuringErrors )
129
+ let left = this . parseMaybeConditional ( forInit , refDestructuringErrors )
130
130
if ( afterLeftParse ) left = afterLeftParse . call ( this , left , startPos , startLoc )
131
131
if ( this . type . isAssign ) {
132
132
let node = this . startNodeAt ( startPos , startLoc )
@@ -144,7 +144,7 @@ pp.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) {
144
144
this . checkLValSimple ( left )
145
145
node . left = left
146
146
this . next ( )
147
- node . right = this . parseMaybeAssign ( noIn )
147
+ node . right = this . parseMaybeAssign ( forInit )
148
148
return this . finishNode ( node , "AssignmentExpression" )
149
149
} else {
150
150
if ( ownDestructuringErrors ) this . checkExpressionErrors ( refDestructuringErrors , true )
@@ -156,28 +156,28 @@ pp.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) {
156
156
157
157
// Parse a ternary conditional (`?:`) operator.
158
158
159
- pp . parseMaybeConditional = function ( noIn , refDestructuringErrors ) {
159
+ pp . parseMaybeConditional = function ( forInit , refDestructuringErrors ) {
160
160
let startPos = this . start , startLoc = this . startLoc
161
- let expr = this . parseExprOps ( noIn , refDestructuringErrors )
161
+ let expr = this . parseExprOps ( forInit , refDestructuringErrors )
162
162
if ( this . checkExpressionErrors ( refDestructuringErrors ) ) return expr
163
163
if ( this . eat ( tt . question ) ) {
164
164
let node = this . startNodeAt ( startPos , startLoc )
165
165
node . test = expr
166
166
node . consequent = this . parseMaybeAssign ( )
167
167
this . expect ( tt . colon )
168
- node . alternate = this . parseMaybeAssign ( noIn )
168
+ node . alternate = this . parseMaybeAssign ( forInit )
169
169
return this . finishNode ( node , "ConditionalExpression" )
170
170
}
171
171
return expr
172
172
}
173
173
174
174
// Start the precedence parser.
175
175
176
- pp . parseExprOps = function ( noIn , refDestructuringErrors ) {
176
+ pp . parseExprOps = function ( forInit , refDestructuringErrors ) {
177
177
let startPos = this . start , startLoc = this . startLoc
178
178
let expr = this . parseMaybeUnary ( refDestructuringErrors , false )
179
179
if ( this . checkExpressionErrors ( refDestructuringErrors ) ) return expr
180
- return expr . start === startPos && expr . type === "ArrowFunctionExpression" ? expr : this . parseExprOp ( expr , startPos , startLoc , - 1 , noIn )
180
+ return expr . start === startPos && expr . type === "ArrowFunctionExpression" ? expr : this . parseExprOp ( expr , startPos , startLoc , - 1 , forInit )
181
181
}
182
182
183
183
// Parse binary operators with the operator precedence parsing
@@ -186,9 +186,9 @@ pp.parseExprOps = function(noIn, refDestructuringErrors) {
186
186
// defer further parser to one of its callers when it encounters an
187
187
// operator that has a lower precedence than the set it is parsing.
188
188
189
- pp . parseExprOp = function ( left , leftStartPos , leftStartLoc , minPrec , noIn ) {
189
+ pp . parseExprOp = function ( left , leftStartPos , leftStartLoc , minPrec , forInit ) {
190
190
let prec = this . type . binop
191
- if ( prec != null && ( ! noIn || this . type !== tt . _in ) ) {
191
+ if ( prec != null && ( ! forInit || this . type !== tt . _in ) ) {
192
192
if ( prec > minPrec ) {
193
193
let logical = this . type === tt . logicalOR || this . type === tt . logicalAND
194
194
let coalesce = this . type === tt . coalesce
@@ -200,12 +200,12 @@ pp.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) {
200
200
let op = this . value
201
201
this . next ( )
202
202
let startPos = this . start , startLoc = this . startLoc
203
- let right = this . parseExprOp ( this . parseMaybeUnary ( null , false ) , startPos , startLoc , prec , noIn )
203
+ let right = this . parseExprOp ( this . parseMaybeUnary ( null , false ) , startPos , startLoc , prec , forInit )
204
204
let node = this . buildBinary ( leftStartPos , leftStartLoc , left , right , op , logical || coalesce )
205
205
if ( ( logical && this . type === tt . coalesce ) || ( coalesce && ( this . type === tt . logicalOR || this . type === tt . logicalAND ) ) ) {
206
206
this . raiseRecoverable ( this . start , "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses" )
207
207
}
208
- return this . parseExprOp ( node , leftStartPos , leftStartLoc , minPrec , noIn )
208
+ return this . parseExprOp ( node , leftStartPos , leftStartLoc , minPrec , forInit )
209
209
}
210
210
}
211
211
return left
@@ -1051,7 +1051,7 @@ pp.parsePrivateIdent = function() {
1051
1051
1052
1052
// Parses yield expression inside generator.
1053
1053
1054
- pp . parseYield = function ( noIn ) {
1054
+ pp . parseYield = function ( forInit ) {
1055
1055
if ( ! this . yieldPos ) this . yieldPos = this . start
1056
1056
1057
1057
let node = this . startNode ( )
@@ -1061,7 +1061,7 @@ pp.parseYield = function(noIn) {
1061
1061
node . argument = null
1062
1062
} else {
1063
1063
node . delegate = this . eat ( tt . star )
1064
- node . argument = this . parseMaybeAssign ( noIn )
1064
+ node . argument = this . parseMaybeAssign ( forInit )
1065
1065
}
1066
1066
return this . finishNode ( node , "YieldExpression" )
1067
1067
}
0 commit comments