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.

562 lines
14 KiB

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