use Object.keys instead of for ... in, because with Opal.

If added some methods to Array.prototype, failed
Blocks.getAllVariableAndListReferences. Because it use for ... in.
This commit is contained in:
Kouji Takao 2018-12-03 18:11:38 +09:00
parent 122443a75f
commit ede9bb3a54

View file

@ -799,7 +799,7 @@ class Blocks {
getAllVariableAndListReferences (optBlocks) {
const blocks = optBlocks ? optBlocks : this._blocks;
const allReferences = Object.create(null);
for (const blockId in blocks) {
Object.keys(blocks).forEach(blockId => {
let varOrListField = null;
let varType = null;
if (blocks[blockId].fields.VARIABLE) {
@ -823,7 +823,7 @@ class Blocks {
}];
}
}
}
});
return allReferences;
}