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:
Beka Westberg
2022-03-21 15:38:23 -07:00
committed by GitHub
parent 7abf3de910
commit c4308007bc
3 changed files with 27 additions and 20 deletions

View File

@@ -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);