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.

552 lines
13 KiB

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