1 | ## 7.1.1 (2020-03-01)
|
2 |
|
3 | ### Bug fixes
|
4 |
|
5 | Treat `\8` and `\9` as invalid escapes in template strings.
|
6 |
|
7 | Allow unicode escapes in property names that are keywords.
|
8 |
|
9 | Don't error on an exponential operator expression as argument to `await`.
|
10 |
|
11 | More carefully check for valid UTF16 surrogate pairs in regexp validator.
|
12 |
|
13 | ## 7.1.0 (2019-09-24)
|
14 |
|
15 | ### Bug fixes
|
16 |
|
17 | Disallow trailing object literal commas when ecmaVersion is less than 5.
|
18 |
|
19 | ### New features
|
20 |
|
21 | 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.
|
22 |
|
23 | ## 7.0.0 (2019-08-13)
|
24 |
|
25 | ### Breaking changes
|
26 |
|
27 | 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).
|
28 |
|
29 | Makes 10 (ES2019) the default value for the `ecmaVersion` option.
|
30 |
|
31 | ## 6.3.0 (2019-08-12)
|
32 |
|
33 | ### New features
|
34 |
|
35 | `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.
|
36 |
|
37 | ## 6.2.1 (2019-07-21)
|
38 |
|
39 | ### Bug fixes
|
40 |
|
41 | Fix bug causing Acorn to treat some characters as identifier characters that shouldn't be treated as such.
|
42 |
|
43 | Fix issue where setting the `allowReserved` option to `"never"` allowed reserved words in some circumstances.
|
44 |
|
45 | ## 6.2.0 (2019-07-04)
|
46 |
|
47 | ### Bug fixes
|
48 |
|
49 | Improve valid assignment checking in `for`/`in` and `for`/`of` loops.
|
50 |
|
51 | Disallow binding `let` in patterns.
|
52 |
|
53 | ### New features
|
54 |
|
55 | Support bigint syntax with `ecmaVersion` >= 11.
|
56 |
|
57 | Support dynamic `import` syntax with `ecmaVersion` >= 11.
|
58 |
|
59 | Upgrade to Unicode version 12.
|
60 |
|
61 | ## 6.1.1 (2019-02-27)
|
62 |
|
63 | ### Bug fixes
|
64 |
|
65 | Fix bug that caused parsing default exports of with names to fail.
|
66 |
|
67 | ## 6.1.0 (2019-02-08)
|
68 |
|
69 | ### Bug fixes
|
70 |
|
71 | Fix scope checking when redefining a `var` as a lexical binding.
|
72 |
|
73 | ### New features
|
74 |
|
75 | Split up `parseSubscripts` to use an internal `parseSubscript` method to make it easier to extend with plugins.
|
76 |
|
77 | ## 6.0.7 (2019-02-04)
|
78 |
|
79 | ### Bug fixes
|
80 |
|
81 | Check that exported bindings are defined.
|
82 |
|
83 | Don't treat `\u180e` as a whitespace character.
|
84 |
|
85 | Check for duplicate parameter names in methods.
|
86 |
|
87 | Don't allow shorthand properties when they are generators or async methods.
|
88 |
|
89 | Forbid binding `await` in async arrow function's parameter list.
|
90 |
|
91 | ## 6.0.6 (2019-01-30)
|
92 |
|
93 | ### Bug fixes
|
94 |
|
95 | The content of class declarations and expressions is now always parsed in strict mode.
|
96 |
|
97 | Don't allow `let` or `const` to bind the variable name `let`.
|
98 |
|
99 | Treat class declarations as lexical.
|
100 |
|
101 | Don't allow a generator function declaration as the sole body of an `if` or `else`.
|
102 |
|
103 | Ignore `"use strict"` when after an empty statement.
|
104 |
|
105 | Allow string line continuations with special line terminator characters.
|
106 |
|
107 | Treat `for` bodies as part of the `for` scope when checking for conflicting bindings.
|
108 |
|
109 | Fix bug with parsing `yield` in a `for` loop initializer.
|
110 |
|
111 | Implement special cases around scope checking for functions.
|
112 |
|
113 | ## 6.0.5 (2019-01-02)
|
114 |
|
115 | ### Bug fixes
|
116 |
|
117 | Fix TypeScript type for `Parser.extend` and add `allowAwaitOutsideFunction` to options type.
|
118 |
|
119 | Don't treat `let` as a keyword when the next token is `{` on the next line.
|
120 |
|
121 | Fix bug that broke checking for parentheses around an object pattern in a destructuring assignment when `preserveParens` was on.
|
122 |
|
123 | ## 6.0.4 (2018-11-05)
|
124 |
|
125 | ### Bug fixes
|
126 |
|
127 | Further improvements to tokenizing regular expressions in corner cases.
|
128 |
|
129 | ## 6.0.3 (2018-11-04)
|
130 |
|
131 | ### Bug fixes
|
132 |
|
133 | Fix bug in tokenizing an expression-less return followed by a function followed by a regular expression.
|
134 |
|
135 | Remove stray symlink in the package tarball.
|
136 |
|
137 | ## 6.0.2 (2018-09-26)
|
138 |
|
139 | ### Bug fixes
|
140 |
|
141 | Fix bug where default expressions could fail to parse inside an object destructuring assignment expression.
|
142 |
|
143 | ## 6.0.1 (2018-09-14)
|
144 |
|
145 | ### Bug fixes
|
146 |
|
147 | Fix wrong value in `version` export.
|
148 |
|
149 | ## 6.0.0 (2018-09-14)
|
150 |
|
151 | ### Bug fixes
|
152 |
|
153 | Better handle variable-redefinition checks for catch bindings and functions directly under if statements.
|
154 |
|
155 | Forbid `new.target` in top-level arrow functions.
|
156 |
|
157 | Fix issue with parsing a regexp after `yield` in some contexts.
|
158 |
|
159 | ### New features
|
160 |
|
161 | The package now comes with TypeScript definitions.
|
162 |
|
163 | ### Breaking changes
|
164 |
|
165 | The default value of the `ecmaVersion` option is now 9 (2018).
|
166 |
|
167 | Plugins work differently, and will have to be rewritten to work with this version.
|
168 |
|
169 | The loose parser and walker have been moved into separate packages (`acorn-loose` and `acorn-walk`).
|
170 |
|
171 | ## 5.7.3 (2018-09-10)
|
172 |
|
173 | ### Bug fixes
|
174 |
|
175 | Fix failure to tokenize regexps after expressions like `x.of`.
|
176 |
|
177 | Better error message for unterminated template literals.
|
178 |
|
179 | ## 5.7.2 (2018-08-24)
|
180 |
|
181 | ### Bug fixes
|
182 |
|
183 | Properly handle `allowAwaitOutsideFunction` in for statements.
|
184 |
|
185 | Treat function declarations at the top level of modules like let bindings.
|
186 |
|
187 | Don't allow async function declarations as the only statement under a label.
|
188 |
|
189 | ## 5.7.0 (2018-06-15)
|
190 |
|
191 | ### New features
|
192 |
|
193 | Upgraded to Unicode 11.
|
194 |
|
195 | ## 5.6.0 (2018-05-31)
|
196 |
|
197 | ### New features
|
198 |
|
199 | Allow U+2028 and U+2029 in string when ECMAVersion >= 10.
|
200 |
|
201 | Allow binding-less catch statements when ECMAVersion >= 10.
|
202 |
|
203 | Add `allowAwaitOutsideFunction` option for parsing top-level `await`.
|
204 |
|
205 | ## 5.5.3 (2018-03-08)
|
206 |
|
207 | ### Bug fixes
|
208 |
|
209 | A _second_ republish of the code in 5.5.1, this time with yarn, to hopefully get valid timestamps.
|
210 |
|
211 | ## 5.5.2 (2018-03-08)
|
212 |
|
213 | ### Bug fixes
|
214 |
|
215 | 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.
|
216 |
|
217 | ## 5.5.1 (2018-03-06)
|
218 |
|
219 | ### Bug fixes
|
220 |
|
221 | Fix misleading error message for octal escapes in template strings.
|
222 |
|
223 | ## 5.5.0 (2018-02-27)
|
224 |
|
225 | ### New features
|
226 |
|
227 | The identifier character categorization is now based on Unicode version 10.
|
228 |
|
229 | Acorn will now validate the content of regular expressions, including new ES9 features.
|
230 |
|
231 | ## 5.4.0 (2018-02-01)
|
232 |
|
233 | ### Bug fixes
|
234 |
|
235 | Disallow duplicate or escaped flags on regular expressions.
|
236 |
|
237 | Disallow octal escapes in strings in strict mode.
|
238 |
|
239 | ### New features
|
240 |
|
241 | Add support for async iteration.
|
242 |
|
243 | Add support for object spread and rest.
|
244 |
|
245 | ## 5.3.0 (2017-12-28)
|
246 |
|
247 | ### Bug fixes
|
248 |
|
249 | Fix parsing of floating point literals with leading zeroes in loose mode.
|
250 |
|
251 | Allow duplicate property names in object patterns.
|
252 |
|
253 | Don't allow static class methods named `prototype`.
|
254 |
|
255 | Disallow async functions directly under `if` or `else`.
|
256 |
|
257 | Parse right-hand-side of `for`/`of` as an assignment expression.
|
258 |
|
259 | Stricter parsing of `for`/`in`.
|
260 |
|
261 | Don't allow unicode escapes in contextual keywords.
|
262 |
|
263 | ### New features
|
264 |
|
265 | Parsing class members was factored into smaller methods to allow plugins to hook into it.
|
266 |
|
267 | ## 5.2.1 (2017-10-30)
|
268 |
|
269 | ### Bug fixes
|
270 |
|
271 | Fix a token context corruption bug.
|
272 |
|
273 | ## 5.2.0 (2017-10-30)
|
274 |
|
275 | ### Bug fixes
|
276 |
|
277 | Fix token context tracking for `class` and `function` in property-name position.
|
278 |
|
279 | Make sure `%*` isn't parsed as a valid operator.
|
280 |
|
281 | Allow shorthand properties `get` and `set` to be followed by default values.
|
282 |
|
283 | Disallow `super` when not in callee or object position.
|
284 |
|
285 | ### New features
|
286 |
|
287 | Support [`directive` property](https://github.com/estree/estree/compare/b3de58c9997504d6fba04b72f76e6dd1619ee4eb...1da8e603237144f44710360f8feb7a9977e905e0) on directive expression statements.
|
288 |
|
289 | ## 5.1.2 (2017-09-04)
|
290 |
|
291 | ### Bug fixes
|
292 |
|
293 | Disable parsing of legacy HTML-style comments in modules.
|
294 |
|
295 | Fix parsing of async methods whose names are keywords.
|
296 |
|
297 | ## 5.1.1 (2017-07-06)
|
298 |
|
299 | ### Bug fixes
|
300 |
|
301 | Fix problem with disambiguating regexp and division after a class.
|
302 |
|
303 | ## 5.1.0 (2017-07-05)
|
304 |
|
305 | ### Bug fixes
|
306 |
|
307 | Fix tokenizing of regexps in an object-desctructuring `for`/`of` loop and after `yield`.
|
308 |
|
309 | Parse zero-prefixed numbers with non-octal digits as decimal.
|
310 |
|
311 | Allow object/array patterns in rest parameters.
|
312 |
|
313 | Don't error when `yield` is used as a property name.
|
314 |
|
315 | Allow `async` as a shorthand object property.
|
316 |
|
317 | ### New features
|
318 |
|
319 | Implement the [template literal revision proposal](https://github.com/tc39/proposal-template-literal-revision) for ES9.
|
320 |
|
321 | ## 5.0.3 (2017-04-01)
|
322 |
|
323 | ### Bug fixes
|
324 |
|
325 | Fix spurious duplicate variable definition errors for named functions.
|
326 |
|
327 | ## 5.0.2 (2017-03-30)
|
328 |
|
329 | ### Bug fixes
|
330 |
|
331 | A binary operator after a parenthesized arrow expression is no longer incorrectly treated as an error.
|
332 |
|
333 | ## 5.0.0 (2017-03-28)
|
334 |
|
335 | ### Bug fixes
|
336 |
|
337 | Raise an error for duplicated lexical bindings.
|
338 |
|
339 | Fix spurious error when an assignement expression occurred after a spread expression.
|
340 |
|
341 | Accept regular expressions after `of` (in `for`/`of`), `yield` (in a generator), and braced arrow functions.
|
342 |
|
343 | Allow labels in front or `var` declarations, even in strict mode.
|
344 |
|
345 | ### Breaking changes
|
346 |
|
347 | 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`.
|
348 |
|
349 | ## 4.0.11 (2017-02-07)
|
350 |
|
351 | ### Bug fixes
|
352 |
|
353 | Allow all forms of member expressions to be parenthesized as lvalue.
|
354 |
|
355 | ## 4.0.10 (2017-02-07)
|
356 |
|
357 | ### Bug fixes
|
358 |
|
359 | Don't expect semicolons after default-exported functions or classes, even when they are expressions.
|
360 |
|
361 | Check for use of `'use strict'` directives in non-simple parameter functions, even when already in strict mode.
|
362 |
|
363 | ## 4.0.9 (2017-02-06)
|
364 |
|
365 | ### Bug fixes
|
366 |
|
367 | Fix incorrect error raised for parenthesized simple assignment targets, so that `(x) = 1` parses again.
|
368 |
|
369 | ## 4.0.8 (2017-02-03)
|
370 |
|
371 | ### Bug fixes
|
372 |
|
373 | Solve spurious parenthesized pattern errors by temporarily erring on the side of accepting programs that our delayed errors don't handle correctly yet.
|
374 |
|
375 | ## 4.0.7 (2017-02-02)
|
376 |
|
377 | ### Bug fixes
|
378 |
|
379 | Accept invalidly rejected code like `(x).y = 2` again.
|
380 |
|
381 | Don't raise an error when a function _inside_ strict code has a non-simple parameter list.
|
382 |
|
383 | ## 4.0.6 (2017-02-02)
|
384 |
|
385 | ### Bug fixes
|
386 |
|
387 | Fix exponential behavior (manifesting itself as a complete hang for even relatively small source files) introduced by the new 'use strict' check.
|
388 |
|
389 | ## 4.0.5 (2017-02-02)
|
390 |
|
391 | ### Bug fixes
|
392 |
|
393 | Disallow parenthesized pattern expressions.
|
394 |
|
395 | Allow keywords as export names.
|
396 |
|
397 | Don't allow the `async` keyword to be parenthesized.
|
398 |
|
399 | Properly raise an error when a keyword contains a character escape.
|
400 |
|
401 | Allow `"use strict"` to appear after other string literal expressions.
|
402 |
|
403 | Disallow labeled declarations.
|
404 |
|
405 | ## 4.0.4 (2016-12-19)
|
406 |
|
407 | ### Bug fixes
|
408 |
|
409 | Fix crash when `export` was followed by a keyword that can't be
|
410 | exported.
|
411 |
|
412 | ## 4.0.3 (2016-08-16)
|
413 |
|
414 | ### Bug fixes
|
415 |
|
416 | Allow regular function declarations inside single-statement `if` branches in loose mode. Forbid them entirely in strict mode.
|
417 |
|
418 | Properly parse properties named `async` in ES2017 mode.
|
419 |
|
420 | Fix bug where reserved words were broken in ES2017 mode.
|
421 |
|
422 | ## 4.0.2 (2016-08-11)
|
423 |
|
424 | ### Bug fixes
|
425 |
|
426 | Don't ignore period or 'e' characters after octal numbers.
|
427 |
|
428 | Fix broken parsing for call expressions in default parameter values of arrow functions.
|
429 |
|
430 | ## 4.0.1 (2016-08-08)
|
431 |
|
432 | ### Bug fixes
|
433 |
|
434 | Fix false positives in duplicated export name errors.
|
435 |
|
436 | ## 4.0.0 (2016-08-07)
|
437 |
|
438 | ### Breaking changes
|
439 |
|
440 | The default `ecmaVersion` option value is now 7.
|
441 |
|
442 | A number of internal method signatures changed, so plugins might need to be updated.
|
443 |
|
444 | ### Bug fixes
|
445 |
|
446 | The parser now raises errors on duplicated export names.
|
447 |
|
448 | `arguments` and `eval` can now be used in shorthand properties.
|
449 |
|
450 | Duplicate parameter names in non-simple argument lists now always produce an error.
|
451 |
|
452 | ### New features
|
453 |
|
454 | The `ecmaVersion` option now also accepts year-style version numbers
|
455 | (2015, etc).
|
456 |
|
457 | Support for `async`/`await` syntax when `ecmaVersion` is >= 8.
|
458 |
|
459 | Support for trailing commas in call expressions when `ecmaVersion` is >= 8.
|
460 |
|
461 | ## 3.3.0 (2016-07-25)
|
462 |
|
463 | ### Bug fixes
|
464 |
|
465 | Fix bug in tokenizing of regexp operator after a function declaration.
|
466 |
|
467 | Fix parser crash when parsing an array pattern with a hole.
|
468 |
|
469 | ### New features
|
470 |
|
471 | Implement check against complex argument lists in functions that enable strict mode in ES7.
|
472 |
|
473 | ## 3.2.0 (2016-06-07)
|
474 |
|
475 | ### Bug fixes
|
476 |
|
477 | Improve handling of lack of unicode regexp support in host
|
478 | environment.
|
479 |
|
480 | Properly reject shorthand properties whose name is a keyword.
|
481 |
|
482 | ### New features
|
483 |
|
484 | Visitors created with `visit.make` now have their base as _prototype_, rather than copying properties into a fresh object.
|
485 |
|
486 | ## 3.1.0 (2016-04-18)
|
487 |
|
488 | ### Bug fixes
|
489 |
|
490 | Properly tokenize the division operator directly after a function expression.
|
491 |
|
492 | Allow trailing comma in destructuring arrays.
|
493 |
|
494 | ## 3.0.4 (2016-02-25)
|
495 |
|
496 | ### Fixes
|
497 |
|
498 | Allow update expressions as left-hand-side of the ES7 exponential operator.
|
499 |
|
500 | ## 3.0.2 (2016-02-10)
|
501 |
|
502 | ### Fixes
|
503 |
|
504 | Fix bug that accidentally made `undefined` a reserved word when parsing ES7.
|
505 |
|
506 | ## 3.0.0 (2016-02-10)
|
507 |
|
508 | ### Breaking changes
|
509 |
|
510 | The default value of the `ecmaVersion` option is now 6 (used to be 5).
|
511 |
|
512 | Support for comprehension syntax (which was dropped from the draft spec) has been removed.
|
513 |
|
514 | ### Fixes
|
515 |
|
516 | `let` and `yield` are now “contextual keywords”, meaning you can mostly use them as identifiers in ES5 non-strict code.
|
517 |
|
518 | A parenthesized class or function expression after `export default` is now parsed correctly.
|
519 |
|
520 | ### New features
|
521 |
|
522 | When `ecmaVersion` is set to 7, Acorn will parse the exponentiation operator (`**`).
|
523 |
|
524 | The identifier character ranges are now based on Unicode 8.0.0.
|
525 |
|
526 | Plugins can now override the `raiseRecoverable` method to override the way non-critical errors are handled.
|
527 |
|
528 | ## 2.7.0 (2016-01-04)
|
529 |
|
530 | ### Fixes
|
531 |
|
532 | Stop allowing rest parameters in setters.
|
533 |
|
534 | Disallow `y` rexexp flag in ES5.
|
535 |
|
536 | Disallow `\00` and `\000` escapes in strict mode.
|
537 |
|
538 | Raise an error when an import name is a reserved word.
|
539 |
|
540 | ## 2.6.2 (2015-11-10)
|
541 |
|
542 | ### Fixes
|
543 |
|
544 | Don't crash when no options object is passed.
|
545 |
|
546 | ## 2.6.0 (2015-11-09)
|
547 |
|
548 | ### Fixes
|
549 |
|
550 | Add `await` as a reserved word in module sources.
|
551 |
|
552 | Disallow `yield` in a parameter default value for a generator.
|
553 |
|
554 | Forbid using a comma after a rest pattern in an array destructuring.
|
555 |
|
556 | ### New features
|
557 |
|
558 | Support parsing stdin in command-line tool.
|
559 |
|
560 | ## 2.5.0 (2015-10-27)
|
561 |
|
562 | ### Fixes
|
563 |
|
564 | Fix tokenizer support in the command-line tool.
|
565 |
|
566 | Stop allowing `new.target` outside of functions.
|
567 |
|
568 | Remove legacy `guard` and `guardedHandler` properties from try nodes.
|
569 |
|
570 | Stop allowing multiple `__proto__` properties on an object literal in strict mode.
|
571 |
|
572 | Don't allow rest parameters to be non-identifier patterns.
|
573 |
|
574 | Check for duplicate paramter names in arrow functions.
|