mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-08-01 17:11:21 -04:00
Refactor to fix issue with global var not checking for name conflicts on all sprites.
This commit is contained in:
parent
92dfebdae6
commit
ed608ffe6f
3 changed files with 35 additions and 16 deletions
src/engine
|
@ -1715,6 +1715,15 @@ class Runtime extends EventEmitter {
|
|||
return this._editingTarget;
|
||||
}
|
||||
|
||||
getAllVarNamesOfType (varType) {
|
||||
let varNames = [];
|
||||
for (const target of this.targets) {
|
||||
const targetVarNames = target.getAllVariableNamesInScopeByType(varType, true);
|
||||
varNames = varNames.concat(targetVarNames);
|
||||
}
|
||||
return varNames;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tell the runtime to request a redraw.
|
||||
* Use after a clone/sprite has completed some visible operation on the stage.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue