Retain name and propertyName in declaration emit copies of binding patterns if property name is a keyword (#50537)

* Retain name and propertyName in declaration emit copies of binding patterns if property name is a keyword

* Accept baselines

* Remove out of date file
This commit is contained in:
Wesley Wigham
2022-08-30 09:03:02 -07:00
committed by GitHub
parent 8b482b513d
commit 488d0eebd0
7 changed files with 209 additions and 8 deletions

View File

@@ -6122,7 +6122,7 @@ namespace ts {
}
let visited = visitEachChild(node, elideInitializerAndPropertyRenamingAndSetEmitFlags, nullTransformationContext, /*nodesVisitor*/ undefined, elideInitializerAndPropertyRenamingAndSetEmitFlags)!;
if (isBindingElement(visited)) {
if (visited.propertyName && isIdentifier(visited.propertyName) && isIdentifier(visited.name)) {
if (visited.propertyName && isIdentifier(visited.propertyName) && isIdentifier(visited.name) && !isStringAKeyword(idText(visited.propertyName))) {
visited = factory.updateBindingElement(
visited,
visited.dotDotDotToken,