File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
babel-plugin-transform-block-scoping/src Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -518,7 +518,7 @@ class BlockScoping {
518518 // remap loop heads with colliding variables
519519 if ( this . loop ) {
520520 // nb: clone outsideRefs keys since the map is modified within the loop
521- for ( const name of [ ... outsideRefs . keys ( ) ] ) {
521+ for ( const name of Array . from ( outsideRefs . keys ( ) ) ) {
522522 const id = outsideRefs . get ( name ) ;
523523
524524 if (
Original file line number Diff line number Diff line change 210210 } ) ,
211211 ) .not . toThrow ( ) ;
212212 } ) ;
213+ it ( "#11897 - [...map.keys()] in Babel source should be transformed correctly" , ( ) => {
214+ expect ( ( ) =>
215+ Babel . transform ( "for (let el of []) { s => el }" , {
216+ plugins : [ "transform-block-scoping" ] ,
217+ } ) ,
218+ ) . not . toThrow ( ) ;
219+ } ) ;
213220 } ) ;
214221 } ,
215222) ;
You can’t perform that action at this time.
0 commit comments