mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-06-29 15:50:22 -04:00
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:
parent
122443a75f
commit
ede9bb3a54
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue