google-code-export / esprima

Automatically exported from code.google.com/p/esprima
BSD 2-Clause "Simplified" License
1 stars 0 forks source link

`export default function` results in additional `(` token #631

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. parse `export default function() {}` using the harmony parser with tokens: 
true
2. notice the presence of a duplicate token in the resultant token list:

{ type: 'Punctuator',
  value: '(',
  range: [ 23, 24 ],
  loc: { start: { line: 1, column: 23 }, end: { line: 1, column: 24 } } }
{ type: 'Punctuator',
  value: '(',
  range: [ 23, 24 ],
  loc: { start: { line: 1, column: 23 }, end: { line: 1, column: 24 } } }

What is the expected output?

That the `(` token is only listed once in the token array.

What do you see instead?

The `(` token is only listed twice in the token array.

What version of the product are you using? On what operating system? Which
browser?

Harmony branch

Please provide any additional information below.

This manifests itself in JSCS as: 
https://github.com/jscs-dev/node-jscs/issues/947

Original issue reported on code.google.com by mike.she...@gmail.com on 2 Feb 2015 at 3:06

GoogleCodeExporter commented 9 years ago
This is now fixed in harmony

Original comment by mike.she...@gmail.com on 8 Feb 2015 at 5:45