Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
ES6 feature: computed property name #1037
Comments
|
Continuing on the discussion, some issues:
My suggestion will be: interface ObjectExpression <: Expression {
type: "ObjectExpression";
properties: [ Property ];
}
interface Property {
kind: "init" | "get" | "set";
name: Expression;
computed: boolean;
value: Expression;
} |
|
@ikarienator is the proposal here diff from SpiderMonkey? If so, file an issue at estree too please? |
|
@ikarienator I agree with @mikesherov. Since |
|
This is only migrating the google code issue to here. I haven't checked estree yet. |
|
I checked estree and it does not include much es6 contents. It does not include computed property name among other features. Why do we want to keep sync with it? https://github.com/shapesecurity/shift-spec/tree/es6 has a very complete and up to date definition of ES6 AST and very few issues if any. It is described in a compilable WebIDL. We can probably be more compliant to that than estree. Are we trying to make the ES6 AST additive to the ES5 one? I'm not sure it's possible. |
|
Let's discuss at the meeting on Wednesday then. The idea is compat with acorn and spidermonkey, several of which have living breathing es6 implementations in current versions. |
|
@ikarienator Unfortunately that how's been implemented in the harmony branch so far. It seems to be less troublesome to support incremental addition, even it's not perfect, in the current situation. |
|
Make sense. I will create issues in estree to address missing features that
|
|
BTW, the more proper old bug to be referred is this one: https://code.google.com/p/esprima/issues/detail?id=480. The corresponding harmony branch implementation is in commit 2bb17ef. |
|
Thanks! Interesting... I may want move |
|
There is also commit |
Syntax:
ComputedPropertyName[Yield] : [ AssignmentExpression[In, ?Yield] ]Referred to by:
PropertyName[Yield,GeneratorParameter] : LiteralPropertyName [+GeneratorParameter] ComputedPropertyName [~GeneratorParameter] ComputedPropertyName[?Yield]Early errors:
None.
Spec:
12.2.5 Object Initializer
See also
Esprima issue on Google Code
V8 support for computed property names
Error messages in V8