Skip to content

Commit 255e7fb

Browse files
targosRafaelGSS
authored andcommitted
deps: update Acorn to v8.8.0
PR-URL: #44437 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent dcc1cf4 commit 255e7fb

File tree

9 files changed

+177
-148
lines changed

9 files changed

+177
-148
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ The externally maintained libraries used by Node.js are:
5555
"""
5656
MIT License
5757

58-
Copyright (C) 2012-2020 by various contributors (see AUTHORS)
58+
Copyright (C) 2012-2022 by various contributors (see AUTHORS)
5959

6060
Permission is hereby granted, free of charge, to any person obtaining a copy
6161
of this software and associated documentation files (the "Software"), to deal

deps/acorn/acorn/CHANGELOG.md

+22
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
## 8.8.0 (2022-07-21)
2+
3+
### Bug fixes
4+
5+
Allow parentheses around spread args in destructuring object assignment.
6+
7+
Fix an issue where the tree contained `directive` properties in when parsing with a language version that doesn't support them.
8+
9+
### New features
10+
11+
Support hashbang comments by default in ECMAScript 2023 and later.
12+
13+
## 8.7.1 (2021-04-26)
14+
15+
### Bug fixes
16+
17+
Stop handling `"use strict"` directives in ECMAScript versions before 5.
18+
19+
Fix an issue where duplicate quoted export names in `export *` syntax were incorrectly checked.
20+
21+
Add missing type for `tokTypes`.
22+
123
## 8.7.0 (2021-12-27)
224

325
### New features

deps/acorn/acorn/LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (C) 2012-2020 by various contributors (see AUTHORS)
3+
Copyright (C) 2012-2022 by various contributors (see AUTHORS)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

deps/acorn/acorn/README.md

+7-14
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ required):
5454

5555
- **ecmaVersion**: Indicates the ECMAScript version to parse. Must be
5656
either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10 (2019),
57-
11 (2020), 12 (2021), 13 (2022, partial support)
58-
or `"latest"` (the latest the library supports). This influences
59-
support for strict mode, the set of reserved words, and support
60-
for new syntax features.
57+
11 (2020), 12 (2021), 13 (2022), 14 (2023), or `"latest"` (the
58+
latest the library supports). This influences support for strict
59+
mode, the set of reserved words, and support for new syntax
60+
features.
6161

6262
**NOTE**: Only 'stage 4' (finalized) ECMAScript features are being
6363
implemented by Acorn. Other proposed new features must be
@@ -104,9 +104,9 @@ required):
104104
- **allowSuperOutsideMethod**: By default, `super` outside a method
105105
raises an error. Set this to `true` to accept such code.
106106

107-
- **allowHashBang**: When this is enabled (off by default), if the
108-
code starts with the characters `#!` (as in a shellscript), the
109-
first line will be treated as a comment.
107+
- **allowHashBang**: When this is enabled, if the code starts with the
108+
characters `#!` (as in a shellscript), the first line will be
109+
treated as a comment. Defaults to true when `ecmaVersion` >= 2023.
110110

111111
- **locations**: When `true`, each node has a `loc` object attached
112112
with `start` and `end` subobjects, each of which contains the
@@ -271,10 +271,3 @@ The utility spits out the syntax tree as JSON data.
271271
## Existing plugins
272272

273273
- [`acorn-jsx`](https://github.com/RReverser/acorn-jsx): Parse [Facebook JSX syntax extensions](https://github.com/facebook/jsx)
274-
275-
Plugins for ECMAScript proposals:
276-
277-
- [`acorn-stage3`](https://github.com/acornjs/acorn-stage3): Parse most stage 3 proposals, bundling:
278-
- [`acorn-class-fields`](https://github.com/acornjs/acorn-class-fields): Parse [class fields proposal](https://github.com/tc39/proposal-class-fields)
279-
- [`acorn-import-meta`](https://github.com/acornjs/acorn-import-meta): Parse [import.meta proposal](https://github.com/tc39/proposal-import-meta)
280-
- [`acorn-private-methods`](https://github.com/acornjs/acorn-private-methods): parse [private methods, getters and setters proposal](https://github.com/tc39/proposal-private-methods)n

deps/acorn/acorn/bin/acorn

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env node
2-
'use strict';
2+
"use strict"
33

4-
require('../dist/bin.js');
4+
require("../dist/bin.js")

deps/acorn/acorn/dist/acorn.d.ts

+39-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ declare namespace acorn {
1111
[Symbol.iterator](): Iterator<Token>
1212
}
1313

14+
type ecmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 'latest'
15+
1416
interface Options {
15-
ecmaVersion: 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 'latest'
17+
ecmaVersion: ecmaVersion
1618
sourceType?: 'script' | 'module'
1719
onInsertedSemicolon?: (lastTokEnd: number, lastTokEndLoc?: Position) => void
1820
onTrailingComma?: (lastTokEnd: number, lastTokEndLoc?: Position) => void
@@ -36,8 +38,41 @@ declare namespace acorn {
3638
}
3739

3840
class Parser {
41+
// state.js
42+
lineStart: number;
43+
options: Options;
44+
curLine: number;
45+
start: number;
46+
end: number;
47+
input: string;
48+
type: TokenType;
49+
50+
// state.js
3951
constructor(options: Options, input: string, startPos?: number)
4052
parse(this: Parser): Node
53+
54+
// tokenize.js
55+
next(): void;
56+
nextToken(): void;
57+
58+
// statement.js
59+
parseTopLevel(node: Node): Node;
60+
61+
// node.js
62+
finishNode(node: Node, type: string): Node;
63+
finishNodeAt(node: Node, type: string, pos: number, loc: Position): Node;
64+
65+
// location.js
66+
raise(pos: number, message: string) : void;
67+
raiseRecoverable?(pos: number, message: string) : void;
68+
69+
// parseutils.js
70+
unexpected(pos: number) : void;
71+
72+
// index.js
73+
static acorn: typeof acorn;
74+
75+
// state.js
4176
static parse(this: typeof Parser, input: string, options: Options): Node
4277
static parseExpressionAt(this: typeof Parser, input: string, pos: number, options: Options): Node
4378
static tokenizer(this: typeof Parser, input: string, options: Options): {
@@ -102,8 +137,10 @@ declare namespace acorn {
102137
colon: TokenType
103138
dot: TokenType
104139
question: TokenType
140+
questionDot: TokenType
105141
arrow: TokenType
106142
template: TokenType
143+
invalidTemplate: TokenType
107144
ellipsis: TokenType
108145
backQuote: TokenType
109146
dollarBraceL: TokenType
@@ -124,6 +161,7 @@ declare namespace acorn {
124161
star: TokenType
125162
slash: TokenType
126163
starstar: TokenType
164+
coalesce: TokenType
127165
_break: TokenType
128166
_case: TokenType
129167
_catch: TokenType

0 commit comments

Comments
 (0)