diff --git a/README.md b/README.md index 063029c678..a56e755244 100644 --- a/README.md +++ b/README.md @@ -47,8 +47,9 @@ object referring to that same position. [mozapi]: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API - **ecmaVersion**: Indicates the ECMAScript version to parse. Must be - either 3 or 5. This influences support for strict mode, the set of - reserved words, and support for getters and setter. Default is 5. + either 3, 5, or 6. This influences support for strict mode, the set + of reserved words, and support for getters and setter. Default is 5. + ES6 is only partially supported. - **strictSemicolons**: If `true`, prevents the parser from doing automatic semicolon insertion, and statements that do not end with diff --git a/acorn.js b/acorn.js index 3326eab0af..7de370d593 100644 --- a/acorn.js +++ b/acorn.js @@ -51,9 +51,9 @@ var defaultOptions = exports.defaultOptions = { // `ecmaVersion` indicates the ECMAScript version to parse. Must - // be either 3, or 5, or 6. This - // influences support for strict mode, the set of reserved words, - // support for getters and setters and other features. + // be either 3, or 5, or 6. This influences support for strict + // mode, the set of reserved words, support for getters and + // setters and other features. ES6 support is only partial. ecmaVersion: 5, // Turn on `strictSemicolons` to prevent the parser from doing // automatic semicolon insertion. diff --git a/index.html b/index.html index 00c0182182..187bf39aaf 100644 --- a/index.html +++ b/index.html @@ -34,9 +34,9 @@ API, with the caveat that the SpiderMonkey-specific syntax return parseTopLevel(options.program); };

A second optional argument can be given to further configure the parser process. These options are recognized:

  var defaultOptions = exports.defaultOptions = {

ecmaVersion indicates the ECMAScript version to parse. Must -be either 3, or 5, or 6. This -influences support for strict mode, the set of reserved words, -support for getters and setters and other features.

    ecmaVersion: 5,

Turn on strictSemicolons to prevent the parser from doing +be either 3, or 5, or 6. This influences support for strict +mode, the set of reserved words, support for getters and +setters and other features. ES6 support is only partial.

    ecmaVersion: 5,

Turn on strictSemicolons to prevent the parser from doing automatic semicolon insertion.

    strictSemicolons: false,

When allowTrailingCommas is false, the parser will not allow trailing commas in array and object literals.

    allowTrailingCommas: true,

By default, reserved words are not enforced. Enable forbidReserved to enforce them. When this option has the