diff --git a/README.md b/README.md index e50d98e6e3..6d5398ca23 100644 --- a/README.md +++ b/README.md @@ -50,8 +50,7 @@ object referring to that same position. - **ecmaVersion**: Indicates the ECMAScript version to parse. Must be 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. + of reserved words, and support for new syntax features. Default is 5. - **strictSemicolons**: If `true`, prevents the parser from doing automatic semicolon insertion, and statements that do not end with diff --git a/bin/acorn b/bin/acorn index d5e5e3a511..2a226da063 100755 --- a/bin/acorn +++ b/bin/acorn @@ -8,7 +8,7 @@ var infile, parsed, options = {}, silent = false, compact = false; function help(status) { var print = (status == 0) ? console.log : console.error; - print("usage: " + path.basename(process.argv[1]) + " [--ecma3|--ecma5] [--strictSemicolons]"); + print("usage: " + path.basename(process.argv[1]) + " [--ecma3|--ecma5|--ecma6] [--strictSemicolons]"); print(" [--locations] [--compact] [--silent] [--help] [--] infile"); process.exit(status); } @@ -19,6 +19,7 @@ for (var i = 2; i < process.argv.length; ++i) { else if (arg == "--" && !infile && i + 2 == process.argv.length) infile = process.argv[++i]; else if (arg == "--ecma3") options.ecmaVersion = 3; else if (arg == "--ecma5") options.ecmaVersion = 5; + else if (arg == "--ecma6") options.ecmaVersion = 6; else if (arg == "--strictSemicolons") options.strictSemicolons = true; else if (arg == "--locations") options.locations = true; else if (arg == "--silent") silent = true;