💻
How are you using Babel?
Other (Next.js, Gatsby, vue-cli, ...)
Input code
const x = [0, void 0];
let [a, ..._rest] = x;
console.log({ a, _rest });
console.log(Array.isArray(_rest)); // true
Configuration file name
No response
Configuration
env target safari 10-13
Current and expected behavior
The output code remains unchanged, but Safari 10-13 does not fully support rest in array literals, so the result does not match the expected behavior.
In Safari 10-13, the code outputs false, but according to the ES spec, it should output true.
Environment
All Babel versions
Safari 10-13
Possible solution
The transform-destructuring feature in packages/babel-compat-data/data/plugins.json needs to be updated to mark Safari and iOS support as version 14 or higher (since Safari 13 still doesn't fully support it).
Additional context
💻
How are you using Babel?
Other (Next.js, Gatsby, vue-cli, ...)
Input code
Configuration file name
No response
Configuration
env target safari 10-13
Current and expected behavior
The output code remains unchanged, but Safari 10-13 does not fully support rest in array literals, so the result does not match the expected behavior.
In Safari 10-13, the code outputs
false, but according to the ES spec, it should outputtrue.Environment
All Babel versions
Safari 10-13
Possible solution
The
transform-destructuringfeature inpackages/babel-compat-data/data/plugins.jsonneeds to be updated to mark Safari and iOS support as version 14 or higher (since Safari 13 still doesn't fully support it).Additional context