esprima icon indicating copy to clipboard operation
esprima copied to clipboard

syntax error by rest parameter of spread syntax

Open misogihagi opened this issue 3 years ago • 4 comments

hello sorry if my misleading, my code is not parsed by esprima

Steps to reproduce

copy and paste below to demo

var ops={
    a:1,
    b:2
}

function fn(ops){
    console.log(ops)
}

fn({...ops})

Actual output

Error: Line 10: Unexpected token ...

misogihagi avatar Apr 11 '22 07:04 misogihagi

you can try my fork esprima-next, there this works https://github.com/node-projects/esprima-next

jogibear9988 avatar May 05 '22 21:05 jogibear9988

@jogibear9988 Have you figured out a way to replace esprima with your package when nested dependencies rely on esprima? For instance, Terser requires esprima through nested dependencies. I've covered the problem more here.

theloveofcode avatar Jun 09 '22 00:06 theloveofcode

no, never tried. I've never faced this issue. But as development seem to have stopped here completely maybe some of the packages would decide to switch to my fork

jogibear9988 avatar Jun 09 '22 18:06 jogibear9988

maybe raise an issue at the other packages

jogibear9988 avatar Jun 09 '22 18:06 jogibear9988