jquery / esprima

ECMAScript parsing infrastructure for multipurpose analysis
http://esprima.org
BSD 2-Clause "Simplified" License
7.04k stars 786 forks source link

syntax error by rest parameter of spread syntax #2113

Open misogihagi opened 2 years ago

misogihagi commented 2 years ago

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 ...

jogibear9988 commented 2 years ago

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

theloveofcode commented 2 years ago

@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.

jogibear9988 commented 2 years ago

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 commented 2 years ago

maybe raise an issue at the other packages