-
Notifications
You must be signed in to change notification settings - Fork 671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ES6 Spread syntax not work #971
Comments
The latest release of r.js (2.3.5) includes the latest esprima (4.0) to parse JS files, so I expect that parsing the file for combining into bundles work, but the uglifyjs that is in r.js is still the 2.x version, which cannot handle ES2015+ language features like spread and rest. If that is the case here, pass There are enough ES2015+ minifier options now besides uglify, and a better way for build processes to use them compared to when r.js was released where it makes less sense now to bundle a minifier in r.js. Closing as a discussion ticket, but feel free to continue discussion here. |
Hi @jrburke We have some trouble with parsing ES2017 code by r.js. The new minor release of esprima 4.0.1 fixed it. |
Issue #991 tracks the update for 2.3.6. Latest master snapshot is linked in that issue if you need an updated version now. Want to try to address a couple of other things before putting out 2.3.6. |
I seem to be having this same issue. I've updated my Esprima dependency to 4.0.1 as mentioned above. But it doesn't seem to have fixed the issue with requirejs and it keeps complaining about |
Although valid ES6 code, Esprima |
jquery/esprima#2034 seems to be resolved now looking at comments of jamby93 and 0x00C5 |
Spread syntax allows an iterable such as an array expression or string to be expanded in places where zero or more arguments (for function calls) or elements (for array literals) are expected, or an object expression to be expanded in places where zero or more key-value pairs (for object literals) are expected.
`
let cold = ['autumn', 'winter'];
let warm = ['spring', 'summer'];
cold.push(...warm); `
The text was updated successfully, but these errors were encountered: