Remove unnecessary restriction on variable names.

This commit is contained in:
Neil Fraser
2017-10-30 21:35:48 -07:00
committed by Neil Fraser
parent 905d542ae5
commit 63637a927a
30 changed files with 1 additions and 43 deletions

View File

@@ -247,12 +247,6 @@ Blockly.Variables.createVariable = function(workspace, opt_callback, opt_type) {
function() {
promptAndCheckWithAlert(text); // Recurse
});
} else if (Blockly.Procedures.isNameUsed(text, workspace)) {
Blockly.alert(Blockly.Msg.PROCEDURE_ALREADY_EXISTS.replace('%1',
text.toLowerCase()),
function() {
promptAndCheckWithAlert(text); // Recurse
});
} else {
workspace.createVariable(text, opt_type);
if (opt_callback) {
@@ -294,12 +288,6 @@ Blockly.Variables.renameVariable = function(workspace, variable,
function() {
promptAndCheckWithAlert(newName); // Recurse
});
} else if (Blockly.Procedures.isNameUsed(newName, workspace)) {
Blockly.alert(Blockly.Msg.PROCEDURE_ALREADY_EXISTS.replace('%1',
newName.toLowerCase()),
function() {
promptAndCheckWithAlert(newName); // Recurse
});
} else {
workspace.renameVariable(variable.name, newName);
if (opt_callback) {