Giter Club home page Giter Club logo

Comments (13)

marijnh avatar marijnh commented on August 27, 2024

There is interest in supporting all of ES6, if the ecmaVersion option is set to 6. A patch that starts adding part of such support would be welcome. When parsing ES5, these keywords should remain errors.

from acorn.

matthewmueller avatar matthewmueller commented on August 27, 2024

+1 things like yield and let would be great

from acorn.

zaach avatar zaach commented on August 27, 2024

const has been available in v8/node.js for a while also. In the interim I'm preprocessing with varify.

from acorn.

btwael avatar btwael commented on August 27, 2024

+1 for supporting ES6 import

from acorn.

RReverser avatar RReverser commented on August 27, 2024

Duplicating https://twitter.com/RReverser/status/491714922724986881:

@marijnh Hi, is there a list of ES6 features unsupported in Acorn yet? I'm feeling pretty comfortable with it's code and willing to help.

from acorn.

marijnh avatar marijnh commented on August 27, 2024

It seems the only supported feature so far is the spread operator.

If you're doing any work in this direction, make sure you stay compatible with what Esprima is doing (in terms of AST data structure).

from acorn.

RReverser avatar RReverser commented on August 27, 2024

Sure. Are you aware of any human-readable list of accepted ES6 features (maybe with specifications) then?

from acorn.

RReverser avatar RReverser commented on August 27, 2024

Asking because MDN Parser API page seems not to match Esprima's output. /cc @ariya

from acorn.

mozfreddyb avatar mozfreddyb commented on August 27, 2024

ES6 feature list

from acorn.

RReverser avatar RReverser commented on August 27, 2024

@mozfreddyb Thanks, but there is mixed draft APIs and syntax from user's perspective, not from parsing+AST specs.

from acorn.

RReverser avatar RReverser commented on August 27, 2024

For those interested, my WIP working fork with ES6 support is available here:

Working features:

  • Unicode Code Point Escape Sequences (\u{ABCDEF}).
  • Numeric Literals (octal, binary).
  • Arrow Functions.
  • Spread Element.
  • Classes.
  • Destructuring assignments.
  • Computed object properties.
  • Object methods.
  • Shorthand object properties.
  • for (... of ...) loops.
  • Array Comprehensions.
  • Modules.
  • Template Strings.
  • Generators.

from acorn.

RReverser avatar RReverser commented on August 27, 2024

@marijnh Should we close this now or would it better stay open for tracking new upcoming features?

from acorn.

marijnh avatar marijnh commented on August 27, 2024

I think it's fine to close it. We can open new tickets when new features come up.

from acorn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.