mirror of
https://github.com/google/blockly.git
synced 2026-01-07 00:50:27 +01:00
Get rid of workspace.deleteVariable
This commit is contained in:
@@ -467,12 +467,13 @@ Blockly.Blocks['procedures_mutatorarg'] = {
|
||||
if (source && source.workspace && source.workspace.options &&
|
||||
source.workspace.options.parentWorkspace) {
|
||||
var workspace = source.workspace.options.parentWorkspace;
|
||||
var variable = workspace.getVariable(newText);
|
||||
var variableType = '';
|
||||
var variable = workspace.getVariable(newText, variableType);
|
||||
// If there is a case change, rename the variable.
|
||||
if (variable && variable.name !== newText) {
|
||||
workspace.renameVariableById(variable.getId(), newText);
|
||||
} else {
|
||||
workspace.createVariable(newText);
|
||||
workspace.createVariable(newText, variableType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user