diff --git a/src/engine/blocks.js b/src/engine/blocks.js index 189a595be03..28995a7f407 100644 --- a/src/engine/blocks.js +++ b/src/engine/blocks.js @@ -845,7 +845,7 @@ class Blocks { getAllVariableAndListReferences (optBlocks, optIncludeBroadcast) { const blocks = optBlocks ? optBlocks : this._blocks; const allReferences = Object.create(null); - for (const blockId in blocks) { + for (const blockId of Object.keys(blocks)) { let varOrListField = null; let varType = null; if (blocks[blockId].fields.VARIABLE) { diff --git a/src/engine/target.js b/src/engine/target.js index c8bd5094fa5..6ed5747b561 100644 --- a/src/engine/target.js +++ b/src/engine/target.js @@ -747,8 +747,7 @@ class Target extends EventEmitter { } // Rename any local variables that were missed above because they aren't // referenced by any blocks - for (const id in unreferencedLocalVarIds) { - const varId = unreferencedLocalVarIds[id]; + for (const varId of unreferencedLocalVarIds) { const name = this.variables[varId].name; const type = this.variables[varId].type; renameConflictingLocalVar(varId, name, type);