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