45daecf5aedbf4fd0d4711b28eca428e45c4dc45b75252ff6f04a41cb1f0ab1fec8c499169020746d5877ee353fe2fcad5ac838cd8c92782b9ee99cc8d7a0c 13 KB

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