Skip to content
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

Add ECMAScript 6 features #10

Closed
22 tasks done
nzakas opened this issue Dec 13, 2014 · 47 comments
Closed
22 tasks done

Add ECMAScript 6 features #10

nzakas opened this issue Dec 13, 2014 · 47 comments

Comments

@nzakas
Copy link
Member

nzakas commented Dec 13, 2014

This is a rollup that will let us keep track of ES6 progress.

  • let declarations
  • const declarations
  • Regular expression u flag
  • Regular expression y flag
  • Binary literals
  • New octal literals
  • Arrow functions
  • Default parameters
  • Rest parameters
  • Spread operator
  • super references
  • Classes
  • for-of loops
  • Generators
  • Object literal property shorthand
  • Object literal method shorthand
  • Object literal computed properties
  • Template strings
  • Destructuring
  • Unicode code point escapes
  • Allow duplicate object literal properties (except __proto__)
  • Modules
@nzakas
Copy link
Member Author

nzakas commented Dec 13, 2014

The let and const changes are in. Next up: regular expression flags.

@nzakas
Copy link
Member Author

nzakas commented Dec 13, 2014

In order to make the regular expression flags work, I needed to add a regex property to both AST nodes and literal nodes to coincide with Esprima Harmony. I've got this working, but need to update the AST tests for the various third-party libraries that Esprima uses to validate AST output.

nzakas added a commit that referenced this issue Dec 14, 2014
nzakas added a commit that referenced this issue Dec 14, 2014
nzakas added a commit that referenced this issue Dec 14, 2014
nzakas added a commit that referenced this issue Dec 16, 2014
New: Add u and y regex flags (refs #10)
nzakas added a commit that referenced this issue Dec 20, 2014
nzakas added a commit that referenced this issue Dec 23, 2014
New: Add support for object literal method shorthand (refs #10)
nzakas added a commit that referenced this issue Dec 24, 2014
New: Add support for shorthand properties (refs #10)
nzakas added a commit that referenced this issue Dec 29, 2014
@FredKSchott
Copy link
Contributor

@nzakas which of these would you reccomend to get started on?

@nzakas
Copy link
Member Author

nzakas commented Dec 29, 2014

I think allowing duplicate properties in strict mode is the easiest to get started with. I'd call that objectLiteralDuplicateProperties.

After that, Unicode code point escapes (see https://leanpub.com/understandinges6/read#leanpub-auto-better-unicode-support)

@nzakas
Copy link
Member Author

nzakas commented Dec 29, 2014

I'm currently working on generators.

nzakas added a commit that referenced this issue Dec 31, 2014
nzakas added a commit that referenced this issue Dec 31, 2014
nzakas added a commit that referenced this issue Dec 31, 2014
New: Implement generators (refs #10)
@FredKSchott
Copy link
Contributor

I'm starting work on Unicode code point escapes

@nzakas
Copy link
Member Author

nzakas commented Jan 12, 2015

Generators and code point escapes have been merged in.

@nzakas
Copy link
Member Author

nzakas commented Jan 17, 2015

Next priority is template literals. @FredKSchott interested in taking that?

@FredKSchott
Copy link
Contributor

definitely, I'll tackle that next (away for the long weekend but I'll take a look next week)

They're supported in V8 now, right? Makes sense to do them next

@nzakas
Copy link
Member Author

nzakas commented Jan 18, 2015

Yup! And also in io.js now.

I'm planning on attacking arrow functions when I have some energy.

xjamundx pushed a commit to xjamundx/espree that referenced this issue Feb 10, 2015
xjamundx pushed a commit to xjamundx/espree that referenced this issue Feb 10, 2015
nzakas added a commit that referenced this issue Feb 10, 2015
New: Rest Parameter (refs: #10)
xjamundx pushed a commit to xjamundx/espree that referenced this issue Feb 11, 2015
xjamundx pushed a commit to xjamundx/espree that referenced this issue Feb 12, 2015
xjamundx pushed a commit to xjamundx/espree that referenced this issue Feb 12, 2015
nzakas added a commit that referenced this issue Feb 13, 2015
New: spread operator (refs #10)
@endel
Copy link

endel commented Feb 16, 2015

facebook/esprima supports classes.

@nzakas
Copy link
Member Author

nzakas commented Feb 19, 2015

Esprima classes support: jquery/esprima#1061

@xjamundx
Copy link
Contributor

Well that makes things easier :)

@nzakas
Copy link
Member Author

nzakas commented Feb 21, 2015

Working on classes now.

@xjamundx
Copy link
Contributor

👏

@FredKSchott
Copy link
Contributor

you guys are killing it 👏 👏 👏

@nzakas
Copy link
Member Author

nzakas commented Feb 23, 2015

Ran into a bit of trouble with classes. The Harmony branch is different that Esprima's master now (master being the most correct). Will probably take me a bit to work through it unless someone else wants to give it a shot.

@xjamundx
Copy link
Contributor

I'm still trying to grok the destructuring defaults spec. Once I'm done with that I'll try to throw my hat into either classes or modules. Whatever's left....

@niels4
Copy link

niels4 commented Feb 24, 2015

Fast work on getting these es6 features implemented!

I noticed an issue with rest parameters though, they don't seem to get added to the scope's variable list. I noticed this when trying to use eslint to validate a function with rest parameters.

var func = function (first, ...rest) {
  return rest;
};

I am getting a 'rest' is not defined (no-undef) error. The underlying cause seems to be that when the rule's function looks at context.getScope().variables, a variable named 'rest' is not in the list.

see eslint/eslint#1870 to fully replicate

@xjamundx
Copy link
Contributor

Cool just saw eslint/eslint#1870.

@nzakas
Copy link
Member Author

nzakas commented Feb 24, 2015

As I mentioned there, this is an issue with escope, not espree.

nzakas added a commit that referenced this issue Feb 28, 2015
nzakas added a commit that referenced this issue Mar 1, 2015
nzakas added a commit that referenced this issue Mar 1, 2015
nzakas added a commit that referenced this issue Mar 1, 2015
New: Support ES6 classes (refs #10)
@nzakas
Copy link
Member Author

nzakas commented Mar 1, 2015

Don't look now, modules is the last feature!

@xjamundx
Copy link
Contributor

xjamundx commented Mar 2, 2015

This is great news!! Well done!

@fczuardi
Copy link

fczuardi commented Mar 9, 2015

should we file a separate bug just for the modules support?

In this related bug I posted an example of how espree differs from esprima when used with escope eslint/eslint#1978 (comment)

@nzakas
Copy link
Member Author

nzakas commented Mar 9, 2015

Modules are already properly supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants