mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-08-28 22:30:40 -04:00
Merge pull request #1347 from kchadha/fix-var-rename-delete
Fix local var rename/delete
This commit is contained in:
commit
0776845a94
1 changed files with 2 additions and 2 deletions
|
@ -354,7 +354,7 @@ class Blocks {
|
|||
}
|
||||
break;
|
||||
case 'var_rename':
|
||||
if (editingTarget && editingTarget.hasOwnProperty(e.varId)) {
|
||||
if (editingTarget && editingTarget.variables.hasOwnProperty(e.varId)) {
|
||||
// This is a local variable, rename on the current target
|
||||
editingTarget.renameVariable(e.varId, e.newName);
|
||||
// Update all the blocks on the current target that use
|
||||
|
@ -372,7 +372,7 @@ class Blocks {
|
|||
}
|
||||
break;
|
||||
case 'var_delete': {
|
||||
const target = (editingTarget && editingTarget.hasOwnProperty(e.varId)) ?
|
||||
const target = (editingTarget && editingTarget.variables.hasOwnProperty(e.varId)) ?
|
||||
editingTarget : stage;
|
||||
target.deleteVariable(e.varId);
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue