Bug Report
Current Behavior
If we spread an array with hole ([1,, 2] of new Array(3), for example), the code generated from Babel don't convert the holes to undefined.
Input Code
Using babel, this code
generates this:
[1].concat([2,, 3]) // returns [1, 4, (empty), 3]
Expected behavior/code
[1, ...[2,, 3]] // should returns [1, 2, undefined, 3]
Babel Configuration (.babelrc, package.json, cli command)
{
plugins: ["@babel/plugin-transform-spread"]
}
Environment
- Babel version(s): lasted version from git
- Node/npm version: Node v9, NPM 5.6.0
- OS: macOS High Sierra
- Monorepo: yep
- How you are using Babel: CLI
Additional context/Screenshots
I found this bug when I'm doing this PR for fix a similar bug: #8872
This PR isn't fix this another bug.
Bug Report
Current Behavior
If we spread an array with hole (
[1,, 2]ofnew Array(3), for example), the code generated from Babel don't convert the holes toundefined.Input Code
Using babel, this code
generates this:
Expected behavior/code
Babel Configuration (.babelrc, package.json, cli command)
Environment
Additional context/Screenshots
I found this bug when I'm doing this PR for fix a similar bug: #8872
This PR isn't fix this another bug.