acquit icon indicating copy to clipboard operation
acquit copied to clipboard

Latest version (1.1.0) fails to parse the JS Spread syntax

Open rob4629 opened this issue 5 years ago • 2 comments

(Opening as a separate issue, from #22 , for ease of tracking)

The latest version fails when trying to parse tests (it blocks) which use the JS "spread" operator/syntax

const obj = {
  name: "My Object"
};

it("should parse spread syntax", async () => {
  const newObj = { key: { ...obj, newKey: "newValue" } };
  // TEST CODE
});
Error: Line 165: Unexpected token ...

If I comment out the lines which contain "...", then it'll parse the full test file.

rob4629 avatar Aug 19 '20 23:08 rob4629

It looks like ESprima is to blame, so I've raised a bug with them.

rob4629 avatar Sep 02 '20 22:09 rob4629

The workaround for now, is to revert to using .concat() instead of ....

rob4629 avatar Sep 02 '20 22:09 rob4629