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