File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1290,18 +1290,18 @@ Blockly.Blocks['control_exitLoop'] = {
12901290 // recursively climb tree until we reach a forever loop block
12911291 let parent = this . getParent ( ) ;
12921292 while ( parent !== null ) {
1293- if ( parent && parent . type === "control_forever" ) {
1293+ if ( parent . type === "control_forever" ) {
12941294 // a smart way to check if we are a child is by checking our position
12951295 // child blocks are not aligned on the x axis
12961296 var childPos = this . getRelativeToSurfaceXY ( ) ;
12971297 var parentPos = parent . getRelativeToSurfaceXY ( ) ;
1298- if ( Math . round ( childPos . x ) !== Math . round ( parentPos . x ) ) callback ( parent ) ;
1299- return ;
1298+ if ( Math . round ( childPos . x ) !== Math . round ( parentPos . x ) ) {
1299+ callback ( parent ) ;
1300+ return ;
1301+ }
13001302 }
13011303
1302- var nextParent = parent . getParent ( ) ;
1303- if ( nextParent ) parent = nextParent ;
1304- else break ;
1304+ parent = parent . getParent ( ) ;
13051305 }
13061306 } ,
13071307 updateForeverMutation : function ( oldMutation , foreverBlock ) {
You can’t perform that action at this time.
0 commit comments