Merge pull request #7976 from Microsoft/transforms-skip-destructured-rest-params

Only emit rest param code for identifiers.
This commit is contained in:
Nathan Shively-Sanders 2016-04-08 15:29:00 -07:00
commit 61fffb3ef4

View File

@ -931,7 +931,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;
}
/**
@ -2753,4 +2753,4 @@ namespace ts {
return isIdentifier(expression) && expression === parameter.name;
}
}
}
}