mirror of
https://github.com/google/blockly.git
synced 2026-01-08 09:30:06 +01:00
Remove unnecessary restriction on variable names.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user