16.0 (2026-02-19)——模具行业从业者必备知识手册
-
<h3>8.16.0 (2026-02-19)</h3>
<h4>New features</h4>
<p>The <code>sourceType</code> option can now be set to <code>"commonjs"</code> to have the parser treat the top level scope as a function scope.</p>
<p>Add support for Unicode 17.</p>
<h4>Bug fixes</h4>
<p>Don't recognize <code>await using</code> as contextual keywords when followed directly by a backslash.</p>
<p>Fix an issue where the parser would allow <code>return</code> statements in <code>static</code> blocks when <code>allowReturnOutsideFunction</code> was enabled.</p>
<p>Properly reject <code>using</code> declarations that appear directly in <code>switch</code> or <code>for</code> head scopes.</p>
<p>Fix some corner case issues in the recognition of <code>using</code> syntax.</p>
<h3>8.15.0 (2025-06-08)</h3>
<h4>New features</h4>
<p>Support <code>using</code> and <code>await using</code> syntax.</p>
<p>The <code>AnyNode</code> type is now defined in such a way that plugins can extend it.</p>
<h4>Bug fixes</h4>
<p>Fix an issue where the <code>bigint</code> property of literal nodes for non-decimal bigints had the wrong format.</p>
<p>The <code>acorn</code> CLI tool no longer crashes when emitting a tree that contains a bigint.</p>
<h3>8.14.1 (2025-03-05)</h3>
<h4>Bug fixes</h4>
<p>Fix an issue where <code>await</code> expressions in class field initializers were inappropriately allowed.</p>
<p>Properly allow await inside an async arrow function inside a class field initializer.</p>
<p>Mention the source file name in syntax error messages when given.</p>
<p>Properly add an empty <code>attributes</code> property to every form of <code>ExportNamedDeclaration</code>.</p>
<h3>8.14.0 (2024-10-27)</h3>
<h4>New features</h4>
<p>Support ES2025 import attributes.</p>
<p>Support ES2025 RegExp modifiers.</p>
<h4>Bug fixes</h4>
<p>Support some missing Unicode properties.</p>
<h3>8.13.0 (2024-10-16)</h3>
<h4>New features</h4>
<p>Upgrade to Unicode 16.0.</p>
<h3>8.12.1 (2024-07-03)</h3>
<h4>Bug fixes</h4>
<p>Fix a regression that caused Acorn to no longer run on Node versions <8.10.</p>
<h3>8.12.0 (2024-06-14)</h3>
<h4>New features</h4>
<p>Support ES2025 duplicate capture group names in regular expressions.</p>
<h4>Bug fixes</h4>
<p>Include <code>VariableDeclarator</code> in the <code>AnyNode</code> type so that walker objects can refer to it without getting a type error.</p>
<p>Properly raise a parse error for invalid <code>for</code>/<code>of</code> statements using <code>async</code> as binding name.</p>
<p>Properly recognize "use strict" when preceded by a string with an escaped newline.</p>
<p>Mark the <code>Parser</code> constructor as protected, not private, so plugins can extend it without type errors.</p>
<p>Fix a bug where some invalid <code>delete</code> expressions were let through when the operand was parenthesized and <code>preserveParens</code> was enabled.</p>
<p>Properly normalize line endings in raw strings of invalid template tokens.</p>
<p>Properly track line numbers for escaped newlines in strings.</p>
<p>Fix a bug that broke line number accounting after a template literal with invalid escape sequences.</p>
<h3>8.11.3 (2023-12-29)</h3>
<h4>Bug fixes</h4>
<p>Add <code>Function</code> and <code>Class</code> to the <code>AggregateType</code> type, so that they can be used in walkers without raising a type error.</p>
<p>Make sure <code>onToken</code> get an <code>import</code> keyword token when parsing <code>import.meta</code>.</p>
<p>Fix a bug where <code>.loc.start</code> could be undefined for <code>new.target</code> <code>meta</code> nodes.</p>
<h3>8.11.2 (2023-10-27)</h3>
<h4>Bug fixes</h4>
<p>Fix a bug that caused regular expressions after colon tokens to not be properly tokenized in some circumstances.</p>
<h3>8.11.1 (2023-10-26)</h3>
<h4>Bug fixes</h4>
<p>Fix a regression where <code>onToken</code> would receive 'name' tokens for 'new' keyword tokens.</p>
<h3>8.11.0 (2023-10-26)</h3>
<h4>Bug fixes</h4>
<p>Fix an issue where tokenizing (without parsing) an object literal with a property named <code>class</code> or <code>function</code> could, in some circumstance, put the tokenizer into an invalid state.</p>
<p>Fix an issue where a slash after a call to a propery named the same as some keywor</p>
<hr>
<p>有没有同行遇到过同样的问题?分享一下经验。</p>