Skip to content

Commit 10cbbac

Browse files
committedFeb 26, 2016
Fixed length variable issue
1 parent 50e6fa2 commit 10cbbac

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎src/astring.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,8 @@ let traveler = {
309309
this[ node.discriminant.type ]( node.discriminant, state )
310310
code.push( ') \{', lineEnd )
311311
const { cases: occurences } = node
312-
const { length } = occurences
313-
for ( let i = 0; i < length; i++ ) {
312+
const { length: occurencesCount } = occurences
313+
for ( let i = 0; i < occurencesCount; i++ ) {
314314
let occurence = occurences[ i ]
315315
if ( writeComments && occurence.comments != null )
316316
formatComments( occurence.comments, code, caseIndent, lineEnd )
@@ -322,8 +322,8 @@ let traveler = {
322322
code.push( caseIndent, 'default:', lineEnd )
323323
}
324324
let { consequent } = occurence
325-
const { length } = consequent
326-
for ( let i = 0; i < length; i++ ) {
325+
const { length: consequentCount } = consequent
326+
for ( let i = 0; i < consequentCount; i++ ) {
327327
let statement = consequent[ i ]
328328
if ( writeComments && statement.comments != null )
329329
formatComments( statement.comments, code, statementIndent, lineEnd )

0 commit comments

Comments
 (0)