Small code cleanup.

This commit is contained in:
Karishma Chadha 2017-12-21 16:23:03 -05:00
parent 7a305032d6
commit 3c53fbd2b5

View file

@ -307,7 +307,7 @@ Blockly.Variables.promptName = function(promptText, defaultText, callback, opt_t
* @return {string} The validated and possibly transformed name of the variable.
*/
Blockly.Variables.validateName_ = function(name, opt_type) {
if (!opt_type || !opt_type == Blockly.BROADCAST_MESSAGE_VARIABLE_TYPE) {
if (!opt_type || opt_type != Blockly.BROADCAST_MESSAGE_VARIABLE_TYPE) {
name = name.replace(/[\s\xa0]+/g, ' ').replace(/^ | $/g, '');
if (name == Blockly.Msg.RENAME_VARIABLE ||
name == Blockly.Msg.NEW_VARIABLE) {