Skip to content

Commit 7367e6c

Browse files
targosBethGriggs
authored andcommittedDec 15, 2020
deps: update acorn to v8.0.4
This adds support for nullish coalescing, optional chaining and numeric separators. The acorn-numeric-separator plugin can be removed. PR-URL: #35791 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
1 parent 34c870e commit 7367e6c

30 files changed

+6672
-323
lines changed
 

‎LICENSE

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ The externally maintained libraries used by Node.js are:
5353

5454
- Acorn, located at deps/acorn, is licensed as follows:
5555
"""
56+
MIT License
57+
5658
Copyright (C) 2012-2018 by various contributors (see AUTHORS)
5759

5860
Permission is hereby granted, free of charge, to any person obtaining a copy

‎deps/acorn-plugins/acorn-numeric-separator/CHANGELOG.md

-16
This file was deleted.

‎deps/acorn-plugins/acorn-numeric-separator/LICENSE

-19
This file was deleted.

‎deps/acorn-plugins/acorn-numeric-separator/README.md

-21
This file was deleted.

‎deps/acorn-plugins/acorn-numeric-separator/index.js

-49
This file was deleted.

‎deps/acorn-plugins/acorn-numeric-separator/package.json

-33
This file was deleted.

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

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
## 8.0.0 (2020-08-12)
2+
3+
### New features
4+
5+
The package can now be loaded directly as an ECMAScript module in node 13+.
6+
7+
## 7.2.0 (2020-06-17)
8+
9+
### New features
10+
11+
Support optional chaining and nullish coalescing.
12+
13+
Support `import.meta`.
14+
15+
Add support for `export * as ns from "source"`.
16+
117
## 7.1.1 (2020-02-13)
218

319
### Bug fixes

‎deps/acorn/acorn-walk/LICENSE

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
MIT License
2+
13
Copyright (C) 2012-2018 by various contributors (see AUTHORS)
24

35
Permission is hereby granted, free of charge, to any person obtaining a copy

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

+112
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
import {Node} from 'acorn';
2+
3+
declare module "acorn-walk" {
4+
type FullWalkerCallback<TState> = (
5+
node: Node,
6+
state: TState,
7+
type: string
8+
) => void;
9+
10+
type FullAncestorWalkerCallback<TState> = (
11+
node: Node,
12+
state: TState | Node[],
13+
ancestors: Node[],
14+
type: string
15+
) => void;
16+
type WalkerCallback<TState> = (node: Node, state: TState) => void;
17+
18+
type SimpleWalkerFn<TState> = (
19+
node: Node,
20+
state: TState
21+
) => void;
22+
23+
type AncestorWalkerFn<TState> = (
24+
node: Node,
25+
state: TState| Node[],
26+
ancestors: Node[]
27+
) => void;
28+
29+
type RecursiveWalkerFn<TState> = (
30+
node: Node,
31+
state: TState,
32+
callback: WalkerCallback<TState>
33+
) => void;
34+
35+
type SimpleVisitors<TState> = {
36+
[type: string]: SimpleWalkerFn<TState>
37+
};
38+
39+
type AncestorVisitors<TState> = {
40+
[type: string]: AncestorWalkerFn<TState>
41+
};
42+
43+
type RecursiveVisitors<TState> = {
44+
[type: string]: RecursiveWalkerFn<TState>
45+
};
46+
47+
type FindPredicate = (type: string, node: Node) => boolean;
48+
49+
interface Found<TState> {
50+
node: Node,
51+
state: TState
52+
}
53+
54+
export function simple<TState>(
55+
node: Node,
56+
visitors: SimpleVisitors<TState>,
57+
base?: RecursiveVisitors<TState>,
58+
state?: TState
59+
): void;
60+
61+
export function ancestor<TState>(
62+
node: Node,
63+
visitors: AncestorVisitors<TState>,
64+
base?: RecursiveVisitors<TState>,
65+
state?: TState
66+
): void;
67+
68+
export function recursive<TState>(
69+
node: Node,
70+
state: TState,
71+
functions: RecursiveVisitors<TState>,
72+
base?: RecursiveVisitors<TState>
73+
): void;
74+
75+
export function full<TState>(
76+
node: Node,
77+
callback: FullWalkerCallback<TState>,
78+
base?: RecursiveVisitors<TState>,
79+
state?: TState
80+
): void;
81+
82+
export function fullAncestor<TState>(
83+
node: Node,
84+
callback: FullAncestorWalkerCallback<TState>,
85+
base?: RecursiveVisitors<TState>,
86+
state?: TState
87+
): void;
88+
89+
export function make<TState>(
90+
functions: RecursiveVisitors<TState>,
91+
base?: RecursiveVisitors<TState>
92+
): RecursiveVisitors<TState>;
93+
94+
export function findNodeAt<TState>(
95+
node: Node,
96+
start: number | undefined,
97+
end?: number | undefined,
98+
type?: FindPredicate | string,
99+
base?: RecursiveVisitors<TState>,
100+
state?: TState
101+
): Found<TState> | undefined;
102+
103+
export function findNodeAround<TState>(
104+
node: Node,
105+
start: number | undefined,
106+
type?: FindPredicate | string,
107+
base?: RecursiveVisitors<TState>,
108+
state?: TState
109+
): Found<TState> | undefined;
110+
111+
export const findNodeAfter: typeof findNodeAround;
112+
}

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

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
33
typeof define === 'function' && define.amd ? define(['exports'], factory) :
44
(global = global || self, factory((global.acorn = global.acorn || {}, global.acorn.walk = {})));
5-
}(this, function (exports) { 'use strict';
5+
}(this, (function (exports) { 'use strict';
66

77
// AST walker module for Mozilla Parser API compatible trees
88

@@ -200,7 +200,7 @@
200200
};
201201
base.Statement = skipThrough;
202202
base.EmptyStatement = ignore;
203-
base.ExpressionStatement = base.ParenthesizedExpression =
203+
base.ExpressionStatement = base.ParenthesizedExpression = base.ChainExpression =
204204
function (node, st, c) { return c(node.expression, st, "Expression"); };
205205
base.IfStatement = function (node, st, c) {
206206
c(node.test, st, "Expression");
@@ -405,6 +405,8 @@
405405
if (node.source) { c(node.source, st, "Expression"); }
406406
};
407407
base.ExportAllDeclaration = function (node, st, c) {
408+
if (node.exported)
409+
{ c(node.exported, st); }
408410
c(node.source, st, "Expression");
409411
};
410412
base.ImportDeclaration = function (node, st, c) {
@@ -458,4 +460,4 @@
458460

459461
Object.defineProperty(exports, '__esModule', { value: true });
460462

461-
}));
463+
})));

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

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

+443
Large diffs are not rendered by default.

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

+1
Large diffs are not rendered by default.

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
"main": "dist/walk.js",
66
"types": "dist/walk.d.ts",
77
"module": "dist/walk.mjs",
8-
"version": "7.1.1",
8+
"exports": {
9+
"import": "./dist/walk.mjs",
10+
"require": "./dist/walk.js"
11+
},
12+
"version": "8.0.0",
913
"engines": {"node": ">=0.4.0"},
1014
"maintainers": [
1115
{

‎deps/acorn/acorn/CHANGELOG.md

+94
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,97 @@
1+
## 8.0.4 (2020-10-05)
2+
3+
### Bug fixes
4+
5+
Make `await x ** y` an error, following the spec.
6+
7+
Fix potentially exponential regular expression.
8+
9+
## 8.0.3 (2020-10-02)
10+
11+
### Bug fixes
12+
13+
Fix a wasteful loop during `Parser` creation when setting `ecmaVersion` to `"latest"`.
14+
15+
## 8.0.2 (2020-09-30)
16+
17+
### Bug fixes
18+
19+
Make the TypeScript types reflect the current allowed values for `ecmaVersion`.
20+
21+
Fix another regexp/division tokenizer issue.
22+
23+
## 8.0.1 (2020-08-12)
24+
25+
### Bug fixes
26+
27+
Provide the correct value in the `version` export.
28+
29+
## 8.0.0 (2020-08-12)
30+
31+
### Bug fixes
32+
33+
Disallow expressions like `(a = b) = c`.
34+
35+
Make non-octal escape sequences a syntax error in strict mode.
36+
37+
### New features
38+
39+
The package can now be loaded directly as an ECMAScript module in node 13+.
40+
41+
Update to the set of Unicode properties from ES2021.
42+
43+
### Breaking changes
44+
45+
The `ecmaVersion` option is now required. For the moment, omitting it will still work with a warning, but that will change in a future release.
46+
47+
Some changes to method signatures that may be used by plugins.
48+
49+
## 7.4.0 (2020-08-03)
50+
51+
### New features
52+
53+
Add support for logical assignment operators.
54+
55+
Add support for numeric separators.
56+
57+
## 7.3.1 (2020-06-11)
58+
59+
### Bug fixes
60+
61+
Make the string in the `version` export match the actual library version.
62+
63+
## 7.3.0 (2020-06-11)
64+
65+
### Bug fixes
66+
67+
Fix a bug that caused parsing of object patterns with a property named `set` that had a default value to fail.
68+
69+
### New features
70+
71+
Add support for optional chaining (`?.`).
72+
73+
## 7.2.0 (2020-05-09)
74+
75+
### Bug fixes
76+
77+
Fix precedence issue in parsing of async arrow functions.
78+
79+
### New features
80+
81+
Add support for nullish coalescing.
82+
83+
Add support for `import.meta`.
84+
85+
Support `export * as ...` syntax.
86+
87+
Upgrade to Unicode 13.
88+
89+
## 6.4.1 (2020-03-09)
90+
91+
### Bug fixes
92+
93+
More carefully check for valid UTF16 surrogate pairs in regexp validator.
94+
195
## 7.1.1 (2020-03-01)
296

397
### Bug fixes

‎deps/acorn/acorn/LICENSE

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
MIT License
2+
13
Copyright (C) 2012-2018 by various contributors (see AUTHORS)
24

35
Permission is hereby granted, free of charge, to any person obtaining a copy

‎deps/acorn/acorn/README.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ npm install
3232
## Interface
3333

3434
**parse**`(input, options)` is the main interface to the library. The
35-
`input` parameter is a string, `options` can be undefined or an object
36-
setting some of the options listed below. The return value will be an
37-
abstract syntax tree object as specified by the [ESTree
35+
`input` parameter is a string, `options` must be an object setting
36+
some of the options listed below. The return value will be an abstract
37+
syntax tree object as specified by the [ESTree
3838
spec](https://github.com/estree/estree).
3939

4040
```javascript
4141
let acorn = require("acorn");
42-
console.log(acorn.parse("1 + 1"));
42+
console.log(acorn.parse("1 + 1", {ecmaVersion: 2020}));
4343
```
4444

4545
When encountering a syntax error, the parser will raise a
@@ -48,18 +48,19 @@ have a `pos` property that indicates the string offset at which the
4848
error occurred, and a `loc` object that contains a `{line, column}`
4949
object referring to that same position.
5050

51-
Options can be provided by passing a second argument, which should be
52-
an object containing any of these fields:
51+
Options are provided by in a second argument, which should be an
52+
object containing any of these fields (only `ecmaVersion` is
53+
required):
5354

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

6061
**NOTE**: Only 'stage 4' (finalized) ECMAScript features are being
61-
implemented by Acorn. Other proposed new features can be implemented
62-
through plugins.
62+
implemented by Acorn. Other proposed new features must be
63+
implemented through plugins.
6364

6465
- **sourceType**: Indicate the mode the code should be parsed in. Can be
6566
either `"script"` or `"module"`. This influences global strict mode
@@ -224,7 +225,7 @@ you can use its static `extend` method.
224225
var acorn = require("acorn");
225226
var jsx = require("acorn-jsx");
226227
var JSXParser = acorn.Parser.extend(jsx());
227-
JSXParser.parse("foo(<bar/>)");
228+
JSXParser.parse("foo(<bar/>)", {ecmaVersion: 2020});
228229
```
229230

230231
The `extend` method takes any number of plugin values, and returns a
@@ -266,5 +267,4 @@ Plugins for ECMAScript proposals:
266267
- [`acorn-stage3`](https://github.com/acornjs/acorn-stage3): Parse most stage 3 proposals, bundling:
267268
- [`acorn-class-fields`](https://github.com/acornjs/acorn-class-fields): Parse [class fields proposal](https://github.com/tc39/proposal-class-fields)
268269
- [`acorn-import-meta`](https://github.com/acornjs/acorn-import-meta): Parse [import.meta proposal](https://github.com/tc39/proposal-import-meta)
269-
- [`acorn-numeric-separator`](https://github.com/acornjs/acorn-numeric-separator): Parse [numeric separator proposal](https://github.com/tc39/proposal-numeric-separator)
270270
- [`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

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env node
2+
'use strict';
3+
4+
require('../dist/bin.js');

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

+209
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
export as namespace acorn
2+
export = acorn
3+
4+
declare namespace acorn {
5+
function parse(input: string, options: Options): Node
6+
7+
function parseExpressionAt(input: string, pos: number, options: Options): Node
8+
9+
function tokenizer(input: string, options: Options): {
10+
getToken(): Token
11+
[Symbol.iterator](): Iterator<Token>
12+
}
13+
14+
interface Options {
15+
ecmaVersion: 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 'latest'
16+
sourceType?: 'script' | 'module'
17+
onInsertedSemicolon?: (lastTokEnd: number, lastTokEndLoc?: Position) => void
18+
onTrailingComma?: (lastTokEnd: number, lastTokEndLoc?: Position) => void
19+
allowReserved?: boolean | 'never'
20+
allowReturnOutsideFunction?: boolean
21+
allowImportExportEverywhere?: boolean
22+
allowAwaitOutsideFunction?: boolean
23+
allowHashBang?: boolean
24+
locations?: boolean
25+
onToken?: ((token: Token) => any) | Token[]
26+
onComment?: ((
27+
isBlock: boolean, text: string, start: number, end: number, startLoc?: Position,
28+
endLoc?: Position
29+
) => void) | Comment[]
30+
ranges?: boolean
31+
program?: Node
32+
sourceFile?: string
33+
directSourceFile?: string
34+
preserveParens?: boolean
35+
}
36+
37+
class Parser {
38+
constructor(options: Options, input: string, startPos?: number)
39+
parse(this: Parser): Node
40+
static parse(this: typeof Parser, input: string, options: Options): Node
41+
static parseExpressionAt(this: typeof Parser, input: string, pos: number, options: Options): Node
42+
static tokenizer(this: typeof Parser, input: string, options: Options): {
43+
getToken(): Token
44+
[Symbol.iterator](): Iterator<Token>
45+
}
46+
static extend(this: typeof Parser, ...plugins: ((BaseParser: typeof Parser) => typeof Parser)[]): typeof Parser
47+
}
48+
49+
interface Position { line: number; column: number; offset: number }
50+
51+
const defaultOptions: Options
52+
53+
function getLineInfo(input: string, offset: number): Position
54+
55+
class SourceLocation {
56+
start: Position
57+
end: Position
58+
source?: string | null
59+
constructor(p: Parser, start: Position, end: Position)
60+
}
61+
62+
class Node {
63+
type: string
64+
start: number
65+
end: number
66+
loc?: SourceLocation
67+
sourceFile?: string
68+
range?: [number, number]
69+
constructor(parser: Parser, pos: number, loc?: SourceLocation)
70+
}
71+
72+
class TokenType {
73+
label: string
74+
keyword: string
75+
beforeExpr: boolean
76+
startsExpr: boolean
77+
isLoop: boolean
78+
isAssign: boolean
79+
prefix: boolean
80+
postfix: boolean
81+
binop: number
82+
updateContext?: (prevType: TokenType) => void
83+
constructor(label: string, conf?: any)
84+
}
85+
86+
const tokTypes: {
87+
num: TokenType
88+
regexp: TokenType
89+
string: TokenType
90+
name: TokenType
91+
eof: TokenType
92+
bracketL: TokenType
93+
bracketR: TokenType
94+
braceL: TokenType
95+
braceR: TokenType
96+
parenL: TokenType
97+
parenR: TokenType
98+
comma: TokenType
99+
semi: TokenType
100+
colon: TokenType
101+
dot: TokenType
102+
question: TokenType
103+
arrow: TokenType
104+
template: TokenType
105+
ellipsis: TokenType
106+
backQuote: TokenType
107+
dollarBraceL: TokenType
108+
eq: TokenType
109+
assign: TokenType
110+
incDec: TokenType
111+
prefix: TokenType
112+
logicalOR: TokenType
113+
logicalAND: TokenType
114+
bitwiseOR: TokenType
115+
bitwiseXOR: TokenType
116+
bitwiseAND: TokenType
117+
equality: TokenType
118+
relational: TokenType
119+
bitShift: TokenType
120+
plusMin: TokenType
121+
modulo: TokenType
122+
star: TokenType
123+
slash: TokenType
124+
starstar: TokenType
125+
_break: TokenType
126+
_case: TokenType
127+
_catch: TokenType
128+
_continue: TokenType
129+
_debugger: TokenType
130+
_default: TokenType
131+
_do: TokenType
132+
_else: TokenType
133+
_finally: TokenType
134+
_for: TokenType
135+
_function: TokenType
136+
_if: TokenType
137+
_return: TokenType
138+
_switch: TokenType
139+
_throw: TokenType
140+
_try: TokenType
141+
_var: TokenType
142+
_const: TokenType
143+
_while: TokenType
144+
_with: TokenType
145+
_new: TokenType
146+
_this: TokenType
147+
_super: TokenType
148+
_class: TokenType
149+
_extends: TokenType
150+
_export: TokenType
151+
_import: TokenType
152+
_null: TokenType
153+
_true: TokenType
154+
_false: TokenType
155+
_in: TokenType
156+
_instanceof: TokenType
157+
_typeof: TokenType
158+
_void: TokenType
159+
_delete: TokenType
160+
}
161+
162+
class TokContext {
163+
constructor(token: string, isExpr: boolean, preserveSpace: boolean, override?: (p: Parser) => void)
164+
}
165+
166+
const tokContexts: {
167+
b_stat: TokContext
168+
b_expr: TokContext
169+
b_tmpl: TokContext
170+
p_stat: TokContext
171+
p_expr: TokContext
172+
q_tmpl: TokContext
173+
f_expr: TokContext
174+
}
175+
176+
function isIdentifierStart(code: number, astral?: boolean): boolean
177+
178+
function isIdentifierChar(code: number, astral?: boolean): boolean
179+
180+
interface AbstractToken {
181+
}
182+
183+
interface Comment extends AbstractToken {
184+
type: string
185+
value: string
186+
start: number
187+
end: number
188+
loc?: SourceLocation
189+
range?: [number, number]
190+
}
191+
192+
class Token {
193+
type: TokenType
194+
value: any
195+
start: number
196+
end: number
197+
loc?: SourceLocation
198+
range?: [number, number]
199+
constructor(p: Parser)
200+
}
201+
202+
function isNewLine(code: number): boolean
203+
204+
const lineBreak: RegExp
205+
206+
const lineBreakG: RegExp
207+
208+
const version: string
209+
}

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

+428-156
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

+5,261
Large diffs are not rendered by default.

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

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import * as acorn from "./acorn";
2+
export = acorn;

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

+1
Large diffs are not rendered by default.

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

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
'use strict';
2+
3+
var path = require('path');
4+
var fs = require('fs');
5+
var acorn = require('./acorn.js');
6+
7+
var infile, forceFile, silent = false, compact = false, tokenize = false;
8+
var options = {};
9+
10+
function help(status) {
11+
var print = (status === 0) ? console.log : console.error;
12+
print("usage: " + path.basename(process.argv[1]) + " [--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9|...|--ecma2015|--ecma2016|--ecma2017|--ecma2018|...]");
13+
print(" [--tokenize] [--locations] [---allow-hash-bang] [--compact] [--silent] [--module] [--help] [--] [infile]");
14+
process.exit(status);
15+
}
16+
17+
for (var i = 2; i < process.argv.length; ++i) {
18+
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; }
22+
else if (arg === "--allow-hash-bang") { options.allowHashBang = true; }
23+
else if (arg === "--silent") { silent = true; }
24+
else if (arg === "--compact") { compact = true; }
25+
else if (arg === "--help") { help(0); }
26+
else if (arg === "--tokenize") { tokenize = true; }
27+
else if (arg === "--module") { options.sourceType = "module"; }
28+
else {
29+
var match = arg.match(/^--ecma(\d+)$/);
30+
if (match)
31+
{ options.ecmaVersion = +match[1]; }
32+
else
33+
{ help(1); }
34+
}
35+
}
36+
37+
function run(code) {
38+
var result;
39+
try {
40+
if (!tokenize) {
41+
result = acorn.parse(code, options);
42+
} else {
43+
result = [];
44+
var tokenizer = acorn.tokenizer(code, options), token;
45+
do {
46+
token = tokenizer.getToken();
47+
result.push(token);
48+
} while (token.type !== acorn.tokTypes.eof)
49+
}
50+
} catch (e) {
51+
console.error(infile && infile !== "-" ? e.message.replace(/\(\d+:\d+\)$/, function (m) { return m.slice(0, 1) + infile + " " + m.slice(1); }) : e.message);
52+
process.exit(1);
53+
}
54+
if (!silent) { console.log(JSON.stringify(result, null, compact ? null : 2)); }
55+
}
56+
57+
if (forceFile || infile && infile !== "-") {
58+
run(fs.readFileSync(infile, "utf8"));
59+
} else {
60+
var code = "";
61+
process.stdin.resume();
62+
process.stdin.on("data", function (chunk) { return code += chunk; });
63+
process.stdin.on("end", function () { return run(code); });
64+
}

‎deps/acorn/acorn/package.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
"main": "dist/acorn.js",
66
"types": "dist/acorn.d.ts",
77
"module": "dist/acorn.mjs",
8-
"version": "7.1.1",
8+
"exports": {
9+
"import": "./dist/acorn.mjs",
10+
"require": "./dist/acorn.js"
11+
},
12+
"version": "8.0.4",
913
"engines": {"node": ">=0.4.0"},
1014
"maintainers": [
1115
{

‎lib/assert.js

-3
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,6 @@ function parseCode(code, offset) {
221221
require('internal/deps/acorn-plugins/acorn-private-methods/index');
222222
const classFields =
223223
require('internal/deps/acorn-plugins/acorn-class-fields/index');
224-
const numericSeparator =
225-
require('internal/deps/acorn-plugins/acorn-numeric-separator/index');
226224
const staticClassFeatures =
227225
require('internal/deps/acorn-plugins/acorn-static-class-features/index');
228226

@@ -231,7 +229,6 @@ function parseCode(code, offset) {
231229
const Parser = acorn.Parser.extend(
232230
privateMethods,
233231
classFields,
234-
numericSeparator,
235232
staticClassFeatures
236233
);
237234
parseExpressionAt = Parser.parseExpressionAt.bind(Parser);

‎lib/internal/repl/await.js

-3
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,12 @@ const privateMethods =
1010
require('internal/deps/acorn-plugins/acorn-private-methods/index');
1111
const classFields =
1212
require('internal/deps/acorn-plugins/acorn-class-fields/index');
13-
const numericSeparator =
14-
require('internal/deps/acorn-plugins/acorn-numeric-separator/index');
1513
const staticClassFeatures =
1614
require('internal/deps/acorn-plugins/acorn-static-class-features/index');
1715

1816
const parser = acorn.Parser.extend(
1917
privateMethods,
2018
classFields,
21-
numericSeparator,
2219
staticClassFeatures
2320
);
2421

‎lib/internal/repl/utils.js

-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ const privateMethods =
1212
require('internal/deps/acorn-plugins/acorn-private-methods/index');
1313
const classFields =
1414
require('internal/deps/acorn-plugins/acorn-class-fields/index');
15-
const numericSeparator =
16-
require('internal/deps/acorn-plugins/acorn-numeric-separator/index');
1715
const staticClassFeatures =
1816
require('internal/deps/acorn-plugins/acorn-static-class-features/index');
1917

@@ -85,7 +83,6 @@ function isRecoverableError(e, code) {
8583
.extend(
8684
privateMethods,
8785
classFields,
88-
numericSeparator,
8986
staticClassFeatures,
9087
(Parser) => {
9188
return class extends Parser {

‎node.gyp

-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@
252252
'deps/acorn/acorn/dist/acorn.js',
253253
'deps/acorn/acorn-walk/dist/walk.js',
254254
'deps/acorn-plugins/acorn-class-fields/index.js',
255-
'deps/acorn-plugins/acorn-numeric-separator/index.js',
256255
'deps/acorn-plugins/acorn-private-class-elements/index.js',
257256
'deps/acorn-plugins/acorn-private-methods/index.js',
258257
'deps/acorn-plugins/acorn-static-class-features/index.js',

0 commit comments

Comments
 (0)
Please sign in to comment.