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

Support for ECMAScript 6 and 7 #71

Open
3 of 9 tasks
erikd opened this issue Jun 17, 2018 · 13 comments
Open
3 of 9 tasks

Support for ECMAScript 6 and 7 #71

erikd opened this issue Jun 17, 2018 · 13 comments

Comments

@erikd
Copy link
Owner

erikd commented Jun 17, 2018

This implements features for es 6 & 7.

  • const and let
  • arrow expressions
  • import
  • export
  • default arguments
  • object matching (destructuring, single name bind)
  • spread operator
  • classes + extends
  • template strings

Each of these should be implemented in a separate PR and each item needs tests. There are likely to be three tests needed, one for the appropriate XParser.hs test and one in each if Minify.hs and RoundTrip.hs.

@erikd
Copy link
Owner Author

erikd commented Jun 17, 2018

const was already supported and let as added in PR #72.

@erikd
Copy link
Owner Author

erikd commented Jun 17, 2018

Support for the spread operator was added in #73.

@erikd
Copy link
Owner Author

erikd commented Jun 17, 2018

Arrow expressions were added in #74.

@Cmdv
Copy link

Cmdv commented Sep 6, 2018

@erikd would it be ok to work on import and export individually?
I spotted the work was done in the original big PR. Just don't want to do it if you are already working on it 😄

@erikd
Copy link
Owner Author

erikd commented Sep 7, 2018

Absolutely fine.

Unfortunately, I have not done much more than merge patches for some time.

@hdgarrood
Copy link
Contributor

I'd like to pick up where @Cmdv left off on import parsing.

hdgarrood added a commit to hdgarrood/language-javascript that referenced this issue Feb 15, 2019
This commit adds support for all forms of the ES module import statement
apart from the dynamic 'import()' form and the bare 'import "mod";' form
(where the import is only being performed for the sake of some side
effects).

Supercedes erikd#77, refs erikd#71.
hdgarrood added a commit to hdgarrood/language-javascript that referenced this issue Feb 15, 2019
This commit adds support for all forms of the ES module import statement
apart from the dynamic 'import()' form and the bare 'import "mod";' form
(where the import is only being performed for the sake of some side
effects).

Supercedes erikd#77, refs erikd#71.
erikd pushed a commit that referenced this issue Feb 19, 2019
This commit adds support for all forms of the ES module import statement
apart from the dynamic 'import()' form and the bare 'import "mod";' form
(where the import is only being performed for the sake of some side
effects).

Supercedes #77, refs #71.
@fare
Copy link

fare commented Jun 12, 2019

Also missing, it seems:

  • trailing commas: {x,y,}
  • unparenthesized single-argument arrow functions: x => 42
  • export for function: export function f() {} (looks like export const f = () => undefined works)

@kl0tl
Copy link
Contributor

kl0tl commented Jun 16, 2019

Support for unparenthesized single-argument arrow functions was added in #90 and export for function declarations in #88.

@jeapostrophe
Copy link
Contributor

jeapostrophe commented Sep 11, 2019

const [a, b] = f(); is not supported. It should be easy to just change the VariableDeclaration case to allow ArrayLiteral

edit: I updated to the last checkout and I think it is now supported.

@rhendric
Copy link
Contributor

I knocked off a bunch of the outstanding ES7 items in some work that's now released in 0.6.0.14:

@ronyhe
Copy link

ronyhe commented Mar 8, 2020

Hi all, I'd like to contribute some work here, but I'm unfamiliar with the ! syntax in the AST module:

= JSAnnot !TokenPosn ![CommentAnnotation] -- ^Annotation: position and comment/whitespace information

Can someone please refer me to an article/explanation?
Thanks in advance!

@erikd
Copy link
Owner Author

erikd commented Mar 8, 2020

Its a strictness annotation. See eg: https://wiki.haskell.org/Performance/Strictness

@georgefst
Copy link

Any reason to stop at ES7? I'm personally missing ?? and ?.

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

No branches or pull requests

9 participants