Note partial es6 support in docs
This commit is contained in:
@@ -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
|
||||
|
||||
6
acorn.js
6
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.
|
||||
|
||||
@@ -34,9 +34,9 @@ API</a>, with the caveat that the SpiderMonkey-specific syntax
|
||||
<span class="k">return</span> <span class="nx">parseTopLevel</span><span class="p">(</span><span class="nx">options</span><span class="p">.</span><span class="nx">program</span><span class="p">);</span>
|
||||
<span class="p">};</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">¶</a> </div> <p>A second optional argument can be given to further configure
|
||||
the parser process. These options are recognized:</p> </td> <td class="code"> <div class="highlight"><pre> <span class="kd">var</span> <span class="nx">defaultOptions</span> <span class="o">=</span> <span class="nx">exports</span><span class="p">.</span><span class="nx">defaultOptions</span> <span class="o">=</span> <span class="p">{</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">¶</a> </div> <p><code>ecmaVersion</code> 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.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">ecmaVersion</span><span class="o">:</span> <span class="mi">5</span><span class="p">,</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">¶</a> </div> <p>Turn on <code>strictSemicolons</code> 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.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">ecmaVersion</span><span class="o">:</span> <span class="mi">5</span><span class="p">,</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">¶</a> </div> <p>Turn on <code>strictSemicolons</code> to prevent the parser from doing
|
||||
automatic semicolon insertion.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">strictSemicolons</span><span class="o">:</span> <span class="kc">false</span><span class="p">,</span></pre></div> </td> </tr> <tr id="section-6"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-6">¶</a> </div> <p>When <code>allowTrailingCommas</code> is false, the parser will not allow
|
||||
trailing commas in array and object literals.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">allowTrailingCommas</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span></pre></div> </td> </tr> <tr id="section-7"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-7">¶</a> </div> <p>By default, reserved words are not enforced. Enable
|
||||
<code>forbidReserved</code> to enforce them. When this option has the
|
||||
|
||||
Reference in New Issue
Block a user