@@ -580,9 +580,10 @@ Parser.prototype.walkExportNamedDeclaration = function walkExportNamedDeclaratio
580580 var pos = this . scope . definitions . length ;
581581 this . walkStatement ( statement . declaration ) ;
582582 var newDefs = this . scope . definitions . slice ( pos ) ;
583- newDefs . reverse ( ) . forEach ( function ( def , idx ) {
584- this . applyPluginsBailResult ( "export specifier" , statement , def , def , idx ) ;
585- } , this ) ;
583+ for ( var index = newDefs . length - 1 ; index >= 0 ; index -- ) {
584+ var def = newDefs [ index ] ;
585+ this . applyPluginsBailResult ( "export specifier" , statement , def , def , index ) ;
586+ }
586587 }
587588 }
588589 }
@@ -608,9 +609,10 @@ Parser.prototype.walkExportDefaultDeclaration = function walkExportDefaultDeclar
608609 var pos = this . scope . definitions . length ;
609610 this . walkStatement ( statement . declaration ) ;
610611 var newDefs = this . scope . definitions . slice ( pos ) ;
611- newDefs . forEach ( function ( def ) {
612+ for ( var index = 0 ; index <= newDefs . length - 1 ; index ++ ) {
613+ var def = newDefs [ index ] ;
612614 this . applyPluginsBailResult ( "export specifier" , statement , def , "default" ) ;
613- } , this ) ;
615+ }
614616 }
615617 } else {
616618 this . walkExpression ( statement . declaration ) ;
@@ -638,11 +640,14 @@ Parser.prototype.walkClassDeclaration = function walkClassDeclaration(statement)
638640} ;
639641
640642Parser . prototype . walkSwitchCases = function walkSwitchCases ( switchCases ) {
641- switchCases . forEach ( function ( switchCase ) {
642- if ( switchCase . test )
643+ for ( var index = 0 ; index <= switchCases . length - 1 ; index ++ ) {
644+ var switchCase = switchCases [ index ] ;
645+
646+ if ( switchCase . test ) {
643647 this . walkExpression ( switchCase . test ) ;
648+ }
644649 this . walkStatements ( switchCase . consequent ) ;
645- } , this ) ;
650+ }
646651} ;
647652
648653Parser . prototype . walkCatchClause = function walkCatchClause ( catchClause ) {
0 commit comments