TS: fix extraction of binding pattern with default

This commit is contained in:
Asger F
2018-12-11 17:36:22 +00:00
parent 9707b34124
commit aa04e9c77f
4 changed files with 12 additions and 1 deletions

View File

@@ -1612,7 +1612,7 @@ public class TypeScriptASTConverter {
if (hasChild(element, "dotDotDotToken")) {
propVal = new RestElement(eltLoc, propKey);
} else if (hasChild(element, "initializer")) {
propVal = new AssignmentPattern(eltLoc, "=", propKey, convertChild(element, "initializer"));
propVal = new AssignmentPattern(eltLoc, "=", convertChild(element, "name"), convertChild(element, "initializer"));
} else {
propVal = convertChild(element, "name");
}