1+ %
12// Copyright (c) 2014-19 Walter Bender
23//
34// This program is free software; you can redistribute it and/or
@@ -1540,8 +1541,8 @@ function Blocks(activity) {
15401541 * need to check to see if we need to rename it.
15411542 * (7) Is it the name of a storein block? In which case we
15421543 * need to check to see if we need to add a palette entry.
1543- * (8) Is it a case or default block? We need to make sure that
1544- * they are inside a switch block.
1544+ * (8) Is it a case or default block? We need to make sure that
1545+ * they are inside a switch block.
15451546 * (9) And we need to recheck if it inside of a expandable block.
15461547 */
15471548 var initialTopBlock = this . findTopBlock ( thisBlock ) ;
@@ -6793,12 +6794,14 @@ function Blocks(activity) {
67936794 this . _cleanupStacks = function ( ) {
67946795 // Sort the blocks from inside to outside.
67956796 let blocksToCheck = [ ] ;
6796- for ( let b = 0 ; b < this . _checkArgClampBlocks . length ; b ++ ) {
6797- blocksToCheck . push ( [ b , this . _getNestingDepth ( b ) , '1arg' ] ) ;
6797+ for ( let b = 0 ; b < this . _checkArgClampBlocks . length ; b ++ ) {
6798+ let bb = this . _checkArgClampBlocks [ b ] ;
6799+ blocksToCheck . push ( [ bb , this . _getNestingDepth ( bb ) , '1arg' ] ) ;
67986800 }
67996801
68006802 for ( let b = 0 ; b < this . _checkTwoArgBlocks . length ; b ++ ) {
6801- blocksToCheck . push ( [ b , this . _getNestingDepth ( b ) , '2arg' ] ) ;
6803+ let bb = this . _checkTwoArgBlocks [ b ] ;
6804+ blocksToCheck . push ( [ bb , this . _getNestingDepth ( bb ) , '2arg' ] ) ;
68026805 }
68036806
68046807 blocksToCheck = blocksToCheck . sort ( function ( a , b ) {
@@ -6811,7 +6814,7 @@ function Blocks(activity) {
68116814 if ( blocksToCheck [ i ] [ 2 ] === '1arg' ) {
68126815 this . _adjustArgClampBlock ( [ blocksToCheck [ i ] [ 0 ] ] ) ;
68136816 } else {
6814- // this._adjustExpandableTwoArgBlock([blocksToCheck[i][0]]);
6817+ this . _adjustExpandableTwoArgBlock ( [ blocksToCheck [ i ] [ 0 ] ] ) ;
68156818 }
68166819 }
68176820
0 commit comments