5 Support quoted export names.
9 Add support for Unicode 13 properties in regular expressions.
13 Use a loop to find line breaks, because the existing regexp search would overrun the end of the searched range and waste a lot of time in minified code.
19 Fix a bug where an object literal with multiple `__proto__` properties would incorrectly be accepted if a later property value held an assigment.
23 Support class private fields with the `in` operator.
29 Improve context-dependent tokenization in a number of corner cases.
31 Fix location tracking after a 0x2028 or 0x2029 character in a string literal (which before did not increase the line number).
33 Fix an issue where arrow function bodies in for loop context would inappropriately consume `in` operators.
35 Fix wrong end locations stored on SequenceExpression nodes.
37 Implement restriction that `for`/`of` loop LHS can't start with `let`.
41 Add support for ES2022 class static blocks.
43 Allow multiple input files to be passed to the CLI tool.
49 Fix a bug where `allowAwaitOutsideFunction` would allow `await` in class field initializers, and setting `ecmaVersion` to 13 or higher would allow top-level await in non-module sources.
55 A new option, `allowSuperOutsideMethod`, can be used to suppress the error when `super` is used in the wrong context.
61 Default `allowAwaitOutsideFunction` to true for ECMAScript 2022 an higher.
63 Add support for the `d` ([indices](https://github.com/tc39/proposal-regexp-match-indices)) regexp flag.
69 Fix spec conformity in corner case 'for await (async of ...)'.
75 Fix an issue where the library couldn't parse 'for (async of ...)'.
77 Fix a bug in UTF-16 decoding that would read characters incorrectly in some circumstances.
83 Fix a bug where a class field initialized to an async arrow function wouldn't allow await inside it. Same issue existed for generator arrow functions with yield.
89 Fix a regression introduced in 8.2.0 where static or async class methods with keyword names fail to parse.
95 Add support for ES2022 class fields and private methods.
101 Stop shipping source maps in the NPM package.
103 ## 8.1.0 (2021-03-09)
107 Fix a spurious error in nested destructuring arrays.
111 Expose `allowAwaitOutsideFunction` in CLI interface.
113 Make `allowImportExportAnywhere` also apply to `import.meta`.
115 ## 8.0.5 (2021-01-25)
119 Adjust package.json to work with Node 12.16.0 and 13.0-13.6.
121 ## 8.0.4 (2020-10-05)
125 Make `await x ** y` an error, following the spec.
127 Fix potentially exponential regular expression.
129 ## 8.0.3 (2020-10-02)
133 Fix a wasteful loop during `Parser` creation when setting `ecmaVersion` to `"latest"`.
135 ## 8.0.2 (2020-09-30)
139 Make the TypeScript types reflect the current allowed values for `ecmaVersion`.
141 Fix another regexp/division tokenizer issue.
143 ## 8.0.1 (2020-08-12)
147 Provide the correct value in the `version` export.
149 ## 8.0.0 (2020-08-12)
153 Disallow expressions like `(a = b) = c`.
155 Make non-octal escape sequences a syntax error in strict mode.
159 The package can now be loaded directly as an ECMAScript module in node 13+.
161 Update to the set of Unicode properties from ES2021.
165 The `ecmaVersion` option is now required. For the moment, omitting it will still work with a warning, but that will change in a future release.
167 Some changes to method signatures that may be used by plugins.
169 ## 7.4.0 (2020-08-03)
173 Add support for logical assignment operators.
175 Add support for numeric separators.
177 ## 7.3.1 (2020-06-11)
181 Make the string in the `version` export match the actual library version.
183 ## 7.3.0 (2020-06-11)
187 Fix a bug that caused parsing of object patterns with a property named `set` that had a default value to fail.
191 Add support for optional chaining (`?.`).
193 ## 7.2.0 (2020-05-09)
197 Fix precedence issue in parsing of async arrow functions.
201 Add support for nullish coalescing.
203 Add support for `import.meta`.
205 Support `export * as ...` syntax.
207 Upgrade to Unicode 13.
209 ## 6.4.1 (2020-03-09)
213 More carefully check for valid UTF16 surrogate pairs in regexp validator.
215 ## 7.1.1 (2020-03-01)
219 Treat `\8` and `\9` as invalid escapes in template strings.
221 Allow unicode escapes in property names that are keywords.
223 Don't error on an exponential operator expression as argument to `await`.
225 More carefully check for valid UTF16 surrogate pairs in regexp validator.
227 ## 7.1.0 (2019-09-24)
231 Disallow trailing object literal commas when ecmaVersion is less than 5.
235 Add a static `acorn` property to the `Parser` class that contains the entire module interface, to allow plugins to access the instance of the library that they are acting on.
237 ## 7.0.0 (2019-08-13)
241 Changes the node format for dynamic imports to use the `ImportExpression` node type, as defined in [ESTree](https://github.com/estree/estree/blob/master/es2020.md#importexpression).
243 Makes 10 (ES2019) the default value for the `ecmaVersion` option.
245 ## 6.3.0 (2019-08-12)
249 `sourceType: "module"` can now be used even when `ecmaVersion` is less than 6, to parse module-style code that otherwise conforms to an older standard.
251 ## 6.2.1 (2019-07-21)
255 Fix bug causing Acorn to treat some characters as identifier characters that shouldn't be treated as such.
257 Fix issue where setting the `allowReserved` option to `"never"` allowed reserved words in some circumstances.
259 ## 6.2.0 (2019-07-04)
263 Improve valid assignment checking in `for`/`in` and `for`/`of` loops.
265 Disallow binding `let` in patterns.
269 Support bigint syntax with `ecmaVersion` >= 11.
271 Support dynamic `import` syntax with `ecmaVersion` >= 11.
273 Upgrade to Unicode version 12.
275 ## 6.1.1 (2019-02-27)
279 Fix bug that caused parsing default exports of with names to fail.
281 ## 6.1.0 (2019-02-08)
285 Fix scope checking when redefining a `var` as a lexical binding.
289 Split up `parseSubscripts` to use an internal `parseSubscript` method to make it easier to extend with plugins.
291 ## 6.0.7 (2019-02-04)
295 Check that exported bindings are defined.
297 Don't treat `\u180e` as a whitespace character.
299 Check for duplicate parameter names in methods.
301 Don't allow shorthand properties when they are generators or async methods.
303 Forbid binding `await` in async arrow function's parameter list.
305 ## 6.0.6 (2019-01-30)
309 The content of class declarations and expressions is now always parsed in strict mode.
311 Don't allow `let` or `const` to bind the variable name `let`.
313 Treat class declarations as lexical.
315 Don't allow a generator function declaration as the sole body of an `if` or `else`.
317 Ignore `"use strict"` when after an empty statement.
319 Allow string line continuations with special line terminator characters.
321 Treat `for` bodies as part of the `for` scope when checking for conflicting bindings.
323 Fix bug with parsing `yield` in a `for` loop initializer.
325 Implement special cases around scope checking for functions.
327 ## 6.0.5 (2019-01-02)
331 Fix TypeScript type for `Parser.extend` and add `allowAwaitOutsideFunction` to options type.
333 Don't treat `let` as a keyword when the next token is `{` on the next line.
335 Fix bug that broke checking for parentheses around an object pattern in a destructuring assignment when `preserveParens` was on.
337 ## 6.0.4 (2018-11-05)
341 Further improvements to tokenizing regular expressions in corner cases.
343 ## 6.0.3 (2018-11-04)
347 Fix bug in tokenizing an expression-less return followed by a function followed by a regular expression.
349 Remove stray symlink in the package tarball.
351 ## 6.0.2 (2018-09-26)
355 Fix bug where default expressions could fail to parse inside an object destructuring assignment expression.
357 ## 6.0.1 (2018-09-14)
361 Fix wrong value in `version` export.
363 ## 6.0.0 (2018-09-14)
367 Better handle variable-redefinition checks for catch bindings and functions directly under if statements.
369 Forbid `new.target` in top-level arrow functions.
371 Fix issue with parsing a regexp after `yield` in some contexts.
375 The package now comes with TypeScript definitions.
379 The default value of the `ecmaVersion` option is now 9 (2018).
381 Plugins work differently, and will have to be rewritten to work with this version.
383 The loose parser and walker have been moved into separate packages (`acorn-loose` and `acorn-walk`).
385 ## 5.7.3 (2018-09-10)
389 Fix failure to tokenize regexps after expressions like `x.of`.
391 Better error message for unterminated template literals.
393 ## 5.7.2 (2018-08-24)
397 Properly handle `allowAwaitOutsideFunction` in for statements.
399 Treat function declarations at the top level of modules like let bindings.
401 Don't allow async function declarations as the only statement under a label.
403 ## 5.7.0 (2018-06-15)
407 Upgraded to Unicode 11.
409 ## 5.6.0 (2018-05-31)
413 Allow U+2028 and U+2029 in string when ECMAVersion >= 10.
415 Allow binding-less catch statements when ECMAVersion >= 10.
417 Add `allowAwaitOutsideFunction` option for parsing top-level `await`.
419 ## 5.5.3 (2018-03-08)
423 A _second_ republish of the code in 5.5.1, this time with yarn, to hopefully get valid timestamps.
425 ## 5.5.2 (2018-03-08)
429 A republish of the code in 5.5.1 in an attempt to solve an issue with the file timestamps in the npm package being 0.
431 ## 5.5.1 (2018-03-06)
435 Fix misleading error message for octal escapes in template strings.
437 ## 5.5.0 (2018-02-27)
441 The identifier character categorization is now based on Unicode version 10.
443 Acorn will now validate the content of regular expressions, including new ES9 features.
445 ## 5.4.0 (2018-02-01)
449 Disallow duplicate or escaped flags on regular expressions.
451 Disallow octal escapes in strings in strict mode.
455 Add support for async iteration.
457 Add support for object spread and rest.
459 ## 5.3.0 (2017-12-28)
463 Fix parsing of floating point literals with leading zeroes in loose mode.
465 Allow duplicate property names in object patterns.
467 Don't allow static class methods named `prototype`.
469 Disallow async functions directly under `if` or `else`.
471 Parse right-hand-side of `for`/`of` as an assignment expression.
473 Stricter parsing of `for`/`in`.
475 Don't allow unicode escapes in contextual keywords.
479 Parsing class members was factored into smaller methods to allow plugins to hook into it.
481 ## 5.2.1 (2017-10-30)
485 Fix a token context corruption bug.
487 ## 5.2.0 (2017-10-30)
491 Fix token context tracking for `class` and `function` in property-name position.
493 Make sure `%*` isn't parsed as a valid operator.
495 Allow shorthand properties `get` and `set` to be followed by default values.
497 Disallow `super` when not in callee or object position.
501 Support [`directive` property](https://github.com/estree/estree/compare/b3de58c9997504d6fba04b72f76e6dd1619ee4eb...1da8e603237144f44710360f8feb7a9977e905e0) on directive expression statements.
503 ## 5.1.2 (2017-09-04)
507 Disable parsing of legacy HTML-style comments in modules.
509 Fix parsing of async methods whose names are keywords.
511 ## 5.1.1 (2017-07-06)
515 Fix problem with disambiguating regexp and division after a class.
517 ## 5.1.0 (2017-07-05)
521 Fix tokenizing of regexps in an object-desctructuring `for`/`of` loop and after `yield`.
523 Parse zero-prefixed numbers with non-octal digits as decimal.
525 Allow object/array patterns in rest parameters.
527 Don't error when `yield` is used as a property name.
529 Allow `async` as a shorthand object property.
533 Implement the [template literal revision proposal](https://github.com/tc39/proposal-template-literal-revision) for ES9.
535 ## 5.0.3 (2017-04-01)
539 Fix spurious duplicate variable definition errors for named functions.
541 ## 5.0.2 (2017-03-30)
545 A binary operator after a parenthesized arrow expression is no longer incorrectly treated as an error.
547 ## 5.0.0 (2017-03-28)
551 Raise an error for duplicated lexical bindings.
553 Fix spurious error when an assignement expression occurred after a spread expression.
555 Accept regular expressions after `of` (in `for`/`of`), `yield` (in a generator), and braced arrow functions.
557 Allow labels in front or `var` declarations, even in strict mode.
561 Parse declarations following `export default` as declaration nodes, not expressions. This means that class and function declarations nodes can now have `null` as their `id`.
563 ## 4.0.11 (2017-02-07)
567 Allow all forms of member expressions to be parenthesized as lvalue.
569 ## 4.0.10 (2017-02-07)
573 Don't expect semicolons after default-exported functions or classes, even when they are expressions.
575 Check for use of `'use strict'` directives in non-simple parameter functions, even when already in strict mode.
577 ## 4.0.9 (2017-02-06)
581 Fix incorrect error raised for parenthesized simple assignment targets, so that `(x) = 1` parses again.
583 ## 4.0.8 (2017-02-03)
587 Solve spurious parenthesized pattern errors by temporarily erring on the side of accepting programs that our delayed errors don't handle correctly yet.
589 ## 4.0.7 (2017-02-02)
593 Accept invalidly rejected code like `(x).y = 2` again.
595 Don't raise an error when a function _inside_ strict code has a non-simple parameter list.
597 ## 4.0.6 (2017-02-02)
601 Fix exponential behavior (manifesting itself as a complete hang for even relatively small source files) introduced by the new 'use strict' check.
603 ## 4.0.5 (2017-02-02)
607 Disallow parenthesized pattern expressions.
609 Allow keywords as export names.
611 Don't allow the `async` keyword to be parenthesized.
613 Properly raise an error when a keyword contains a character escape.
615 Allow `"use strict"` to appear after other string literal expressions.
617 Disallow labeled declarations.
619 ## 4.0.4 (2016-12-19)
623 Fix crash when `export` was followed by a keyword that can't be
626 ## 4.0.3 (2016-08-16)
630 Allow regular function declarations inside single-statement `if` branches in loose mode. Forbid them entirely in strict mode.
632 Properly parse properties named `async` in ES2017 mode.
634 Fix bug where reserved words were broken in ES2017 mode.
636 ## 4.0.2 (2016-08-11)
640 Don't ignore period or 'e' characters after octal numbers.
642 Fix broken parsing for call expressions in default parameter values of arrow functions.
644 ## 4.0.1 (2016-08-08)
648 Fix false positives in duplicated export name errors.
650 ## 4.0.0 (2016-08-07)
654 The default `ecmaVersion` option value is now 7.
656 A number of internal method signatures changed, so plugins might need to be updated.
660 The parser now raises errors on duplicated export names.
662 `arguments` and `eval` can now be used in shorthand properties.
664 Duplicate parameter names in non-simple argument lists now always produce an error.
668 The `ecmaVersion` option now also accepts year-style version numbers
671 Support for `async`/`await` syntax when `ecmaVersion` is >= 8.
673 Support for trailing commas in call expressions when `ecmaVersion` is >= 8.
675 ## 3.3.0 (2016-07-25)
679 Fix bug in tokenizing of regexp operator after a function declaration.
681 Fix parser crash when parsing an array pattern with a hole.
685 Implement check against complex argument lists in functions that enable strict mode in ES7.
687 ## 3.2.0 (2016-06-07)
691 Improve handling of lack of unicode regexp support in host
694 Properly reject shorthand properties whose name is a keyword.
698 Visitors created with `visit.make` now have their base as _prototype_, rather than copying properties into a fresh object.
700 ## 3.1.0 (2016-04-18)
704 Properly tokenize the division operator directly after a function expression.
706 Allow trailing comma in destructuring arrays.
708 ## 3.0.4 (2016-02-25)
712 Allow update expressions as left-hand-side of the ES7 exponential operator.
714 ## 3.0.2 (2016-02-10)
718 Fix bug that accidentally made `undefined` a reserved word when parsing ES7.
720 ## 3.0.0 (2016-02-10)
724 The default value of the `ecmaVersion` option is now 6 (used to be 5).
726 Support for comprehension syntax (which was dropped from the draft spec) has been removed.
730 `let` and `yield` are now “contextual keywords”, meaning you can mostly use them as identifiers in ES5 non-strict code.
732 A parenthesized class or function expression after `export default` is now parsed correctly.
736 When `ecmaVersion` is set to 7, Acorn will parse the exponentiation operator (`**`).
738 The identifier character ranges are now based on Unicode 8.0.0.
740 Plugins can now override the `raiseRecoverable` method to override the way non-critical errors are handled.
742 ## 2.7.0 (2016-01-04)
746 Stop allowing rest parameters in setters.
748 Disallow `y` rexexp flag in ES5.
750 Disallow `\00` and `\000` escapes in strict mode.
752 Raise an error when an import name is a reserved word.
754 ## 2.6.2 (2015-11-10)
758 Don't crash when no options object is passed.
760 ## 2.6.0 (2015-11-09)
764 Add `await` as a reserved word in module sources.
766 Disallow `yield` in a parameter default value for a generator.
768 Forbid using a comma after a rest pattern in an array destructuring.
772 Support parsing stdin in command-line tool.
774 ## 2.5.0 (2015-10-27)
778 Fix tokenizer support in the command-line tool.
780 Stop allowing `new.target` outside of functions.
782 Remove legacy `guard` and `guardedHandler` properties from try nodes.
784 Stop allowing multiple `__proto__` properties on an object literal in strict mode.
786 Don't allow rest parameters to be non-identifier patterns.
788 Check for duplicate paramter names in arrow functions.