From fddacb1612e6e60d056a258dc3feb35c65dffafd Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Fri, 9 Jan 2015 21:18:51 +1100 Subject: [PATCH] don't assign array expressions to a temp variable in destructuring #431 --- lib/6to5/transformation/transformers/es6-destructuring.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/6to5/transformation/transformers/es6-destructuring.js b/lib/6to5/transformation/transformers/es6-destructuring.js index 675fa483f9..e92e3194a5 100644 --- a/lib/6to5/transformation/transformers/es6-destructuring.js +++ b/lib/6to5/transformation/transformers/es6-destructuring.js @@ -134,7 +134,7 @@ var pushPattern = function (opts) { var file = opts.file; var scope = opts.scope; - if (!t.isMemberExpression(parentId) && !t.isIdentifier(parentId)) { + if (!t.isArrayExpression(parentId) && !t.isMemberExpression(parentId) && !t.isIdentifier(parentId)) { var key = scope.generateUidBasedOnNode(parentId, file); nodes.push(t.variableDeclaration("var", [