This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 496859 - [es7] Support all ECMA2016 changes in the tooling
Summary: [es7] Support all ECMA2016 changes in the tooling
Status: RESOLVED FIXED
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: JS Tools (show other bugs)
Version: 12.0   Edit
Hardware: PC Windows 7
: P3 normal with 1 vote (vote)
Target Milestone: 13.0   Edit
Assignee: Curtis Windatt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-27 12:15 EDT by Curtis Windatt CLA
Modified: 2016-06-28 14:30 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Curtis Windatt CLA 2016-06-27 12:15:06 EDT
ECMA 2016 (7th edition) has been approved already.  We need to support all the new changes.

http://www.2ality.com/2016/01/ecmascript-2016.htmls

1) Make sure the parser can handle the new syntax
2) Provide a unique problem id and quick fix if ES7 code is encountered when project is configured for ES5/ES6.
3) Add tests to ensure occurrences/outliner/assist/validation work
Comment 1 Olivier Thomann CLA 2016-06-27 12:35:43 EDT
I think you meant:
http://www.2ality.com/2016/01/ecmascript-2016.html
Comment 2 Olivier Thomann CLA 2016-06-27 12:40:24 EDT
The good news is that acorn supports the new exponentiation operator (**) is the parser is set with ecma version being 7.
Comment 3 Olivier Thomann CLA 2016-06-27 12:48:42 EDT
The exponentiation operator support is on line 2648 in acorn.js. Line 1281 doesn't mention 7 for the "supported" values. This should probably be adjusted.

var defaultOptions = {
  // `ecmaVersion` indicates the ECMAScript version to parse. Must
  // be either 3, or 5, or 6. This influences support for strict
  // mode, the set of reserved words, support for getters and
  // setters and other features. The default is 6.
  ecmaVersion: 6,

I'll open a pull request against acorn for this.
Comment 4 Curtis Windatt CLA 2016-06-28 12:32:02 EDT
(In reply to Olivier Thomann from comment #3)
> The exponentiation operator support is on line 2648 in acorn.js. Line 1281
> doesn't mention 7 for the "supported" values. This should probably be
> adjusted.
> 
> var defaultOptions = {
>   // `ecmaVersion` indicates the ECMAScript version to parse. Must
>   // be either 3, or 5, or 6. This influences support for strict
>   // mode, the set of reserved words, support for getters and
>   // setters and other features. The default is 6.
>   ecmaVersion: 6,
> 
> I'll open a pull request against acorn for this.

We can open a similar pull request to Tern to add an ecma7 definition.  All it will contain is Array.prototype.includes.  I've already written a possible implementation.