From 5f50d11bf795dae76ef24eeeef1499a50e874ec8 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Thu, 13 Dec 2018 23:24:43 -0800 Subject: [PATCH] Correctly transform spreads to use proper concat method (#9108) * Correctly transform spreads to use proper concat method * Add tests to ensure array spread clones elements --- test/fixtures/destructuring/array-unpack-optimisation/output.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/fixtures/destructuring/array-unpack-optimisation/output.js b/test/fixtures/destructuring/array-unpack-optimisation/output.js index 7743f54e7c6a..32816cdc73c4 100644 --- a/test/fixtures/destructuring/array-unpack-optimisation/output.js +++ b/test/fixtures/destructuring/array-unpack-optimisation/output.js @@ -21,7 +21,7 @@ var _ref4 = [a[1], a[0]]; a[0] = _ref4[0]; a[1] = _ref4[1]; -var _ref5 = babelHelpers.toConsumableArray(foo).concat([bar]), +var _ref5 = [].concat(babelHelpers.toConsumableArray(foo), [bar]), a = _ref5[0], b = _ref5[1];