-
Notifications
You must be signed in to change notification settings - Fork 784
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
Object Rest/Spread Properties #1588
Comments
ESTree for rest/spread: https://github.com/estree/estree/blob/master/experimental/rest-spread-properties.md |
And it's stage-3 right now (not in es2017) |
Originally, the AST changes involved the addition of two new nodes RestProperty and SpreadProperty: interface RestProperty <: Node {
type: "RestProperty";
argument: Expression;
}
interface SpreadProperty <: Node {
type: "SpreadProperty";
argument: Expression;
} and the modifications to ObjectPattern and ObjectExpression: extend interface ObjectPattern {
properties: [ AssignmentProperty | RestProperty ];
}
extend interface ObjectExpression {
properties: [ Property | SpreadProperty ];
} However, based on the discussion in estree/estree#145, the consensus is that the AST change will be simplified to the reuse of the existing RestElement and SpreadElement and thus the modifications to ObjectPattern and ObjectExpression are also simplified to: extend interface ObjectPattern {
properties: [ AssignmentProperty | RestElement ];
}
extend interface ObjectExpression {
properties: [ Property | SpreadElement ];
} |
As of March 2017, it's in Stage 3 (https://github.com/tc39/proposals). |
Is this currently working? |
If you use the master branch. Otherwise, keep an eye on https://github.com/jquery/esprima/projects/2. |
Hey @ariya, is version 5.0 scheduled for a release date? |
When will 5.0 release? |
Eslint does support this, and eslint uses (by default) esprima. How are they doing this? |
ESLint uses Espree: https://github.com/eslint/espree |
Oh, a misread from hours of not sleeping. Thanks! |
Three years later, still can't parse a spread operator? |
There aren't any javascript runtimes that support es module syntax but lack the spread operator. At the very least I would expect Also, I'm not sure why this issue has been closed when it's not available in any releases. Isn't this kind of indirectly sweeping the problem under the rug? |
How do I replace it? I tried replacing |
This issue should not be closed. |
I publish a master version of esprima: https://www.npmjs.com/package/esprima-master |
There's a solution here #2034 (comment) |
Six years and no support for spread operator. |
use babel |
New productions:
AST changes:
References:
The text was updated successfully, but these errors were encountered: