Comments (13)
There is interest in supporting all of ES6, if the ecmaVersion
option is set to 6
. A patch that starts adding part of such support would be welcome. When parsing ES5, these keywords should remain errors.
from acorn.
+1 things like yield and let would be great
from acorn.
const
has been available in v8/node.js for a while also. In the interim I'm preprocessing with varify.
from acorn.
+1 for supporting ES6 import
from acorn.
Duplicating https://twitter.com/RReverser/status/491714922724986881:
@marijnh Hi, is there a list of ES6 features unsupported in Acorn yet? I'm feeling pretty comfortable with it's code and willing to help.
from acorn.
It seems the only supported feature so far is the spread operator.
If you're doing any work in this direction, make sure you stay compatible with what Esprima is doing (in terms of AST data structure).
from acorn.
Sure. Are you aware of any human-readable list of accepted ES6 features (maybe with specifications) then?
from acorn.
Asking because MDN Parser API page seems not to match Esprima's output. /cc @ariya
from acorn.
from acorn.
@mozfreddyb Thanks, but there is mixed draft APIs and syntax from user's perspective, not from parsing+AST specs.
from acorn.
For those interested, my WIP working fork with ES6 support is available here:
Working features:
- Unicode Code Point Escape Sequences (
\u{ABCDEF}
). - Numeric Literals (octal, binary).
- Arrow Functions.
- Spread Element.
- Classes.
- Destructuring assignments.
- Computed object properties.
- Object methods.
- Shorthand object properties.
for (... of ...)
loops.- Array Comprehensions.
- Modules.
- Template Strings.
- Generators.
from acorn.
@marijnh Should we close this now or would it better stay open for tracking new upcoming features?
from acorn.
I think it's fine to close it. We can open new tickets when new features come up.
from acorn.
Related Issues (20)
- [acorn] Missing `value` property in `Token` (TypeScript) HOT 3
- Only fans.com
- Unsupported platform for [email protected] HOT 1
- Import Attributes
- Feature Request: ES2025 RegExp Duplicate named capturing groups HOT 6
- Acorn rejects call expression on the lhs of assignment. HOT 8
- [acorn-walk] Type error when using VariableDeclarator with walk.simple HOT 1
- Property and AssignmentProperty have the same type HOT 1
- Peer dependency on acorn for acorn-walk types HOT 4
- Open
- Broken expression is parsed without errors HOT 2
- विश्व
- [Regression] Does not work in older Node HOT 2
- Jim Morrison Jr
- Jim Morrison Jr HOT 2
- Jim Morrison Jr
- support for capturing comments - line/block? HOT 5
- return outside of function error ignores `allowReturnOutsideFunction` HOT 1
- Uncaught SyntaxError SyntaxError: Unexpected character '@' (25:0) HOT 6
- [acorn-walk] `full` function cannot access `property` of nested `MemberExpression` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from acorn.