You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This looks to be an issue with Esprima: last release for it was 4.0.1 (2 years ago), and it seems like it is not keeping up with the new standards: jquery/esprima#1949
In that Esprima issue, another project switched away from Esprima to espree. I just tried dropping in espree into r.js, but some of the r.js tests fail (4 failing tests), so it is not a drop in replacement. I don't have time to look more into it now. So for now the workaround is to avoid object spread in the source code.
Looking at Esprima, it seems that the master branch is being updated fairly regularly (but no releases, as you mentioned).
I've tried pulling in a build from the master branch (along with a couple pending PRs related to ES2019 syntaxes), and adding to build/jslib/esprima.js
This seems to work fine (one test fails, but it also fails with the current r.js... It seems to be an outdated test file..?).
This would add support for:
Optional chaining
Optional catch
Nullish coalescing
for await...of (async iterators)
If you like, I can open a PR for this change?
Reacted by chrswk, Oscar Klein Heerenbrink, GongYI and Jenda
I would love to see an update to the latest Esprima master. Is there something I can help with directly, or something I can "encourage" through a bounty?
Looking at Esprima, it seems that the master branch is being updated fairly regularly (but no releases, as you mentioned).
I've tried pulling in a build from the master branch (along with a couple pending PRs related to ES2019 syntaxes), and adding to build/jslib/esprima.js
This seems to work fine (one test fails, but it also fails with the current r.js... It seems to be an outdated test file..?).
This would add support for:
Optional chaining
Optional catch
Nullish coalescing
for await...of (async iterators)
If you like, I can open a PR for this change?
Do you mind creating a PR with all your changes? I only got started with fixing the test case, but you have already done the work integrating Esprima master.
Activity
jrburke commentedon Feb 2, 2020
This looks to be an issue with Esprima: last release for it was 4.0.1 (2 years ago), and it seems like it is not keeping up with the new standards: jquery/esprima#1949
In that Esprima issue, another project switched away from Esprima to espree. I just tried dropping in espree into r.js, but some of the r.js tests fail (4 failing tests), so it is not a drop in replacement. I don't have time to look more into it now. So for now the workaround is to avoid object spread in the source code.
restarian commentedon Feb 12, 2020
As a follow up, is there an easy way to pass in espima options with the config or cli? Maybe a {tolerant: true} option.
jrburke commentedon Feb 12, 2020
Looking back in the code, there currently is not a way to provide options to pass to Esprima.
ejdaly commentedon Mar 3, 2021
Looking at Esprima, it seems that the master branch is being updated fairly regularly (but no releases, as you mentioned).
I've tried pulling in a build from the master branch (along with a couple pending PRs related to ES2019 syntaxes), and adding to build/jslib/esprima.js
This seems to work fine (one test fails, but it also fails with the current r.js... It seems to be an outdated test file..?).
This would add support for:
If you like, I can open a PR for this change?
chrswk commentedon Apr 4, 2021
I would love to see an update to the latest Esprima master. Is there something I can help with directly, or something I can "encourage" through a bounty?
chrswk commentedon Apr 10, 2021
Do you mind creating a PR with all your changes? I only got started with fixing the test case, but you have already done the work integrating Esprima master.
ejdaly commentedon May 18, 2021
@chrswk - apologies, I hadn't seen the reply. I'll take a look at opening a PR here when I get a chance.
I did the upgrade of Esprima-to-master in my fork if you want to check that out: https://github.com/ejdaly/r.js
(I seem to have made 2 small commits after that, so you may / may not want those commits...)
ejdaly commentedon May 18, 2021
Aside: there may be some momentum starting to get a new Esprima release, which would be fantastic...
jquery/esprima#2078
chrswk commentedon May 24, 2021
@ejdaly No worries. I've been using your version/fork for a couple of weeks now, so thanks again for your efforts!
abhijithsreenivas commentedon Oct 11, 2021
Still optional chaining is failing r.js, web-packing. When this will get resolved?
theloveofcode commentedon Jan 21, 2022
This causes problems with a lot of new JS functionality like optional chaining, spread, etc. I recommend requirejs upgrade to espira-next
prantlf commentedon Apr 23, 2023
The parser bundled to r.js is too old. You'll need to upgrade it. See #998.