5 Make the string in the `version` export match the actual library version.
11 Fix a bug that caused parsing of object patterns with a property named `set` that had a default value to fail.
15 Add support for optional chaining (`?.`).
21 Fix precedence issue in parsing of async arrow functions.
25 Add support for nullish coalescing.
27 Add support for `import.meta`.
29 Support `export * as ...` syntax.
31 Upgrade to Unicode 13.
37 More carefully check for valid UTF16 surrogate pairs in regexp validator.
43 Treat `\8` and `\9` as invalid escapes in template strings.
45 Allow unicode escapes in property names that are keywords.
47 Don't error on an exponential operator expression as argument to `await`.
49 More carefully check for valid UTF16 surrogate pairs in regexp validator.
55 Disallow trailing object literal commas when ecmaVersion is less than 5.
59 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.
65 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).
67 Makes 10 (ES2019) the default value for the `ecmaVersion` option.
73 `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.
79 Fix bug causing Acorn to treat some characters as identifier characters that shouldn't be treated as such.
81 Fix issue where setting the `allowReserved` option to `"never"` allowed reserved words in some circumstances.
87 Improve valid assignment checking in `for`/`in` and `for`/`of` loops.
89 Disallow binding `let` in patterns.
93 Support bigint syntax with `ecmaVersion` >= 11.
95 Support dynamic `import` syntax with `ecmaVersion` >= 11.
97 Upgrade to Unicode version 12.
103 Fix bug that caused parsing default exports of with names to fail.
105 ## 6.1.0 (2019-02-08)
109 Fix scope checking when redefining a `var` as a lexical binding.
113 Split up `parseSubscripts` to use an internal `parseSubscript` method to make it easier to extend with plugins.
115 ## 6.0.7 (2019-02-04)
119 Check that exported bindings are defined.
121 Don't treat `\u180e` as a whitespace character.
123 Check for duplicate parameter names in methods.
125 Don't allow shorthand properties when they are generators or async methods.
127 Forbid binding `await` in async arrow function's parameter list.
129 ## 6.0.6 (2019-01-30)
133 The content of class declarations and expressions is now always parsed in strict mode.
135 Don't allow `let` or `const` to bind the variable name `let`.
137 Treat class declarations as lexical.
139 Don't allow a generator function declaration as the sole body of an `if` or `else`.
141 Ignore `"use strict"` when after an empty statement.
143 Allow string line continuations with special line terminator characters.
145 Treat `for` bodies as part of the `for` scope when checking for conflicting bindings.
147 Fix bug with parsing `yield` in a `for` loop initializer.
149 Implement special cases around scope checking for functions.
151 ## 6.0.5 (2019-01-02)
155 Fix TypeScript type for `Parser.extend` and add `allowAwaitOutsideFunction` to options type.
157 Don't treat `let` as a keyword when the next token is `{` on the next line.
159 Fix bug that broke checking for parentheses around an object pattern in a destructuring assignment when `preserveParens` was on.
161 ## 6.0.4 (2018-11-05)
165 Further improvements to tokenizing regular expressions in corner cases.
167 ## 6.0.3 (2018-11-04)
171 Fix bug in tokenizing an expression-less return followed by a function followed by a regular expression.
173 Remove stray symlink in the package tarball.
175 ## 6.0.2 (2018-09-26)
179 Fix bug where default expressions could fail to parse inside an object destructuring assignment expression.
181 ## 6.0.1 (2018-09-14)
185 Fix wrong value in `version` export.
187 ## 6.0.0 (2018-09-14)
191 Better handle variable-redefinition checks for catch bindings and functions directly under if statements.
193 Forbid `new.target` in top-level arrow functions.
195 Fix issue with parsing a regexp after `yield` in some contexts.
199 The package now comes with TypeScript definitions.
203 The default value of the `ecmaVersion` option is now 9 (2018).
205 Plugins work differently, and will have to be rewritten to work with this version.
207 The loose parser and walker have been moved into separate packages (`acorn-loose` and `acorn-walk`).
209 ## 5.7.3 (2018-09-10)
213 Fix failure to tokenize regexps after expressions like `x.of`.
215 Better error message for unterminated template literals.
217 ## 5.7.2 (2018-08-24)
221 Properly handle `allowAwaitOutsideFunction` in for statements.
223 Treat function declarations at the top level of modules like let bindings.
225 Don't allow async function declarations as the only statement under a label.
227 ## 5.7.0 (2018-06-15)
231 Upgraded to Unicode 11.
233 ## 5.6.0 (2018-05-31)
237 Allow U+2028 and U+2029 in string when ECMAVersion >= 10.
239 Allow binding-less catch statements when ECMAVersion >= 10.
241 Add `allowAwaitOutsideFunction` option for parsing top-level `await`.
243 ## 5.5.3 (2018-03-08)
247 A _second_ republish of the code in 5.5.1, this time with yarn, to hopefully get valid timestamps.
249 ## 5.5.2 (2018-03-08)
253 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.
255 ## 5.5.1 (2018-03-06)
259 Fix misleading error message for octal escapes in template strings.
261 ## 5.5.0 (2018-02-27)
265 The identifier character categorization is now based on Unicode version 10.
267 Acorn will now validate the content of regular expressions, including new ES9 features.
269 ## 5.4.0 (2018-02-01)
273 Disallow duplicate or escaped flags on regular expressions.
275 Disallow octal escapes in strings in strict mode.
279 Add support for async iteration.
281 Add support for object spread and rest.
283 ## 5.3.0 (2017-12-28)
287 Fix parsing of floating point literals with leading zeroes in loose mode.
289 Allow duplicate property names in object patterns.
291 Don't allow static class methods named `prototype`.
293 Disallow async functions directly under `if` or `else`.
295 Parse right-hand-side of `for`/`of` as an assignment expression.
297 Stricter parsing of `for`/`in`.
299 Don't allow unicode escapes in contextual keywords.
303 Parsing class members was factored into smaller methods to allow plugins to hook into it.
305 ## 5.2.1 (2017-10-30)
309 Fix a token context corruption bug.
311 ## 5.2.0 (2017-10-30)
315 Fix token context tracking for `class` and `function` in property-name position.
317 Make sure `%*` isn't parsed as a valid operator.
319 Allow shorthand properties `get` and `set` to be followed by default values.
321 Disallow `super` when not in callee or object position.
325 Support [`directive` property](https://github.com/estree/estree/compare/b3de58c9997504d6fba04b72f76e6dd1619ee4eb...1da8e603237144f44710360f8feb7a9977e905e0) on directive expression statements.
327 ## 5.1.2 (2017-09-04)
331 Disable parsing of legacy HTML-style comments in modules.
333 Fix parsing of async methods whose names are keywords.
335 ## 5.1.1 (2017-07-06)
339 Fix problem with disambiguating regexp and division after a class.
341 ## 5.1.0 (2017-07-05)
345 Fix tokenizing of regexps in an object-desctructuring `for`/`of` loop and after `yield`.
347 Parse zero-prefixed numbers with non-octal digits as decimal.
349 Allow object/array patterns in rest parameters.
351 Don't error when `yield` is used as a property name.
353 Allow `async` as a shorthand object property.
357 Implement the [template literal revision proposal](https://github.com/tc39/proposal-template-literal-revision) for ES9.
359 ## 5.0.3 (2017-04-01)
363 Fix spurious duplicate variable definition errors for named functions.
365 ## 5.0.2 (2017-03-30)
369 A binary operator after a parenthesized arrow expression is no longer incorrectly treated as an error.
371 ## 5.0.0 (2017-03-28)
375 Raise an error for duplicated lexical bindings.
377 Fix spurious error when an assignement expression occurred after a spread expression.
379 Accept regular expressions after `of` (in `for`/`of`), `yield` (in a generator), and braced arrow functions.
381 Allow labels in front or `var` declarations, even in strict mode.
385 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`.
387 ## 4.0.11 (2017-02-07)
391 Allow all forms of member expressions to be parenthesized as lvalue.
393 ## 4.0.10 (2017-02-07)
397 Don't expect semicolons after default-exported functions or classes, even when they are expressions.
399 Check for use of `'use strict'` directives in non-simple parameter functions, even when already in strict mode.
401 ## 4.0.9 (2017-02-06)
405 Fix incorrect error raised for parenthesized simple assignment targets, so that `(x) = 1` parses again.
407 ## 4.0.8 (2017-02-03)
411 Solve spurious parenthesized pattern errors by temporarily erring on the side of accepting programs that our delayed errors don't handle correctly yet.
413 ## 4.0.7 (2017-02-02)
417 Accept invalidly rejected code like `(x).y = 2` again.
419 Don't raise an error when a function _inside_ strict code has a non-simple parameter list.
421 ## 4.0.6 (2017-02-02)
425 Fix exponential behavior (manifesting itself as a complete hang for even relatively small source files) introduced by the new 'use strict' check.
427 ## 4.0.5 (2017-02-02)
431 Disallow parenthesized pattern expressions.
433 Allow keywords as export names.
435 Don't allow the `async` keyword to be parenthesized.
437 Properly raise an error when a keyword contains a character escape.
439 Allow `"use strict"` to appear after other string literal expressions.
441 Disallow labeled declarations.
443 ## 4.0.4 (2016-12-19)
447 Fix crash when `export` was followed by a keyword that can't be
450 ## 4.0.3 (2016-08-16)
454 Allow regular function declarations inside single-statement `if` branches in loose mode. Forbid them entirely in strict mode.
456 Properly parse properties named `async` in ES2017 mode.
458 Fix bug where reserved words were broken in ES2017 mode.
460 ## 4.0.2 (2016-08-11)
464 Don't ignore period or 'e' characters after octal numbers.
466 Fix broken parsing for call expressions in default parameter values of arrow functions.
468 ## 4.0.1 (2016-08-08)
472 Fix false positives in duplicated export name errors.
474 ## 4.0.0 (2016-08-07)
478 The default `ecmaVersion` option value is now 7.
480 A number of internal method signatures changed, so plugins might need to be updated.
484 The parser now raises errors on duplicated export names.
486 `arguments` and `eval` can now be used in shorthand properties.
488 Duplicate parameter names in non-simple argument lists now always produce an error.
492 The `ecmaVersion` option now also accepts year-style version numbers
495 Support for `async`/`await` syntax when `ecmaVersion` is >= 8.
497 Support for trailing commas in call expressions when `ecmaVersion` is >= 8.
499 ## 3.3.0 (2016-07-25)
503 Fix bug in tokenizing of regexp operator after a function declaration.
505 Fix parser crash when parsing an array pattern with a hole.
509 Implement check against complex argument lists in functions that enable strict mode in ES7.
511 ## 3.2.0 (2016-06-07)
515 Improve handling of lack of unicode regexp support in host
518 Properly reject shorthand properties whose name is a keyword.
522 Visitors created with `visit.make` now have their base as _prototype_, rather than copying properties into a fresh object.
524 ## 3.1.0 (2016-04-18)
528 Properly tokenize the division operator directly after a function expression.
530 Allow trailing comma in destructuring arrays.
532 ## 3.0.4 (2016-02-25)
536 Allow update expressions as left-hand-side of the ES7 exponential operator.
538 ## 3.0.2 (2016-02-10)
542 Fix bug that accidentally made `undefined` a reserved word when parsing ES7.
544 ## 3.0.0 (2016-02-10)
548 The default value of the `ecmaVersion` option is now 6 (used to be 5).
550 Support for comprehension syntax (which was dropped from the draft spec) has been removed.
554 `let` and `yield` are now “contextual keywords”, meaning you can mostly use them as identifiers in ES5 non-strict code.
556 A parenthesized class or function expression after `export default` is now parsed correctly.
560 When `ecmaVersion` is set to 7, Acorn will parse the exponentiation operator (`**`).
562 The identifier character ranges are now based on Unicode 8.0.0.
564 Plugins can now override the `raiseRecoverable` method to override the way non-critical errors are handled.
566 ## 2.7.0 (2016-01-04)
570 Stop allowing rest parameters in setters.
572 Disallow `y` rexexp flag in ES5.
574 Disallow `\00` and `\000` escapes in strict mode.
576 Raise an error when an import name is a reserved word.
578 ## 2.6.2 (2015-11-10)
582 Don't crash when no options object is passed.
584 ## 2.6.0 (2015-11-09)
588 Add `await` as a reserved word in module sources.
590 Disallow `yield` in a parameter default value for a generator.
592 Forbid using a comma after a rest pattern in an array destructuring.
596 Support parsing stdin in command-line tool.
598 ## 2.5.0 (2015-10-27)
602 Fix tokenizer support in the command-line tool.
604 Stop allowing `new.target` outside of functions.
606 Remove legacy `guard` and `guardedHandler` properties from try nodes.
608 Stop allowing multiple `__proto__` properties on an object literal in strict mode.
610 Don't allow rest parameters to be non-identifier patterns.
612 Check for duplicate paramter names in arrow functions.