Refactor to fix issue with global var not checking for name conflicts on all sprites.

This commit is contained in:
Karishma Chadha 2018-07-03 23:20:49 -04:00
parent 92dfebdae6
commit ed608ffe6f
3 changed files with 35 additions and 16 deletions
src/engine

View file

@ -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.