You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

620 lines
14 KiB

4 years ago
  1. ## 7.4.0 (2020-08-03)
  2. ### New features
  3. Add support for logical assignment operators.
  4. Add support for numeric separators.
  5. ## 7.3.1 (2020-06-11)
  6. ### Bug fixes
  7. Make the string in the `version` export match the actual library version.
  8. ## 7.3.0 (2020-06-11)
  9. ### Bug fixes
  10. Fix a bug that caused parsing of object patterns with a property named `set` that had a default value to fail.
  11. ### New features
  12. Add support for optional chaining (`?.`).
  13. ## 7.2.0 (2020-05-09)
  14. ### Bug fixes
  15. Fix precedence issue in parsing of async arrow functions.
  16. ### New features
  17. Add support for nullish coalescing.
  18. Add support for `import.meta`.
  19. Support `export * as ...` syntax.
  20. Upgrade to Unicode 13.
  21. ## 6.4.1 (2020-03-09)
  22. ### Bug fixes
  23. More carefully check for valid UTF16 surrogate pairs in regexp validator.
  24. ## 7.1.1 (2020-03-01)
  25. ### Bug fixes
  26. Treat `\8` and `\9` as invalid escapes in template strings.
  27. Allow unicode escapes in property names that are keywords.
  28. Don't error on an exponential operator expression as argument to `await`.
  29. More carefully check for valid UTF16 surrogate pairs in regexp validator.
  30. ## 7.1.0 (2019-09-24)
  31. ### Bug fixes
  32. Disallow trailing object literal commas when ecmaVersion is less than 5.
  33. ### New features
  34. 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.
  35. ## 7.0.0 (2019-08-13)
  36. ### Breaking changes
  37. 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).
  38. Makes 10 (ES2019) the default value for the `ecmaVersion` option.
  39. ## 6.3.0 (2019-08-12)
  40. ### New features
  41. `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.
  42. ## 6.2.1 (2019-07-21)
  43. ### Bug fixes
  44. Fix bug causing Acorn to treat some characters as identifier characters that shouldn't be treated as such.
  45. Fix issue where setting the `allowReserved` option to `"never"` allowed reserved words in some circumstances.
  46. ## 6.2.0 (2019-07-04)
  47. ### Bug fixes
  48. Improve valid assignment checking in `for`/`in` and `for`/`of` loops.
  49. Disallow binding `let` in patterns.
  50. ### New features
  51. Support bigint syntax with `ecmaVersion` >= 11.
  52. Support dynamic `import` syntax with `ecmaVersion` >= 11.
  53. Upgrade to Unicode version 12.
  54. ## 6.1.1 (2019-02-27)
  55. ### Bug fixes
  56. Fix bug that caused parsing default exports of with names to fail.
  57. ## 6.1.0 (2019-02-08)
  58. ### Bug fixes
  59. Fix scope checking when redefining a `var` as a lexical binding.
  60. ### New features
  61. Split up `parseSubscripts` to use an internal `parseSubscript` method to make it easier to extend with plugins.
  62. ## 6.0.7 (2019-02-04)
  63. ### Bug fixes
  64. Check that exported bindings are defined.
  65. Don't treat `\u180e` as a whitespace character.
  66. Check for duplicate parameter names in methods.
  67. Don't allow shorthand properties when they are generators or async methods.
  68. Forbid binding `await` in async arrow function's parameter list.
  69. ## 6.0.6 (2019-01-30)
  70. ### Bug fixes
  71. The content of class declarations and expressions is now always parsed in strict mode.
  72. Don't allow `let` or `const` to bind the variable name `let`.
  73. Treat class declarations as lexical.
  74. Don't allow a generator function declaration as the sole body of an `if` or `else`.
  75. Ignore `"use strict"` when after an empty statement.
  76. Allow string line continuations with special line terminator characters.
  77. Treat `for` bodies as part of the `for` scope when checking for conflicting bindings.
  78. Fix bug with parsing `yield` in a `for` loop initializer.
  79. Implement special cases around scope checking for functions.
  80. ## 6.0.5 (2019-01-02)
  81. ### Bug fixes
  82. Fix TypeScript type for `Parser.extend` and add `allowAwaitOutsideFunction` to options type.
  83. Don't treat `let` as a keyword when the next token is `{` on the next line.
  84. Fix bug that broke checking for parentheses around an object pattern in a destructuring assignment when `preserveParens` was on.
  85. ## 6.0.4 (2018-11-05)
  86. ### Bug fixes
  87. Further improvements to tokenizing regular expressions in corner cases.
  88. ## 6.0.3 (2018-11-04)
  89. ### Bug fixes
  90. Fix bug in tokenizing an expression-less return followed by a function followed by a regular expression.
  91. Remove stray symlink in the package tarball.
  92. ## 6.0.2 (2018-09-26)
  93. ### Bug fixes
  94. Fix bug where default expressions could fail to parse inside an object destructuring assignment expression.
  95. ## 6.0.1 (2018-09-14)
  96. ### Bug fixes
  97. Fix wrong value in `version` export.
  98. ## 6.0.0 (2018-09-14)
  99. ### Bug fixes
  100. Better handle variable-redefinition checks for catch bindings and functions directly under if statements.
  101. Forbid `new.target` in top-level arrow functions.
  102. Fix issue with parsing a regexp after `yield` in some contexts.
  103. ### New features
  104. The package now comes with TypeScript definitions.
  105. ### Breaking changes
  106. The default value of the `ecmaVersion` option is now 9 (2018).
  107. Plugins work differently, and will have to be rewritten to work with this version.
  108. The loose parser and walker have been moved into separate packages (`acorn-loose` and `acorn-walk`).
  109. ## 5.7.3 (2018-09-10)
  110. ### Bug fixes
  111. Fix failure to tokenize regexps after expressions like `x.of`.
  112. Better error message for unterminated template literals.
  113. ## 5.7.2 (2018-08-24)
  114. ### Bug fixes
  115. Properly handle `allowAwaitOutsideFunction` in for statements.
  116. Treat function declarations at the top level of modules like let bindings.
  117. Don't allow async function declarations as the only statement under a label.
  118. ## 5.7.0 (2018-06-15)
  119. ### New features
  120. Upgraded to Unicode 11.
  121. ## 5.6.0 (2018-05-31)
  122. ### New features
  123. Allow U+2028 and U+2029 in string when ECMAVersion >= 10.
  124. Allow binding-less catch statements when ECMAVersion >= 10.
  125. Add `allowAwaitOutsideFunction` option for parsing top-level `await`.
  126. ## 5.5.3 (2018-03-08)
  127. ### Bug fixes
  128. A _second_ republish of the code in 5.5.1, this time with yarn, to hopefully get valid timestamps.
  129. ## 5.5.2 (2018-03-08)
  130. ### Bug fixes
  131. 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.
  132. ## 5.5.1 (2018-03-06)
  133. ### Bug fixes
  134. Fix misleading error message for octal escapes in template strings.
  135. ## 5.5.0 (2018-02-27)
  136. ### New features
  137. The identifier character categorization is now based on Unicode version 10.
  138. Acorn will now validate the content of regular expressions, including new ES9 features.
  139. ## 5.4.0 (2018-02-01)
  140. ### Bug fixes
  141. Disallow duplicate or escaped flags on regular expressions.
  142. Disallow octal escapes in strings in strict mode.
  143. ### New features
  144. Add support for async iteration.
  145. Add support for object spread and rest.
  146. ## 5.3.0 (2017-12-28)
  147. ### Bug fixes
  148. Fix parsing of floating point literals with leading zeroes in loose mode.
  149. Allow duplicate property names in object patterns.
  150. Don't allow static class methods named `prototype`.
  151. Disallow async functions directly under `if` or `else`.
  152. Parse right-hand-side of `for`/`of` as an assignment expression.
  153. Stricter parsing of `for`/`in`.
  154. Don't allow unicode escapes in contextual keywords.
  155. ### New features
  156. Parsing class members was factored into smaller methods to allow plugins to hook into it.
  157. ## 5.2.1 (2017-10-30)
  158. ### Bug fixes
  159. Fix a token context corruption bug.
  160. ## 5.2.0 (2017-10-30)
  161. ### Bug fixes
  162. Fix token context tracking for `class` and `function` in property-name position.
  163. Make sure `%*` isn't parsed as a valid operator.
  164. Allow shorthand properties `get` and `set` to be followed by default values.
  165. Disallow `super` when not in callee or object position.
  166. ### New features
  167. Support [`directive` property](https://github.com/estree/estree/compare/b3de58c9997504d6fba04b72f76e6dd1619ee4eb...1da8e603237144f44710360f8feb7a9977e905e0) on directive expression statements.
  168. ## 5.1.2 (2017-09-04)
  169. ### Bug fixes
  170. Disable parsing of legacy HTML-style comments in modules.
  171. Fix parsing of async methods whose names are keywords.
  172. ## 5.1.1 (2017-07-06)
  173. ### Bug fixes
  174. Fix problem with disambiguating regexp and division after a class.
  175. ## 5.1.0 (2017-07-05)
  176. ### Bug fixes
  177. Fix tokenizing of regexps in an object-desctructuring `for`/`of` loop and after `yield`.
  178. Parse zero-prefixed numbers with non-octal digits as decimal.
  179. Allow object/array patterns in rest parameters.
  180. Don't error when `yield` is used as a property name.
  181. Allow `async` as a shorthand object property.
  182. ### New features
  183. Implement the [template literal revision proposal](https://github.com/tc39/proposal-template-literal-revision) for ES9.
  184. ## 5.0.3 (2017-04-01)
  185. ### Bug fixes
  186. Fix spurious duplicate variable definition errors for named functions.
  187. ## 5.0.2 (2017-03-30)
  188. ### Bug fixes
  189. A binary operator after a parenthesized arrow expression is no longer incorrectly treated as an error.
  190. ## 5.0.0 (2017-03-28)
  191. ### Bug fixes
  192. Raise an error for duplicated lexical bindings.
  193. Fix spurious error when an assignement expression occurred after a spread expression.
  194. Accept regular expressions after `of` (in `for`/`of`), `yield` (in a generator), and braced arrow functions.
  195. Allow labels in front or `var` declarations, even in strict mode.
  196. ### Breaking changes
  197. 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`.
  198. ## 4.0.11 (2017-02-07)
  199. ### Bug fixes
  200. Allow all forms of member expressions to be parenthesized as lvalue.
  201. ## 4.0.10 (2017-02-07)
  202. ### Bug fixes
  203. Don't expect semicolons after default-exported functions or classes, even when they are expressions.
  204. Check for use of `'use strict'` directives in non-simple parameter functions, even when already in strict mode.
  205. ## 4.0.9 (2017-02-06)
  206. ### Bug fixes
  207. Fix incorrect error raised for parenthesized simple assignment targets, so that `(x) = 1` parses again.
  208. ## 4.0.8 (2017-02-03)
  209. ### Bug fixes
  210. Solve spurious parenthesized pattern errors by temporarily erring on the side of accepting programs that our delayed errors don't handle correctly yet.
  211. ## 4.0.7 (2017-02-02)
  212. ### Bug fixes
  213. Accept invalidly rejected code like `(x).y = 2` again.
  214. Don't raise an error when a function _inside_ strict code has a non-simple parameter list.
  215. ## 4.0.6 (2017-02-02)
  216. ### Bug fixes
  217. Fix exponential behavior (manifesting itself as a complete hang for even relatively small source files) introduced by the new 'use strict' check.
  218. ## 4.0.5 (2017-02-02)
  219. ### Bug fixes
  220. Disallow parenthesized pattern expressions.
  221. Allow keywords as export names.
  222. Don't allow the `async` keyword to be parenthesized.
  223. Properly raise an error when a keyword contains a character escape.
  224. Allow `"use strict"` to appear after other string literal expressions.
  225. Disallow labeled declarations.
  226. ## 4.0.4 (2016-12-19)
  227. ### Bug fixes
  228. Fix crash when `export` was followed by a keyword that can't be
  229. exported.
  230. ## 4.0.3 (2016-08-16)
  231. ### Bug fixes
  232. Allow regular function declarations inside single-statement `if` branches in loose mode. Forbid them entirely in strict mode.
  233. Properly parse properties named `async` in ES2017 mode.
  234. Fix bug where reserved words were broken in ES2017 mode.
  235. ## 4.0.2 (2016-08-11)
  236. ### Bug fixes
  237. Don't ignore period or 'e' characters after octal numbers.
  238. Fix broken parsing for call expressions in default parameter values of arrow functions.
  239. ## 4.0.1 (2016-08-08)
  240. ### Bug fixes
  241. Fix false positives in duplicated export name errors.
  242. ## 4.0.0 (2016-08-07)
  243. ### Breaking changes
  244. The default `ecmaVersion` option value is now 7.
  245. A number of internal method signatures changed, so plugins might need to be updated.
  246. ### Bug fixes
  247. The parser now raises errors on duplicated export names.
  248. `arguments` and `eval` can now be used in shorthand properties.
  249. Duplicate parameter names in non-simple argument lists now always produce an error.
  250. ### New features
  251. The `ecmaVersion` option now also accepts year-style version numbers
  252. (2015, etc).
  253. Support for `async`/`await` syntax when `ecmaVersion` is >= 8.
  254. Support for trailing commas in call expressions when `ecmaVersion` is >= 8.
  255. ## 3.3.0 (2016-07-25)
  256. ### Bug fixes
  257. Fix bug in tokenizing of regexp operator after a function declaration.
  258. Fix parser crash when parsing an array pattern with a hole.
  259. ### New features
  260. Implement check against complex argument lists in functions that enable strict mode in ES7.
  261. ## 3.2.0 (2016-06-07)
  262. ### Bug fixes
  263. Improve handling of lack of unicode regexp support in host
  264. environment.
  265. Properly reject shorthand properties whose name is a keyword.
  266. ### New features
  267. Visitors created with `visit.make` now have their base as _prototype_, rather than copying properties into a fresh object.
  268. ## 3.1.0 (2016-04-18)
  269. ### Bug fixes
  270. Properly tokenize the division operator directly after a function expression.
  271. Allow trailing comma in destructuring arrays.
  272. ## 3.0.4 (2016-02-25)
  273. ### Fixes
  274. Allow update expressions as left-hand-side of the ES7 exponential operator.
  275. ## 3.0.2 (2016-02-10)
  276. ### Fixes
  277. Fix bug that accidentally made `undefined` a reserved word when parsing ES7.
  278. ## 3.0.0 (2016-02-10)
  279. ### Breaking changes
  280. The default value of the `ecmaVersion` option is now 6 (used to be 5).
  281. Support for comprehension syntax (which was dropped from the draft spec) has been removed.
  282. ### Fixes
  283. `let` and `yield` are now “contextual keywords”, meaning you can mostly use them as identifiers in ES5 non-strict code.
  284. A parenthesized class or function expression after `export default` is now parsed correctly.
  285. ### New features
  286. When `ecmaVersion` is set to 7, Acorn will parse the exponentiation operator (`**`).
  287. The identifier character ranges are now based on Unicode 8.0.0.
  288. Plugins can now override the `raiseRecoverable` method to override the way non-critical errors are handled.
  289. ## 2.7.0 (2016-01-04)
  290. ### Fixes
  291. Stop allowing rest parameters in setters.
  292. Disallow `y` rexexp flag in ES5.
  293. Disallow `\00` and `\000` escapes in strict mode.
  294. Raise an error when an import name is a reserved word.
  295. ## 2.6.2 (2015-11-10)
  296. ### Fixes
  297. Don't crash when no options object is passed.
  298. ## 2.6.0 (2015-11-09)
  299. ### Fixes
  300. Add `await` as a reserved word in module sources.
  301. Disallow `yield` in a parameter default value for a generator.
  302. Forbid using a comma after a rest pattern in an array destructuring.
  303. ### New features
  304. Support parsing stdin in command-line tool.
  305. ## 2.5.0 (2015-10-27)
  306. ### Fixes
  307. Fix tokenizer support in the command-line tool.
  308. Stop allowing `new.target` outside of functions.
  309. Remove legacy `guard` and `guardedHandler` properties from try nodes.
  310. Stop allowing multiple `__proto__` properties on an object literal in strict mode.
  311. Don't allow rest parameters to be non-identifier patterns.
  312. Check for duplicate paramter names in arrow functions.