1## 8.4.1 (2021-06-24) 2 3### Bug fixes 4 5Fix 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. 6 7## 8.4.0 (2021-06-11) 8 9### New features 10 11A new option, `allowSuperOutsideMethod`, can be used to suppress the error when `super` is used in the wrong context. 12 13## 8.3.0 (2021-05-31) 14 15### New features 16 17Default `allowAwaitOutsideFunction` to true for ECMAScript 2022 an higher. 18 19Add support for the `p` ([indices](https://github.com/tc39/proposal-regexp-match-indices)) regexp flag. 20 21## 8.2.4 (2021-05-04) 22 23### Bug fixes 24 25Fix spec conformity in corner case 'for await (async of ...)'. 26 27## 8.2.3 (2021-05-04) 28 29### Bug fixes 30 31Fix an issue where the library couldn't parse 'for (async of ...)'. 32 33Fix a bug in UTF-16 decoding that would read characters incorrectly in some circumstances. 34 35## 8.2.2 (2021-04-29) 36 37### Bug fixes 38 39Fix 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. 40 41## 8.2.1 (2021-04-24) 42 43### Bug fixes 44 45Fix a regression introduced in 8.2.0 where static or async class methods with keyword names fail to parse. 46 47## 8.2.0 (2021-04-24) 48 49### New features 50 51Add support for ES2022 class fields and private methods. 52 53## 8.1.1 (2021-04-12) 54 55### Various 56 57Stop shipping source maps in the NPM package. 58 59## 8.1.0 (2021-03-09) 60 61### Bug fixes 62 63Fix a spurious error in nested destructuring arrays. 64 65### New features 66 67Expose `allowAwaitOutsideFunction` in CLI interface. 68 69Make `allowImportExportAnywhere` also apply to `import.meta`. 70 71## 8.0.5 (2021-01-25) 72 73### Bug fixes 74 75Adjust package.json to work with Node 12.16.0 and 13.0-13.6. 76 77## 8.0.4 (2020-10-05) 78 79### Bug fixes 80 81Make `await x ** y` an error, following the spec. 82 83Fix potentially exponential regular expression. 84 85## 8.0.3 (2020-10-02) 86 87### Bug fixes 88 89Fix a wasteful loop during `Parser` creation when setting `ecmaVersion` to `"latest"`. 90 91## 8.0.2 (2020-09-30) 92 93### Bug fixes 94 95Make the TypeScript types reflect the current allowed values for `ecmaVersion`. 96 97Fix another regexp/division tokenizer issue. 98 99## 8.0.1 (2020-08-12) 100 101### Bug fixes 102 103Provide the correct value in the `version` export. 104 105## 8.0.0 (2020-08-12) 106 107### Bug fixes 108 109Disallow expressions like `(a = b) = c`. 110 111Make non-octal escape sequences a syntax error in strict mode. 112 113### New features 114 115The package can now be loaded directly as an ECMAScript module in node 13+. 116 117Update to the set of Unicode properties from ES2021. 118 119### Breaking changes 120 121The `ecmaVersion` option is now required. For the moment, omitting it will still work with a warning, but that will change in a future release. 122 123Some changes to method signatures that may be used by plugins. 124 125## 7.4.0 (2020-08-03) 126 127### New features 128 129Add support for logical assignment operators. 130 131Add support for numeric separators. 132 133## 7.3.1 (2020-06-11) 134 135### Bug fixes 136 137Make the string in the `version` export match the actual library version. 138 139## 7.3.0 (2020-06-11) 140 141### Bug fixes 142 143Fix a bug that caused parsing of object patterns with a property named `set` that had a default value to fail. 144 145### New features 146 147Add support for optional chaining (`?.`). 148 149## 7.2.0 (2020-05-09) 150 151### Bug fixes 152 153Fix precedence issue in parsing of async arrow functions. 154 155### New features 156 157Add support for nullish coalescing. 158 159Add support for `import.meta`. 160 161Support `export * as ...` syntax. 162 163Upgrade to Unicode 13. 164 165## 6.4.1 (2020-03-09) 166 167### Bug fixes 168 169More carefully check for valid UTF16 surrogate pairs in regexp validator. 170 171## 7.1.1 (2020-03-01) 172 173### Bug fixes 174 175Treat `\8` and `\9` as invalid escapes in template strings. 176 177Allow unicode escapes in property names that are keywords. 178 179Don't error on an exponential operator expression as argument to `await`. 180 181More carefully check for valid UTF16 surrogate pairs in regexp validator. 182 183## 7.1.0 (2019-09-24) 184 185### Bug fixes 186 187Disallow trailing object literal commas when ecmaVersion is less than 5. 188 189### New features 190 191Add 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. 192 193## 7.0.0 (2019-08-13) 194 195### Breaking changes 196 197Changes 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). 198 199Makes 10 (ES2019) the default value for the `ecmaVersion` option. 200 201## 6.3.0 (2019-08-12) 202 203### New features 204 205`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. 206 207## 6.2.1 (2019-07-21) 208 209### Bug fixes 210 211Fix bug causing Acorn to treat some characters as identifier characters that shouldn't be treated as such. 212 213Fix issue where setting the `allowReserved` option to `"never"` allowed reserved words in some circumstances. 214 215## 6.2.0 (2019-07-04) 216 217### Bug fixes 218 219Improve valid assignment checking in `for`/`in` and `for`/`of` loops. 220 221Disallow binding `let` in patterns. 222 223### New features 224 225Support bigint syntax with `ecmaVersion` >= 11. 226 227Support dynamic `import` syntax with `ecmaVersion` >= 11. 228 229Upgrade to Unicode version 12. 230 231## 6.1.1 (2019-02-27) 232 233### Bug fixes 234 235Fix bug that caused parsing default exports of with names to fail. 236 237## 6.1.0 (2019-02-08) 238 239### Bug fixes 240 241Fix scope checking when redefining a `var` as a lexical binding. 242 243### New features 244 245Split up `parseSubscripts` to use an internal `parseSubscript` method to make it easier to extend with plugins. 246 247## 6.0.7 (2019-02-04) 248 249### Bug fixes 250 251Check that exported bindings are defined. 252 253Don't treat `\u180e` as a whitespace character. 254 255Check for duplicate parameter names in methods. 256 257Don't allow shorthand properties when they are generators or async methods. 258 259Forbid binding `await` in async arrow function's parameter list. 260 261## 6.0.6 (2019-01-30) 262 263### Bug fixes 264 265The content of class declarations and expressions is now always parsed in strict mode. 266 267Don't allow `let` or `const` to bind the variable name `let`. 268 269Treat class declarations as lexical. 270 271Don't allow a generator function declaration as the sole body of an `if` or `else`. 272 273Ignore `"use strict"` when after an empty statement. 274 275Allow string line continuations with special line terminator characters. 276 277Treat `for` bodies as part of the `for` scope when checking for conflicting bindings. 278 279Fix bug with parsing `yield` in a `for` loop initializer. 280 281Implement special cases around scope checking for functions. 282 283## 6.0.5 (2019-01-02) 284 285### Bug fixes 286 287Fix TypeScript type for `Parser.extend` and add `allowAwaitOutsideFunction` to options type. 288 289Don't treat `let` as a keyword when the next token is `{` on the next line. 290 291Fix bug that broke checking for parentheses around an object pattern in a destructuring assignment when `preserveParens` was on. 292 293## 6.0.4 (2018-11-05) 294 295### Bug fixes 296 297Further improvements to tokenizing regular expressions in corner cases. 298 299## 6.0.3 (2018-11-04) 300 301### Bug fixes 302 303Fix bug in tokenizing an expression-less return followed by a function followed by a regular expression. 304 305Remove stray symlink in the package tarball. 306 307## 6.0.2 (2018-09-26) 308 309### Bug fixes 310 311Fix bug where default expressions could fail to parse inside an object destructuring assignment expression. 312 313## 6.0.1 (2018-09-14) 314 315### Bug fixes 316 317Fix wrong value in `version` export. 318 319## 6.0.0 (2018-09-14) 320 321### Bug fixes 322 323Better handle variable-redefinition checks for catch bindings and functions directly under if statements. 324 325Forbid `new.target` in top-level arrow functions. 326 327Fix issue with parsing a regexp after `yield` in some contexts. 328 329### New features 330 331The package now comes with TypeScript definitions. 332 333### Breaking changes 334 335The default value of the `ecmaVersion` option is now 9 (2018). 336 337Plugins work differently, and will have to be rewritten to work with this version. 338 339The loose parser and walker have been moved into separate packages (`acorn-loose` and `acorn-walk`). 340 341## 5.7.3 (2018-09-10) 342 343### Bug fixes 344 345Fix failure to tokenize regexps after expressions like `x.of`. 346 347Better error message for unterminated template literals. 348 349## 5.7.2 (2018-08-24) 350 351### Bug fixes 352 353Properly handle `allowAwaitOutsideFunction` in for statements. 354 355Treat function declarations at the top level of modules like let bindings. 356 357Don't allow async function declarations as the only statement under a label. 358 359## 5.7.0 (2018-06-15) 360 361### New features 362 363Upgraded to Unicode 11. 364 365## 5.6.0 (2018-05-31) 366 367### New features 368 369Allow U+2028 and U+2029 in string when ECMAVersion >= 10. 370 371Allow binding-less catch statements when ECMAVersion >= 10. 372 373Add `allowAwaitOutsideFunction` option for parsing top-level `await`. 374 375## 5.5.3 (2018-03-08) 376 377### Bug fixes 378 379A _second_ republish of the code in 5.5.1, this time with yarn, to hopefully get valid timestamps. 380 381## 5.5.2 (2018-03-08) 382 383### Bug fixes 384 385A 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. 386 387## 5.5.1 (2018-03-06) 388 389### Bug fixes 390 391Fix misleading error message for octal escapes in template strings. 392 393## 5.5.0 (2018-02-27) 394 395### New features 396 397The identifier character categorization is now based on Unicode version 10. 398 399Acorn will now validate the content of regular expressions, including new ES9 features. 400 401## 5.4.0 (2018-02-01) 402 403### Bug fixes 404 405Disallow duplicate or escaped flags on regular expressions. 406 407Disallow octal escapes in strings in strict mode. 408 409### New features 410 411Add support for async iteration. 412 413Add support for object spread and rest. 414 415## 5.3.0 (2017-12-28) 416 417### Bug fixes 418 419Fix parsing of floating point literals with leading zeroes in loose mode. 420 421Allow duplicate property names in object patterns. 422 423Don't allow static class methods named `prototype`. 424 425Disallow async functions directly under `if` or `else`. 426 427Parse right-hand-side of `for`/`of` as an assignment expression. 428 429Stricter parsing of `for`/`in`. 430 431Don't allow unicode escapes in contextual keywords. 432 433### New features 434 435Parsing class members was factored into smaller methods to allow plugins to hook into it. 436 437## 5.2.1 (2017-10-30) 438 439### Bug fixes 440 441Fix a token context corruption bug. 442 443## 5.2.0 (2017-10-30) 444 445### Bug fixes 446 447Fix token context tracking for `class` and `function` in property-name position. 448 449Make sure `%*` isn't parsed as a valid operator. 450 451Allow shorthand properties `get` and `set` to be followed by default values. 452 453Disallow `super` when not in callee or object position. 454 455### New features 456 457Support [`directive` property](https://github.com/estree/estree/compare/b3de58c9997504d6fba04b72f76e6dd1619ee4eb...1da8e603237144f44710360f8feb7a9977e905e0) on directive expression statements. 458 459## 5.1.2 (2017-09-04) 460 461### Bug fixes 462 463Disable parsing of legacy HTML-style comments in modules. 464 465Fix parsing of async methods whose names are keywords. 466 467## 5.1.1 (2017-07-06) 468 469### Bug fixes 470 471Fix problem with disambiguating regexp and division after a class. 472 473## 5.1.0 (2017-07-05) 474 475### Bug fixes 476 477Fix tokenizing of regexps in an object-desctructuring `for`/`of` loop and after `yield`. 478 479Parse zero-prefixed numbers with non-octal digits as decimal. 480 481Allow object/array patterns in rest parameters. 482 483Don't error when `yield` is used as a property name. 484 485Allow `async` as a shorthand object property. 486 487### New features 488 489Implement the [template literal revision proposal](https://github.com/tc39/proposal-template-literal-revision) for ES9. 490 491## 5.0.3 (2017-04-01) 492 493### Bug fixes 494 495Fix spurious duplicate variable definition errors for named functions. 496 497## 5.0.2 (2017-03-30) 498 499### Bug fixes 500 501A binary operator after a parenthesized arrow expression is no longer incorrectly treated as an error. 502 503## 5.0.0 (2017-03-28) 504 505### Bug fixes 506 507Raise an error for duplicated lexical bindings. 508 509Fix spurious error when an assignement expression occurred after a spread expression. 510 511Accept regular expressions after `of` (in `for`/`of`), `yield` (in a generator), and braced arrow functions. 512 513Allow labels in front or `var` declarations, even in strict mode. 514 515### Breaking changes 516 517Parse declarations following `export default` as declaration nodes, not expressions. This means that class and function declarations nodes can now have `null` as their `id`. 518 519## 4.0.11 (2017-02-07) 520 521### Bug fixes 522 523Allow all forms of member expressions to be parenthesized as lvalue. 524 525## 4.0.10 (2017-02-07) 526 527### Bug fixes 528 529Don't expect semicolons after default-exported functions or classes, even when they are expressions. 530 531Check for use of `'use strict'` directives in non-simple parameter functions, even when already in strict mode. 532 533## 4.0.9 (2017-02-06) 534 535### Bug fixes 536 537Fix incorrect error raised for parenthesized simple assignment targets, so that `(x) = 1` parses again. 538 539## 4.0.8 (2017-02-03) 540 541### Bug fixes 542 543Solve spurious parenthesized pattern errors by temporarily erring on the side of accepting programs that our delayed errors don't handle correctly yet. 544 545## 4.0.7 (2017-02-02) 546 547### Bug fixes 548 549Accept invalidly rejected code like `(x).y = 2` again. 550 551Don't raise an error when a function _inside_ strict code has a non-simple parameter list. 552 553## 4.0.6 (2017-02-02) 554 555### Bug fixes 556 557Fix exponential behavior (manifesting itself as a complete hang for even relatively small source files) introduced by the new 'use strict' check. 558 559## 4.0.5 (2017-02-02) 560 561### Bug fixes 562 563Disallow parenthesized pattern expressions. 564 565Allow keywords as export names. 566 567Don't allow the `async` keyword to be parenthesized. 568 569Properly raise an error when a keyword contains a character escape. 570 571Allow `"use strict"` to appear after other string literal expressions. 572 573Disallow labeled declarations. 574 575## 4.0.4 (2016-12-19) 576 577### Bug fixes 578 579Fix crash when `export` was followed by a keyword that can't be 580exported. 581 582## 4.0.3 (2016-08-16) 583 584### Bug fixes 585 586Allow regular function declarations inside single-statement `if` branches in loose mode. Forbid them entirely in strict mode. 587 588Properly parse properties named `async` in ES2017 mode. 589 590Fix bug where reserved words were broken in ES2017 mode. 591 592## 4.0.2 (2016-08-11) 593 594### Bug fixes 595 596Don't ignore period or 'e' characters after octal numbers. 597 598Fix broken parsing for call expressions in default parameter values of arrow functions. 599 600## 4.0.1 (2016-08-08) 601 602### Bug fixes 603 604Fix false positives in duplicated export name errors. 605 606## 4.0.0 (2016-08-07) 607 608### Breaking changes 609 610The default `ecmaVersion` option value is now 7. 611 612A number of internal method signatures changed, so plugins might need to be updated. 613 614### Bug fixes 615 616The parser now raises errors on duplicated export names. 617 618`arguments` and `eval` can now be used in shorthand properties. 619 620Duplicate parameter names in non-simple argument lists now always produce an error. 621 622### New features 623 624The `ecmaVersion` option now also accepts year-style version numbers 625(2015, etc). 626 627Support for `async`/`await` syntax when `ecmaVersion` is >= 8. 628 629Support for trailing commas in call expressions when `ecmaVersion` is >= 8. 630 631## 3.3.0 (2016-07-25) 632 633### Bug fixes 634 635Fix bug in tokenizing of regexp operator after a function declaration. 636 637Fix parser crash when parsing an array pattern with a hole. 638 639### New features 640 641Implement check against complex argument lists in functions that enable strict mode in ES7. 642 643## 3.2.0 (2016-06-07) 644 645### Bug fixes 646 647Improve handling of lack of unicode regexp support in host 648environment. 649 650Properly reject shorthand properties whose name is a keyword. 651 652### New features 653 654Visitors created with `visit.make` now have their base as _prototype_, rather than copying properties into a fresh object. 655 656## 3.1.0 (2016-04-18) 657 658### Bug fixes 659 660Properly tokenize the division operator directly after a function expression. 661 662Allow trailing comma in destructuring arrays. 663 664## 3.0.4 (2016-02-25) 665 666### Fixes 667 668Allow update expressions as left-hand-side of the ES7 exponential operator. 669 670## 3.0.2 (2016-02-10) 671 672### Fixes 673 674Fix bug that accidentally made `undefined` a reserved word when parsing ES7. 675 676## 3.0.0 (2016-02-10) 677 678### Breaking changes 679 680The default value of the `ecmaVersion` option is now 6 (used to be 5). 681 682Support for comprehension syntax (which was dropped from the draft spec) has been removed. 683 684### Fixes 685 686`let` and `yield` are now “contextual keywords”, meaning you can mostly use them as identifiers in ES5 non-strict code. 687 688A parenthesized class or function expression after `export default` is now parsed correctly. 689 690### New features 691 692When `ecmaVersion` is set to 7, Acorn will parse the exponentiation operator (`**`). 693 694The identifier character ranges are now based on Unicode 8.0.0. 695 696Plugins can now override the `raiseRecoverable` method to override the way non-critical errors are handled. 697 698## 2.7.0 (2016-01-04) 699 700### Fixes 701 702Stop allowing rest parameters in setters. 703 704Disallow `y` rexexp flag in ES5. 705 706Disallow `\00` and `\000` escapes in strict mode. 707 708Raise an error when an import name is a reserved word. 709 710## 2.6.2 (2015-11-10) 711 712### Fixes 713 714Don't crash when no options object is passed. 715 716## 2.6.0 (2015-11-09) 717 718### Fixes 719 720Add `await` as a reserved word in module sources. 721 722Disallow `yield` in a parameter default value for a generator. 723 724Forbid using a comma after a rest pattern in an array destructuring. 725 726### New features 727 728Support parsing stdin in command-line tool. 729 730## 2.5.0 (2015-10-27) 731 732### Fixes 733 734Fix tokenizer support in the command-line tool. 735 736Stop allowing `new.target` outside of functions. 737 738Remove legacy `guard` and `guardedHandler` properties from try nodes. 739 740Stop allowing multiple `__proto__` properties on an object literal in strict mode. 741 742Don't allow rest parameters to be non-identifier patterns. 743 744Check for duplicate paramter names in arrow functions. 745