mirror of
https://github.com/google/blockly.git
synced 2026-01-07 17:10:11 +01:00
fix: always rename caller to legal name (#6014)
* fix: always rename caller to legal name * fix: enable tests for non-matching callers which overlap names getting renamed * fix: remove TODOs
This commit is contained in:
@@ -968,11 +968,10 @@ const PROCEDURE_CALL_COMMON = {
|
||||
block.appendChild(mutation);
|
||||
const field = xmlUtils.createElement('field');
|
||||
field.setAttribute('name', 'NAME');
|
||||
let callName = this.getProcedureCall();
|
||||
if (!callName) {
|
||||
// Rename if name is empty string.
|
||||
callName = Procedures.findLegalName('', this);
|
||||
this.renameProcedure('', callName);
|
||||
const callName = this.getProcedureCall();
|
||||
const newName = Procedures.findLegalName(callName, this);
|
||||
if (callName !== newName) {
|
||||
this.renameProcedure(callName, newName);
|
||||
}
|
||||
field.appendChild(xmlUtils.createTextNode(callName));
|
||||
block.appendChild(field);
|
||||
|
||||
Reference in New Issue
Block a user