From a282468b060298727844213e8a0ab47d376fb9fd Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Fri, 8 Apr 2016 14:36:43 -0700 Subject: [PATCH] Only emit rest param code for identifiers. Destructuring of array binding and object binding patterns is not supported yet. --- src/compiler/transformers/es6.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/transformers/es6.ts b/src/compiler/transformers/es6.ts index f93c69b8d69..a60eddb0bf5 100644 --- a/src/compiler/transformers/es6.ts +++ b/src/compiler/transformers/es6.ts @@ -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; } } -} \ No newline at end of file +}