From 7b02728ff22e9091c30ac8ba152341e5ba68a48c Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Mon, 8 Jul 2019 10:48:42 -0700 Subject: [PATCH] Cleaned up unamed handling w/ safename. --- core/names.js | 2 +- core/procedures.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/names.js b/core/names.js index b76978b62..09096d9ed 100644 --- a/core/names.js +++ b/core/names.js @@ -172,7 +172,7 @@ Blockly.Names.prototype.getDistinctName = function(name, type) { */ Blockly.Names.prototype.safeName_ = function(name) { if (!name) { - name = 'unnamed'; + name = Blockly.Msg['UNNAMED_KEY'] || 'unnamed'; } else { // Unfortunately names in non-latin characters will look like // _E9_9F_B3_E4_B9_90 which is pretty meaningless. diff --git a/core/procedures.js b/core/procedures.js index 60b29f36b..e60deeb05 100644 --- a/core/procedures.js +++ b/core/procedures.js @@ -103,7 +103,7 @@ Blockly.Procedures.findLegalName = function(name, block) { // Flyouts can have multiple procedures called 'do something'. return name; } - name = name || Blockly.Msg['UNNAMED_KEY']; + name = name || Blockly.Msg['UNNAMED_KEY'] || 'unnamed'; while (!Blockly.Procedures.isLegalName_(name, block.workspace, block)) { // Collision with another procedure. var r = name.match(/^(.*?)(\d+)$/);