Only emit rest param code for identifiers.

Destructuring of array binding and object binding patterns is not supported yet.
This commit is contained in:
Nathan Shively-Sanders 2016-04-08 14:36:43 -07:00
parent f61e122f9b
commit a282468b06

View File

@ -924,7 +924,7 @@ namespace ts {
* synthesized call to `super`
*/
function shouldAddRestParameter(node: ParameterDeclaration, inConstructorWithSynthesizedSuper: boolean) {
return node && node.dotDotDotToken && !inConstructorWithSynthesizedSuper;
return node && node.dotDotDotToken && node.name.kind === SyntaxKind.Identifier && !inConstructorWithSynthesizedSuper;
}
/**
@ -2746,4 +2746,4 @@ namespace ts {
return isIdentifier(expression) && expression === parameter.name;
}
}
}
}