Skip to content

Commit 98f56d1

Browse files
targosBethGriggs
authored andcommittedSep 21, 2021
deps: update Acorn to v8.5.0
PR-URL: #40015 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent fe920b6 commit 98f56d1

File tree

12 files changed

+663
-526
lines changed

12 files changed

+663
-526
lines changed
 

‎deps/acorn/acorn-walk/CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## 8.2.0 (2021-09-06)
2+
3+
### New features
4+
5+
Add support for walking ES2022 class static blocks.
6+
7+
## 8.1.1 (2021-06-29)
8+
9+
### Bug fixes
10+
11+
Include `base` in the type declarations.
12+
113
## 8.1.0 (2021-04-24)
214

315
### New features

‎deps/acorn/acorn-walk/dist/walk.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,6 @@ declare module "acorn-walk" {
109109
): Found<TState> | undefined;
110110

111111
export const findNodeAfter: typeof findNodeAround;
112+
113+
export const base: RecursiveVisitors<any>;
112114
}

‎deps/acorn/acorn-walk/dist/walk.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@
190190

191191
var base = {};
192192

193-
base.Program = base.BlockStatement = function (node, st, c) {
193+
base.Program = base.BlockStatement = base.StaticBlock = function (node, st, c) {
194194
for (var i = 0, list = node.body; i < list.length; i += 1)
195195
{
196196
var stmt = list[i];

‎deps/acorn/acorn-walk/dist/walk.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ function ignore(_node, _st, _c) {}
184184

185185
var base = {};
186186

187-
base.Program = base.BlockStatement = function (node, st, c) {
187+
base.Program = base.BlockStatement = base.StaticBlock = function (node, st, c) {
188188
for (var i = 0, list = node.body; i < list.length; i += 1)
189189
{
190190
var stmt = list[i];

‎deps/acorn/acorn-walk/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
],
1717
"./package.json": "./package.json"
1818
},
19-
"version": "8.1.0",
19+
"version": "8.2.0",
2020
"engines": {"node": ">=0.4.0"},
2121
"maintainers": [
2222
{

‎deps/acorn/acorn/CHANGELOG.md

+20
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
## 8.5.0 (2021-09-06)
2+
3+
### Bug fixes
4+
5+
Improve context-dependent tokenization in a number of corner cases.
6+
7+
Fix location tracking after a 0x2028 or 0x2029 character in a string literal (which before did not increase the line number).
8+
9+
Fix an issue where arrow function bodies in for loop context would inappropriately consume `in` operators.
10+
11+
Fix wrong end locations stored on SequenceExpression nodes.
12+
13+
Implement restriction that `for`/`of` loop LHS can't start with `let`.
14+
15+
### New features
16+
17+
Add support for ES2022 class static blocks.
18+
19+
Allow multiple input files to be passed to the CLI tool.
20+
121
## 8.4.1 (2021-06-24)
222

323
### Bug fixes

‎deps/acorn/acorn/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ 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, partial support), 13 (2022, partial support)
57+
11 (2020), 12 (2021), 13 (2022, partial support)
5858
or `"latest"` (the latest the library supports). This influences
5959
support for strict mode, the set of reserved words, and support
6060
for new syntax features.

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

+3
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ declare namespace acorn {
173173
p_expr: TokContext
174174
q_tmpl: TokContext
175175
f_expr: TokContext
176+
f_stat: TokContext
177+
f_expr_gen: TokContext
178+
f_gen: TokContext
176179
}
177180

178181
function isIdentifierStart(code: number, astral?: boolean): boolean

‎deps/acorn/acorn/dist/acorn.js

+297-250
Large diffs are not rendered by default.

‎deps/acorn/acorn/dist/acorn.mjs

+297-250
Large diffs are not rendered by default.

‎deps/acorn/acorn/dist/bin.js

+27-21
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,24 @@ var path = require('path');
44
var fs = require('fs');
55
var acorn = require('./acorn.js');
66

7-
var infile, forceFile, silent = false, compact = false, tokenize = false;
7+
var inputFilePaths = [], forceFileName = false, fileMode = false, silent = false, compact = false, tokenize = false;
88
var options = {};
99

1010
function help(status) {
1111
var print = (status === 0) ? console.log : console.error;
1212
print("usage: " + path.basename(process.argv[1]) + " [--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9|...|--ecma2015|--ecma2016|--ecma2017|--ecma2018|...]");
13-
print(" [--tokenize] [--locations] [---allow-hash-bang] [--allow-await-outside-function] [--compact] [--silent] [--module] [--help] [--] [infile]");
13+
print(" [--tokenize] [--locations] [---allow-hash-bang] [--allow-await-outside-function] [--compact] [--silent] [--module] [--help] [--] [<infile>...]");
1414
process.exit(status);
1515
}
1616

1717
for (var i = 2; i < process.argv.length; ++i) {
1818
var arg = process.argv[i];
19-
if ((arg === "-" || arg[0] !== "-") && !infile) { infile = arg; }
20-
else if (arg === "--" && !infile && i + 2 === process.argv.length) { forceFile = infile = process.argv[++i]; }
21-
else if (arg === "--locations") { options.locations = true; }
19+
if (arg[0] !== "-" || arg === "-") { inputFilePaths.push(arg); }
20+
else if (arg === "--") {
21+
inputFilePaths.push.apply(inputFilePaths, process.argv.slice(i + 1));
22+
forceFileName = true;
23+
break
24+
} else if (arg === "--locations") { options.locations = true; }
2225
else if (arg === "--allow-hash-bang") { options.allowHashBang = true; }
2326
else if (arg === "--allow-await-outside-function") { options.allowAwaitOutsideFunction = true; }
2427
else if (arg === "--silent") { silent = true; }
@@ -35,31 +38,34 @@ for (var i = 2; i < process.argv.length; ++i) {
3538
}
3639
}
3740

38-
function run(code) {
39-
var result;
41+
function run(codeList) {
42+
var result = [], fileIdx = 0;
4043
try {
41-
if (!tokenize) {
42-
result = acorn.parse(code, options);
43-
} else {
44-
result = [];
45-
var tokenizer = acorn.tokenizer(code, options), token;
46-
do {
47-
token = tokenizer.getToken();
48-
result.push(token);
49-
} while (token.type !== acorn.tokTypes.eof)
50-
}
44+
codeList.forEach(function (code, idx) {
45+
fileIdx = idx;
46+
if (!tokenize) {
47+
result = acorn.parse(code, options);
48+
options.program = result;
49+
} else {
50+
var tokenizer = acorn.tokenizer(code, options), token;
51+
do {
52+
token = tokenizer.getToken();
53+
result.push(token);
54+
} while (token.type !== acorn.tokTypes.eof)
55+
}
56+
});
5157
} catch (e) {
52-
console.error(infile && infile !== "-" ? e.message.replace(/\(\d+:\d+\)$/, function (m) { return m.slice(0, 1) + infile + " " + m.slice(1); }) : e.message);
58+
console.error(fileMode ? e.message.replace(/\(\d+:\d+\)$/, function (m) { return m.slice(0, 1) + inputFilePaths[fileIdx] + " " + m.slice(1); }) : e.message);
5359
process.exit(1);
5460
}
5561
if (!silent) { console.log(JSON.stringify(result, null, compact ? null : 2)); }
5662
}
5763

58-
if (forceFile || infile && infile !== "-") {
59-
run(fs.readFileSync(infile, "utf8"));
64+
if (fileMode = inputFilePaths.length && (forceFileName || !inputFilePaths.includes("-") || inputFilePaths.length !== 1)) {
65+
run(inputFilePaths.map(function (path) { return fs.readFileSync(path, "utf8"); }));
6066
} else {
6167
var code = "";
6268
process.stdin.resume();
6369
process.stdin.on("data", function (chunk) { return code += chunk; });
64-
process.stdin.on("end", function () { return run(code); });
70+
process.stdin.on("end", function () { return run([code]); });
6571
}

‎deps/acorn/acorn/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
],
1717
"./package.json": "./package.json"
1818
},
19-
"version": "8.4.1",
19+
"version": "8.5.0",
2020
"engines": {"node": ">=0.4.0"},
2121
"maintainers": [
2222
{

0 commit comments

Comments
 (0)
Please sign in to comment.