UNPKG

14.1 kBMarkdownView Raw
1## 7.1.1 (2020-03-01)
2
3### Bug fixes
4
5Treat `\8` and `\9` as invalid escapes in template strings.
6
7Allow unicode escapes in property names that are keywords.
8
9Don't error on an exponential operator expression as argument to `await`.
10
11More carefully check for valid UTF16 surrogate pairs in regexp validator.
12
13## 7.1.0 (2019-09-24)
14
15### Bug fixes
16
17Disallow trailing object literal commas when ecmaVersion is less than 5.
18
19### New features
20
21Add 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
27Changes 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
29Makes 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
41Fix bug causing Acorn to treat some characters as identifier characters that shouldn't be treated as such.
42
43Fix 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
49Improve valid assignment checking in `for`/`in` and `for`/`of` loops.
50
51Disallow binding `let` in patterns.
52
53### New features
54
55Support bigint syntax with `ecmaVersion` >= 11.
56
57Support dynamic `import` syntax with `ecmaVersion` >= 11.
58
59Upgrade to Unicode version 12.
60
61## 6.1.1 (2019-02-27)
62
63### Bug fixes
64
65Fix bug that caused parsing default exports of with names to fail.
66
67## 6.1.0 (2019-02-08)
68
69### Bug fixes
70
71Fix scope checking when redefining a `var` as a lexical binding.
72
73### New features
74
75Split 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
81Check that exported bindings are defined.
82
83Don't treat `\u180e` as a whitespace character.
84
85Check for duplicate parameter names in methods.
86
87Don't allow shorthand properties when they are generators or async methods.
88
89Forbid binding `await` in async arrow function's parameter list.
90
91## 6.0.6 (2019-01-30)
92
93### Bug fixes
94
95The content of class declarations and expressions is now always parsed in strict mode.
96
97Don't allow `let` or `const` to bind the variable name `let`.
98
99Treat class declarations as lexical.
100
101Don't allow a generator function declaration as the sole body of an `if` or `else`.
102
103Ignore `"use strict"` when after an empty statement.
104
105Allow string line continuations with special line terminator characters.
106
107Treat `for` bodies as part of the `for` scope when checking for conflicting bindings.
108
109Fix bug with parsing `yield` in a `for` loop initializer.
110
111Implement special cases around scope checking for functions.
112
113## 6.0.5 (2019-01-02)
114
115### Bug fixes
116
117Fix TypeScript type for `Parser.extend` and add `allowAwaitOutsideFunction` to options type.
118
119Don't treat `let` as a keyword when the next token is `{` on the next line.
120
121Fix 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
127Further improvements to tokenizing regular expressions in corner cases.
128
129## 6.0.3 (2018-11-04)
130
131### Bug fixes
132
133Fix bug in tokenizing an expression-less return followed by a function followed by a regular expression.
134
135Remove stray symlink in the package tarball.
136
137## 6.0.2 (2018-09-26)
138
139### Bug fixes
140
141Fix 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
147Fix wrong value in `version` export.
148
149## 6.0.0 (2018-09-14)
150
151### Bug fixes
152
153Better handle variable-redefinition checks for catch bindings and functions directly under if statements.
154
155Forbid `new.target` in top-level arrow functions.
156
157Fix issue with parsing a regexp after `yield` in some contexts.
158
159### New features
160
161The package now comes with TypeScript definitions.
162
163### Breaking changes
164
165The default value of the `ecmaVersion` option is now 9 (2018).
166
167Plugins work differently, and will have to be rewritten to work with this version.
168
169The 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
175Fix failure to tokenize regexps after expressions like `x.of`.
176
177Better error message for unterminated template literals.
178
179## 5.7.2 (2018-08-24)
180
181### Bug fixes
182
183Properly handle `allowAwaitOutsideFunction` in for statements.
184
185Treat function declarations at the top level of modules like let bindings.
186
187Don'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
193Upgraded to Unicode 11.
194
195## 5.6.0 (2018-05-31)
196
197### New features
198
199Allow U+2028 and U+2029 in string when ECMAVersion >= 10.
200
201Allow binding-less catch statements when ECMAVersion >= 10.
202
203Add `allowAwaitOutsideFunction` option for parsing top-level `await`.
204
205## 5.5.3 (2018-03-08)
206
207### Bug fixes
208
209A _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
215A 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
221Fix misleading error message for octal escapes in template strings.
222
223## 5.5.0 (2018-02-27)
224
225### New features
226
227The identifier character categorization is now based on Unicode version 10.
228
229Acorn 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
235Disallow duplicate or escaped flags on regular expressions.
236
237Disallow octal escapes in strings in strict mode.
238
239### New features
240
241Add support for async iteration.
242
243Add support for object spread and rest.
244
245## 5.3.0 (2017-12-28)
246
247### Bug fixes
248
249Fix parsing of floating point literals with leading zeroes in loose mode.
250
251Allow duplicate property names in object patterns.
252
253Don't allow static class methods named `prototype`.
254
255Disallow async functions directly under `if` or `else`.
256
257Parse right-hand-side of `for`/`of` as an assignment expression.
258
259Stricter parsing of `for`/`in`.
260
261Don't allow unicode escapes in contextual keywords.
262
263### New features
264
265Parsing 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
271Fix a token context corruption bug.
272
273## 5.2.0 (2017-10-30)
274
275### Bug fixes
276
277Fix token context tracking for `class` and `function` in property-name position.
278
279Make sure `%*` isn't parsed as a valid operator.
280
281Allow shorthand properties `get` and `set` to be followed by default values.
282
283Disallow `super` when not in callee or object position.
284
285### New features
286
287Support [`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
293Disable parsing of legacy HTML-style comments in modules.
294
295Fix parsing of async methods whose names are keywords.
296
297## 5.1.1 (2017-07-06)
298
299### Bug fixes
300
301Fix problem with disambiguating regexp and division after a class.
302
303## 5.1.0 (2017-07-05)
304
305### Bug fixes
306
307Fix tokenizing of regexps in an object-desctructuring `for`/`of` loop and after `yield`.
308
309Parse zero-prefixed numbers with non-octal digits as decimal.
310
311Allow object/array patterns in rest parameters.
312
313Don't error when `yield` is used as a property name.
314
315Allow `async` as a shorthand object property.
316
317### New features
318
319Implement 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
325Fix spurious duplicate variable definition errors for named functions.
326
327## 5.0.2 (2017-03-30)
328
329### Bug fixes
330
331A 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
337Raise an error for duplicated lexical bindings.
338
339Fix spurious error when an assignement expression occurred after a spread expression.
340
341Accept regular expressions after `of` (in `for`/`of`), `yield` (in a generator), and braced arrow functions.
342
343Allow labels in front or `var` declarations, even in strict mode.
344
345### Breaking changes
346
347Parse 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
353Allow all forms of member expressions to be parenthesized as lvalue.
354
355## 4.0.10 (2017-02-07)
356
357### Bug fixes
358
359Don't expect semicolons after default-exported functions or classes, even when they are expressions.
360
361Check 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
367Fix 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
373Solve 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
379Accept invalidly rejected code like `(x).y = 2` again.
380
381Don'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
387Fix 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
393Disallow parenthesized pattern expressions.
394
395Allow keywords as export names.
396
397Don't allow the `async` keyword to be parenthesized.
398
399Properly raise an error when a keyword contains a character escape.
400
401Allow `"use strict"` to appear after other string literal expressions.
402
403Disallow labeled declarations.
404
405## 4.0.4 (2016-12-19)
406
407### Bug fixes
408
409Fix crash when `export` was followed by a keyword that can't be
410exported.
411
412## 4.0.3 (2016-08-16)
413
414### Bug fixes
415
416Allow regular function declarations inside single-statement `if` branches in loose mode. Forbid them entirely in strict mode.
417
418Properly parse properties named `async` in ES2017 mode.
419
420Fix bug where reserved words were broken in ES2017 mode.
421
422## 4.0.2 (2016-08-11)
423
424### Bug fixes
425
426Don't ignore period or 'e' characters after octal numbers.
427
428Fix 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
434Fix false positives in duplicated export name errors.
435
436## 4.0.0 (2016-08-07)
437
438### Breaking changes
439
440The default `ecmaVersion` option value is now 7.
441
442A number of internal method signatures changed, so plugins might need to be updated.
443
444### Bug fixes
445
446The parser now raises errors on duplicated export names.
447
448`arguments` and `eval` can now be used in shorthand properties.
449
450Duplicate parameter names in non-simple argument lists now always produce an error.
451
452### New features
453
454The `ecmaVersion` option now also accepts year-style version numbers
455(2015, etc).
456
457Support for `async`/`await` syntax when `ecmaVersion` is >= 8.
458
459Support for trailing commas in call expressions when `ecmaVersion` is >= 8.
460
461## 3.3.0 (2016-07-25)
462
463### Bug fixes
464
465Fix bug in tokenizing of regexp operator after a function declaration.
466
467Fix parser crash when parsing an array pattern with a hole.
468
469### New features
470
471Implement 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
477Improve handling of lack of unicode regexp support in host
478environment.
479
480Properly reject shorthand properties whose name is a keyword.
481
482### New features
483
484Visitors 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
490Properly tokenize the division operator directly after a function expression.
491
492Allow trailing comma in destructuring arrays.
493
494## 3.0.4 (2016-02-25)
495
496### Fixes
497
498Allow update expressions as left-hand-side of the ES7 exponential operator.
499
500## 3.0.2 (2016-02-10)
501
502### Fixes
503
504Fix bug that accidentally made `undefined` a reserved word when parsing ES7.
505
506## 3.0.0 (2016-02-10)
507
508### Breaking changes
509
510The default value of the `ecmaVersion` option is now 6 (used to be 5).
511
512Support 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
518A parenthesized class or function expression after `export default` is now parsed correctly.
519
520### New features
521
522When `ecmaVersion` is set to 7, Acorn will parse the exponentiation operator (`**`).
523
524The identifier character ranges are now based on Unicode 8.0.0.
525
526Plugins 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
532Stop allowing rest parameters in setters.
533
534Disallow `y` rexexp flag in ES5.
535
536Disallow `\00` and `\000` escapes in strict mode.
537
538Raise an error when an import name is a reserved word.
539
540## 2.6.2 (2015-11-10)
541
542### Fixes
543
544Don't crash when no options object is passed.
545
546## 2.6.0 (2015-11-09)
547
548### Fixes
549
550Add `await` as a reserved word in module sources.
551
552Disallow `yield` in a parameter default value for a generator.
553
554Forbid using a comma after a rest pattern in an array destructuring.
555
556### New features
557
558Support parsing stdin in command-line tool.
559
560## 2.5.0 (2015-10-27)
561
562### Fixes
563
564Fix tokenizer support in the command-line tool.
565
566Stop allowing `new.target` outside of functions.
567
568Remove legacy `guard` and `guardedHandler` properties from try nodes.
569
570Stop allowing multiple `__proto__` properties on an object literal in strict mode.
571
572Don't allow rest parameters to be non-identifier patterns.
573
574Check for duplicate paramter names in arrow functions.