babel-plugin-transform-spread add missing argument in build calls (#13459)
* babel-plugin-transform-spread add missing argument in build calls * update tests for babel 8 test
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
f(...[1, 2, 3]);
|
||||
f(...[1, , 3]);
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"BABEL_8_BREAKING": false
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
f.apply(void 0, [1, 2, 3]);
|
||||
f.apply(void 0, babelHelpers.arrayWithoutHoles([1,, 3]));
|
||||
@@ -1 +1,2 @@
|
||||
f(...[1, 2, 3]);
|
||||
f(...[1, , 3]);
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"BABEL_8_BREAKING": true
|
||||
}
|
||||
@@ -1 +1,2 @@
|
||||
f.apply(void 0, [1, 2, 3]);
|
||||
f.apply(void 0, babelHelpers.arrayLikeToArray([1,, 3]));
|
||||
|
||||
3
packages/babel-plugin-transform-spread/test/fixtures/spread/new-expression-babel-7/input.js
vendored
Normal file
3
packages/babel-plugin-transform-spread/test/fixtures/spread/new-expression-babel-7/input.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
new Numbers(...nums);
|
||||
new Numbers(1, ...nums);
|
||||
new Numbers(...[1, , 3]);
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"BABEL_8_BREAKING": false
|
||||
}
|
||||
3
packages/babel-plugin-transform-spread/test/fixtures/spread/new-expression-babel-7/output.js
vendored
Normal file
3
packages/babel-plugin-transform-spread/test/fixtures/spread/new-expression-babel-7/output.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
babelHelpers.construct(Numbers, babelHelpers.toConsumableArray(nums));
|
||||
babelHelpers.construct(Numbers, [1].concat(babelHelpers.toConsumableArray(nums)));
|
||||
babelHelpers.construct(Numbers, babelHelpers.arrayWithoutHoles([1,, 3]));
|
||||
@@ -1,2 +1,3 @@
|
||||
new Numbers(...nums);
|
||||
new Numbers(1, ...nums);
|
||||
new Numbers(...[1, , 3]);
|
||||
|
||||
3
packages/babel-plugin-transform-spread/test/fixtures/spread/new-expression/options.json
vendored
Normal file
3
packages/babel-plugin-transform-spread/test/fixtures/spread/new-expression/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"BABEL_8_BREAKING": true
|
||||
}
|
||||
@@ -1,2 +1,3 @@
|
||||
babelHelpers.construct(Numbers, babelHelpers.toConsumableArray(nums));
|
||||
babelHelpers.construct(Numbers, [1].concat(babelHelpers.toConsumableArray(nums)));
|
||||
babelHelpers.construct(Numbers, babelHelpers.arrayLikeToArray([1,, 3]));
|
||||
|
||||
Reference in New Issue
Block a user