mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-06-26 06:10:26 -04:00
Fix variable conflicts that arise when sharing the love of a sprite-local variable with the stage.
This commit is contained in:
parent
c69a59575d
commit
406e59fc18
2 changed files with 64 additions and 2 deletions
src/engine
|
@ -693,12 +693,15 @@ class Blocks {
|
|||
/**
|
||||
* Returns a map of all references to variables or lists from blocks
|
||||
* in this block container.
|
||||
* @param {Array<object>} optBlocks Optional list of blocks to constrain the search to.
|
||||
* This is useful for getting variable/list references for a stack of blocks instead
|
||||
* of all blocks on the workspace
|
||||
* @return {object} A map of variable ID to a list of all variable references
|
||||
* for that ID. A variable reference contains the field referencing that variable
|
||||
* and also the type of the variable being referenced.
|
||||
*/
|
||||
getAllVariableAndListReferences () {
|
||||
const blocks = this._blocks;
|
||||
getAllVariableAndListReferences (optBlocks) {
|
||||
const blocks = optBlocks ? optBlocks : this._blocks;
|
||||
const allReferences = Object.create(null);
|
||||
for (const blockId in blocks) {
|
||||
let varOrListField = null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue