Visitar URL original
Support for ECMAScript 6 and 7 · Issue #71 · quintenkasteel/language-javascript · GitHub
Skip to content

Support for ECMAScript 6 and 7 #71

Open

Description

@erikd

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.

Activity

  1. erikd commented on Jun 17, 2018

    @erikd
    CollaboratorAuthor

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

  2. erikd commented on Jun 17, 2018

    @erikd
    CollaboratorAuthor

    Support for the spread operator was added in #73.

  3. erikd commented on Jun 17, 2018

    @erikd
    CollaboratorAuthor

    Arrow expressions were added in #74.

  4. Cmdv commented on Sep 6, 2018

    @Cmdv

    @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 😄

  5. erikd commented on Sep 7, 2018

    @erikd
    CollaboratorAuthor

    Absolutely fine.

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

  6. hdgarrood commented on Feb 15, 2019

    @hdgarrood
    Contributor

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

  7. fare commented on Jun 12, 2019

    @fare

    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)
  8. kl0tl commented on Jun 16, 2019

    @kl0tl
    Contributor

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

  9. jeapostrophe commented on Sep 11, 2019

    @jeapostrophe
    Contributor

    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.

  10. rhendric commented on Sep 29, 2019

    @rhendric
    Contributor

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

  11. ronyhe commented on Mar 8, 2020

    @ronyhe

    Hi all, I'd like to contribute some work here, but I'm unfamiliar with the ! syntax in the AST module: https://github.com/erikd/language-javascript/blob/38e48dd49ccea05675515e8323c0e0035ff97bea/src/Language/JavaScript/Parser/AST.hs#L55
    Can someone please refer me to an article/explanation?
    Thanks in advance!

  12. erikd commented on Mar 8, 2020

    @erikd
    CollaboratorAuthor

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

  13. georgefst commented on Sep 24, 2023

    @georgefst

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

  14. wrengr commented on Mar 24, 2025

    @wrengr

    I'm personally missing private fields. I'd offer to make a PR for it, but it seems like this project hasn't been touched in years.

  15. erikd commented on Apr 28, 2025

    @erikd
    CollaboratorAuthor

    This is not a package I use any more. I would be happy for anyone to take it over.

    Just provide me with your Hackage and Github ids.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions