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

Feat support acorn options sourceType and ecmaVersion #259

Closed
wants to merge 2 commits into from

Conversation

Mischi
Copy link

@Mischi Mischi commented Apr 13, 2017

Hi,

can we add support for the acorn options sourceType and ecmaVersion?

  • sourceType: Indicate the mode the code should be parsed in. Can be either "script" or "module". This influences global strict mode and parsing of import and export declarations.
  • ecmaVersion
    Indicates the ECMAScript version to parse. Must be either 3, 5, 6 (2015), 7 (2016), or 8 (2017). This influences support for strict mode, the set of reserved words, and support for new syntax features. Default is 7. [acorn]

This would allow us to annotate code with es6 modules like in the following snippet:

var AppController = (function () {
    function AppController($scope) {
        "ngInject";
        this.$scope = $scope;
        this.title = 'AppController';
    }
    AppController.prototype.$onInit = function () {
        console.log(this.$scope);
    };
    return AppController;
}());
export { AppController };

Currently if only need sourcetype: "module" but i thought it would be a good idea to support ecmaversion too. What do you think?

Cheers,
Fabian

CC @loxy

@omsmith
Copy link
Collaborator

omsmith commented Apr 17, 2017

Closing as per #245 #253. May be available in a replacement project, or could otherwise be contributed there.

Thanks

@omsmith omsmith closed this Apr 17, 2017
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

Successfully merging this pull request may close these issues.

2 participants