* Correctly transform spreads to use proper concat method * Add tests to ensure array spread clones elements
12 lines
170 B
JavaScript
12 lines
170 B
JavaScript
const arr = [];
|
|
|
|
arr.concat = () => {
|
|
throw new Error('Should not be called');
|
|
};
|
|
let x;
|
|
expect(() => {
|
|
x = [...arr];
|
|
}).not.toThrow();
|
|
|
|
expect(x).not.toBe(arr);
|