meriyah 5.0.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +79 -0
- package/README.md +38 -14
- package/dist/meriyah.cjs +2356 -2070
- package/dist/meriyah.min.mjs +1 -0
- package/dist/{meriyah.esm.js → meriyah.mjs} +2356 -2070
- package/dist/meriyah.umd.js +2356 -2070
- package/dist/meriyah.umd.min.js +1 -1
- package/dist/src/common.d.ts +71 -47
- package/dist/src/common.d.ts.map +1 -1
- package/dist/src/errors.d.ts +186 -177
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/estree.d.ts +15 -6
- package/dist/src/estree.d.ts.map +1 -1
- package/dist/src/lexer/charClassifier.d.ts +2 -2
- package/dist/src/lexer/charClassifier.d.ts.map +1 -1
- package/dist/src/lexer/common.d.ts +1 -2
- package/dist/src/lexer/common.d.ts.map +1 -1
- package/dist/src/lexer/identifier.d.ts.map +1 -1
- package/dist/src/lexer/index.d.ts +1 -1
- package/dist/src/lexer/index.d.ts.map +1 -1
- package/dist/src/lexer/jsx.d.ts +2 -2
- package/dist/src/lexer/jsx.d.ts.map +1 -1
- package/dist/src/lexer/numeric.d.ts.map +1 -1
- package/dist/src/lexer/regexp.d.ts.map +1 -1
- package/dist/src/lexer/scan.d.ts.map +1 -1
- package/dist/src/lexer/string.d.ts +1 -1
- package/dist/src/lexer/string.d.ts.map +1 -1
- package/dist/src/lexer/template.d.ts.map +1 -1
- package/dist/src/parser.d.ts +72 -72
- package/dist/src/parser.d.ts.map +1 -1
- package/dist/src/token.d.ts +115 -115
- package/dist/src/token.d.ts.map +1 -1
- package/package.json +25 -34
- package/dist/meriyah.amd.js +0 -8964
- package/dist/meriyah.amd.min.js +0 -1
- package/dist/meriyah.cjs.js +0 -8962
- package/dist/meriyah.cjs.min.js +0 -1
- package/dist/meriyah.esm.min.js +0 -1
- package/dist/meriyah.esm.min.mjs +0 -1
- package/dist/meriyah.esm.mjs +0 -8956
- package/dist/meriyah.iife.js +0 -8967
- package/dist/meriyah.iife.min.js +0 -1
- package/dist/meriyah.min.cjs +0 -1
- package/dist/meriyah.system.js +0 -8970
- package/dist/meriyah.system.min.js +0 -1
- package/dist/meriyah.umd.cjs +0 -8968
- package/dist/meriyah.umd.es5.js +0 -9022
- package/dist/meriyah.umd.es5.min.js +0 -1
- package/dist/meriyah.umd.min.cjs +0 -1
- package/src/chars.ts +0 -155
- package/src/common.ts +0 -834
- package/src/errors.ts +0 -421
- package/src/estree.ts +0 -827
- package/src/lexer/charClassifier.ts +0 -449
- package/src/lexer/comments.ts +0 -178
- package/src/lexer/common.ts +0 -140
- package/src/lexer/decodeHTML.ts +0 -2184
- package/src/lexer/identifier.ts +0 -196
- package/src/lexer/index.ts +0 -32
- package/src/lexer/jsx.ts +0 -127
- package/src/lexer/numeric.ts +0 -259
- package/src/lexer/regexp.ts +0 -156
- package/src/lexer/scan.ts +0 -657
- package/src/lexer/string.ts +0 -242
- package/src/lexer/template.ts +0 -108
- package/src/meriyah.ts +0 -28
- package/src/parser.ts +0 -9358
- package/src/token.ts +0 -307
- package/src/unicode.ts +0 -36
package/src/estree.ts
DELETED
|
@@ -1,827 +0,0 @@
|
|
|
1
|
-
export interface _Node {
|
|
2
|
-
start?: number;
|
|
3
|
-
end?: number;
|
|
4
|
-
range?: [number, number];
|
|
5
|
-
loc?: SourceLocation | null;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export interface SourceLocation {
|
|
9
|
-
source?: string | null;
|
|
10
|
-
start: Position;
|
|
11
|
-
end: Position;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface Position {
|
|
15
|
-
/** >= 1 */
|
|
16
|
-
line: number;
|
|
17
|
-
/** >= 0 */
|
|
18
|
-
column: number;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export type Labels = any;
|
|
22
|
-
|
|
23
|
-
export type IdentifierOrExpression = Identifier | Expression | ArrowFunctionExpression;
|
|
24
|
-
|
|
25
|
-
export type ArgumentExpression =
|
|
26
|
-
| ArrayExpression
|
|
27
|
-
| AssignmentExpression
|
|
28
|
-
| ConditionalExpression
|
|
29
|
-
| Literal
|
|
30
|
-
| SpreadElement
|
|
31
|
-
| BinaryExpression
|
|
32
|
-
| LogicalExpression
|
|
33
|
-
| SequenceExpression;
|
|
34
|
-
|
|
35
|
-
export type CommentType = 'SingleLine' | 'MultiLine' | 'HTMLOpen' | 'HTMLClose' | 'HashbangComment';
|
|
36
|
-
|
|
37
|
-
export interface Comment {
|
|
38
|
-
type: CommentType;
|
|
39
|
-
value: string;
|
|
40
|
-
start?: number;
|
|
41
|
-
end?: number;
|
|
42
|
-
loc?: SourceLocation | null;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export type Node =
|
|
46
|
-
| ArrayExpression
|
|
47
|
-
| ArrayPattern
|
|
48
|
-
| ArrowFunctionExpression
|
|
49
|
-
| AssignmentExpression
|
|
50
|
-
| AssignmentPattern
|
|
51
|
-
| AwaitExpression
|
|
52
|
-
| BigIntLiteral
|
|
53
|
-
| BinaryExpression
|
|
54
|
-
| BlockStatement
|
|
55
|
-
| BreakStatement
|
|
56
|
-
| CallExpression
|
|
57
|
-
| ChainExpression
|
|
58
|
-
| ImportExpression
|
|
59
|
-
| CatchClause
|
|
60
|
-
| ClassBody
|
|
61
|
-
| ClassDeclaration
|
|
62
|
-
| ClassExpression
|
|
63
|
-
| ConditionalExpression
|
|
64
|
-
| ContinueStatement
|
|
65
|
-
| DebuggerStatement
|
|
66
|
-
| Decorator
|
|
67
|
-
| DoWhileStatement
|
|
68
|
-
| EmptyStatement
|
|
69
|
-
| ExportAllDeclaration
|
|
70
|
-
| ExportDefaultDeclaration
|
|
71
|
-
| ExportNamedDeclaration
|
|
72
|
-
| ExportSpecifier
|
|
73
|
-
| ExpressionStatement
|
|
74
|
-
| PropertyDefinition
|
|
75
|
-
| ForInStatement
|
|
76
|
-
| ForOfStatement
|
|
77
|
-
| ForStatement
|
|
78
|
-
| FunctionDeclaration
|
|
79
|
-
| FunctionExpression
|
|
80
|
-
| Identifier
|
|
81
|
-
| IfStatement
|
|
82
|
-
| Import
|
|
83
|
-
| ImportDeclaration
|
|
84
|
-
| ImportDefaultSpecifier
|
|
85
|
-
| ImportAttribute
|
|
86
|
-
| ImportNamespaceSpecifier
|
|
87
|
-
| ImportSpecifier
|
|
88
|
-
| JSXNamespacedName
|
|
89
|
-
| JSXAttribute
|
|
90
|
-
| JSXClosingElement
|
|
91
|
-
| JSXClosingFragment
|
|
92
|
-
| JSXElement
|
|
93
|
-
| JSXEmptyExpression
|
|
94
|
-
| JSXExpressionContainer
|
|
95
|
-
| JSXFragment
|
|
96
|
-
| JSXIdentifier
|
|
97
|
-
| JSXOpeningElement
|
|
98
|
-
| JSXOpeningFragment
|
|
99
|
-
| JSXSpreadAttribute
|
|
100
|
-
| JSXSpreadChild
|
|
101
|
-
| JSXMemberExpression
|
|
102
|
-
| JSXText
|
|
103
|
-
| LabeledStatement
|
|
104
|
-
| Literal
|
|
105
|
-
| LogicalExpression
|
|
106
|
-
| MemberExpression
|
|
107
|
-
| MetaProperty
|
|
108
|
-
| MethodDefinition
|
|
109
|
-
| NewExpression
|
|
110
|
-
| ObjectExpression
|
|
111
|
-
| ObjectPattern
|
|
112
|
-
| ParenthesizedExpression
|
|
113
|
-
| PrivateIdentifier
|
|
114
|
-
| Program
|
|
115
|
-
| Property
|
|
116
|
-
| RegExpLiteral
|
|
117
|
-
| RestElement
|
|
118
|
-
| ReturnStatement
|
|
119
|
-
| SequenceExpression
|
|
120
|
-
| SpreadElement
|
|
121
|
-
| StaticBlock
|
|
122
|
-
| Super
|
|
123
|
-
| SwitchCase
|
|
124
|
-
| SwitchStatement
|
|
125
|
-
| TaggedTemplateExpression
|
|
126
|
-
| TemplateElement
|
|
127
|
-
| TemplateLiteral
|
|
128
|
-
| ThisExpression
|
|
129
|
-
| ThrowStatement
|
|
130
|
-
| TryStatement
|
|
131
|
-
| UpdateExpression
|
|
132
|
-
| UnaryExpression
|
|
133
|
-
| VariableDeclaration
|
|
134
|
-
| VariableDeclarator
|
|
135
|
-
| WhileStatement
|
|
136
|
-
| WithStatement
|
|
137
|
-
| YieldExpression;
|
|
138
|
-
export type BindingPattern = ArrayPattern | ObjectPattern | Identifier;
|
|
139
|
-
export type ClassElement = FunctionExpression | MethodDefinition;
|
|
140
|
-
export type DeclarationStatement =
|
|
141
|
-
| ClassDeclaration
|
|
142
|
-
| ClassExpression
|
|
143
|
-
| ExportDefaultDeclaration
|
|
144
|
-
| ExportAllDeclaration
|
|
145
|
-
| ExportNamedDeclaration
|
|
146
|
-
| FunctionDeclaration;
|
|
147
|
-
export type EntityName = Identifier;
|
|
148
|
-
export type ExportDeclaration = ClassDeclaration | ClassExpression | FunctionDeclaration | VariableDeclaration;
|
|
149
|
-
export type Expression =
|
|
150
|
-
| ArrowFunctionExpression
|
|
151
|
-
| AssignmentExpression
|
|
152
|
-
| BinaryExpression
|
|
153
|
-
| ConditionalExpression
|
|
154
|
-
| MetaProperty
|
|
155
|
-
| ChainExpression
|
|
156
|
-
| JSXClosingElement
|
|
157
|
-
| JSXClosingFragment
|
|
158
|
-
| JSXExpressionContainer
|
|
159
|
-
| JSXOpeningElement
|
|
160
|
-
| JSXOpeningFragment
|
|
161
|
-
| JSXSpreadChild
|
|
162
|
-
| LogicalExpression
|
|
163
|
-
| NewExpression
|
|
164
|
-
| RestElement
|
|
165
|
-
| SequenceExpression
|
|
166
|
-
| SpreadElement
|
|
167
|
-
| AwaitExpression
|
|
168
|
-
| LeftHandSideExpression
|
|
169
|
-
| UnaryExpression
|
|
170
|
-
| UpdateExpression
|
|
171
|
-
| YieldExpression;
|
|
172
|
-
export type ForInitialiser = Expression | VariableDeclaration;
|
|
173
|
-
export type ImportClause = ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier;
|
|
174
|
-
export type IterationStatement = DoWhileStatement | ForInStatement | ForOfStatement | ForStatement | WhileStatement;
|
|
175
|
-
export type JSXChild = JSXElement | JSXExpression | JSXFragment | JSXText;
|
|
176
|
-
export type JSXExpression = JSXEmptyExpression | JSXSpreadChild | JSXExpressionContainer;
|
|
177
|
-
export type JSXTagNameExpression = JSXIdentifier | JSXMemberExpression | JSXNamespacedName;
|
|
178
|
-
export type LeftHandSideExpression =
|
|
179
|
-
| CallExpression
|
|
180
|
-
| ChainExpression
|
|
181
|
-
| ImportExpression
|
|
182
|
-
| ClassExpression
|
|
183
|
-
| ClassDeclaration
|
|
184
|
-
| FunctionExpression
|
|
185
|
-
| LiteralExpression
|
|
186
|
-
| MemberExpression
|
|
187
|
-
| PrimaryExpression
|
|
188
|
-
| TaggedTemplateExpression;
|
|
189
|
-
export type LiteralExpression = Literal | TemplateLiteral;
|
|
190
|
-
export type ObjectLiteralElementLike = MethodDefinition | Property | RestElement | SpreadElement;
|
|
191
|
-
export type Parameter = AssignmentPattern | RestElement | ArrayPattern | ObjectPattern | Identifier;
|
|
192
|
-
export type PrimaryExpression =
|
|
193
|
-
| ArrayExpression
|
|
194
|
-
| ArrayPattern
|
|
195
|
-
| ClassExpression
|
|
196
|
-
| FunctionExpression
|
|
197
|
-
| Identifier
|
|
198
|
-
| Import
|
|
199
|
-
| JSXElement
|
|
200
|
-
| JSXFragment
|
|
201
|
-
| JSXOpeningElement
|
|
202
|
-
| Literal
|
|
203
|
-
| LiteralExpression
|
|
204
|
-
| MetaProperty
|
|
205
|
-
| ObjectExpression
|
|
206
|
-
| ObjectPattern
|
|
207
|
-
| Super
|
|
208
|
-
| TemplateLiteral
|
|
209
|
-
| ThisExpression;
|
|
210
|
-
export type PrimaryExpressionExtended =
|
|
211
|
-
| ArrayExpression
|
|
212
|
-
| ArrowFunctionExpression
|
|
213
|
-
| ArrayPattern
|
|
214
|
-
| AwaitExpression
|
|
215
|
-
| Expression
|
|
216
|
-
| ClassExpression
|
|
217
|
-
| FunctionExpression
|
|
218
|
-
| Identifier
|
|
219
|
-
| Import
|
|
220
|
-
| JSXElement
|
|
221
|
-
| JSXFragment
|
|
222
|
-
| JSXOpeningElement
|
|
223
|
-
| Literal
|
|
224
|
-
| LiteralExpression
|
|
225
|
-
| MetaProperty
|
|
226
|
-
| ObjectExpression
|
|
227
|
-
| ObjectPattern
|
|
228
|
-
| PrivateIdentifier
|
|
229
|
-
| NewExpression
|
|
230
|
-
| Super
|
|
231
|
-
| TemplateLiteral
|
|
232
|
-
| ThisExpression
|
|
233
|
-
| UnaryExpression
|
|
234
|
-
| UpdateExpression;
|
|
235
|
-
export type PropertyName = Identifier | Literal;
|
|
236
|
-
export type Statement =
|
|
237
|
-
| BlockStatement
|
|
238
|
-
| BreakStatement
|
|
239
|
-
| ContinueStatement
|
|
240
|
-
| DebuggerStatement
|
|
241
|
-
| DeclarationStatement
|
|
242
|
-
| EmptyStatement
|
|
243
|
-
| ExpressionStatement
|
|
244
|
-
| IfStatement
|
|
245
|
-
| IterationStatement
|
|
246
|
-
| ImportDeclaration
|
|
247
|
-
| LabeledStatement
|
|
248
|
-
| ReturnStatement
|
|
249
|
-
| SwitchStatement
|
|
250
|
-
| ThrowStatement
|
|
251
|
-
| TryStatement
|
|
252
|
-
| VariableDeclaration
|
|
253
|
-
| WithStatement;
|
|
254
|
-
|
|
255
|
-
interface ClassDeclarationBase extends _Node {
|
|
256
|
-
id: Identifier | null;
|
|
257
|
-
body: ClassBody;
|
|
258
|
-
superClass: Expression | null;
|
|
259
|
-
decorators?: Decorator[];
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
interface FunctionDeclarationBase extends _Node {
|
|
263
|
-
id: Identifier | null;
|
|
264
|
-
generator: boolean;
|
|
265
|
-
async: boolean;
|
|
266
|
-
params: Parameter[];
|
|
267
|
-
body?: BlockStatement | null;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
interface MethodDefinitionBase extends _Node {
|
|
271
|
-
key: Expression | PrivateIdentifier | null;
|
|
272
|
-
value: FunctionExpression;
|
|
273
|
-
computed: boolean;
|
|
274
|
-
static: boolean;
|
|
275
|
-
kind: 'method' | 'get' | 'set' | 'constructor';
|
|
276
|
-
decorators?: Decorator[];
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
export interface BlockStatementBase extends _Node {
|
|
280
|
-
body: Statement[];
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
export interface ArrayExpression extends _Node {
|
|
284
|
-
type: 'ArrayExpression';
|
|
285
|
-
elements: (Expression | SpreadElement | null)[];
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
export interface ArrayPattern extends _Node {
|
|
289
|
-
type: 'ArrayPattern';
|
|
290
|
-
elements: Expression[];
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
export interface ArrowFunctionExpression extends _Node {
|
|
294
|
-
type: 'ArrowFunctionExpression';
|
|
295
|
-
params: Parameter[];
|
|
296
|
-
body: Expression | BlockStatement;
|
|
297
|
-
async: boolean;
|
|
298
|
-
expression: boolean;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
export interface AssignmentExpression extends _Node {
|
|
302
|
-
type: 'AssignmentExpression';
|
|
303
|
-
operator: string;
|
|
304
|
-
left: Expression;
|
|
305
|
-
right: Expression;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
export interface AssignmentPattern extends _Node {
|
|
309
|
-
type: 'AssignmentPattern';
|
|
310
|
-
left: BindingPattern | Identifier;
|
|
311
|
-
right?: Expression;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
export interface AwaitExpression extends _Node {
|
|
315
|
-
type: 'AwaitExpression';
|
|
316
|
-
argument: Expression;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
export interface BigIntLiteral extends Literal {
|
|
320
|
-
bigint: string;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
export interface BinaryExpression extends _Node {
|
|
324
|
-
type: 'BinaryExpression';
|
|
325
|
-
operator: string;
|
|
326
|
-
left: Expression;
|
|
327
|
-
right: Expression;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
export interface BlockStatement extends BlockStatementBase {
|
|
331
|
-
type: 'BlockStatement';
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
export interface BreakStatement extends _Node {
|
|
335
|
-
type: 'BreakStatement';
|
|
336
|
-
label: Identifier | null;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
export interface ImportExpression extends _Node {
|
|
340
|
-
type: 'ImportExpression';
|
|
341
|
-
source: Expression;
|
|
342
|
-
options?: Expression | null;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
export interface ChainExpression extends _Node {
|
|
346
|
-
type: 'ChainExpression';
|
|
347
|
-
expression: CallExpression | MemberExpression;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
export interface CallExpression extends _Node {
|
|
351
|
-
type: 'CallExpression';
|
|
352
|
-
callee: any; //Expression | Super;
|
|
353
|
-
arguments: (Expression | SpreadElement)[];
|
|
354
|
-
optional?: boolean;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
export interface CatchClause extends _Node {
|
|
358
|
-
type: 'CatchClause';
|
|
359
|
-
param: BindingPattern | Identifier | null;
|
|
360
|
-
body: BlockStatement;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
export interface StaticBlock extends BlockStatementBase {
|
|
364
|
-
type: 'StaticBlock';
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
export interface ClassBody extends _Node {
|
|
368
|
-
type: 'ClassBody';
|
|
369
|
-
body: (ClassElement | PropertyDefinition | StaticBlock)[];
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
export interface PropertyDefinition extends _Node {
|
|
373
|
-
type: 'PropertyDefinition';
|
|
374
|
-
key: PrivateIdentifier | Expression;
|
|
375
|
-
value: any;
|
|
376
|
-
decorators?: Decorator[];
|
|
377
|
-
computed: boolean;
|
|
378
|
-
static: boolean;
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
export interface PrivateIdentifier extends _Node {
|
|
382
|
-
type: 'PrivateIdentifier';
|
|
383
|
-
name: string;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
export interface ClassDeclaration extends ClassDeclarationBase {
|
|
387
|
-
type: 'ClassDeclaration';
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
export interface ClassExpression extends ClassDeclarationBase {
|
|
391
|
-
type: 'ClassExpression';
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
export interface ConditionalExpression extends _Node {
|
|
395
|
-
type: 'ConditionalExpression';
|
|
396
|
-
test: Expression;
|
|
397
|
-
consequent: Expression;
|
|
398
|
-
alternate: Expression;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
export interface ContinueStatement extends _Node {
|
|
402
|
-
type: 'ContinueStatement';
|
|
403
|
-
label: Identifier | null;
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
export interface DebuggerStatement extends _Node {
|
|
407
|
-
type: 'DebuggerStatement';
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
export interface Decorator extends _Node {
|
|
411
|
-
type: 'Decorator';
|
|
412
|
-
expression: LeftHandSideExpression;
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
export interface DoWhileStatement extends _Node {
|
|
416
|
-
type: 'DoWhileStatement';
|
|
417
|
-
test: Expression;
|
|
418
|
-
body: Statement;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
export interface EmptyStatement extends _Node {
|
|
422
|
-
type: 'EmptyStatement';
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
export interface ExportAllDeclaration extends _Node {
|
|
426
|
-
type: 'ExportAllDeclaration';
|
|
427
|
-
source: Literal;
|
|
428
|
-
exported: Identifier | null;
|
|
429
|
-
attributes?: ImportAttribute[];
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
export interface ExportDefaultDeclaration extends _Node {
|
|
433
|
-
type: 'ExportDefaultDeclaration';
|
|
434
|
-
declaration: ExportDeclaration | Expression;
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
export interface ExportNamedDeclaration extends _Node {
|
|
438
|
-
type: 'ExportNamedDeclaration';
|
|
439
|
-
declaration: ExportDeclaration | null;
|
|
440
|
-
specifiers: ExportSpecifier[];
|
|
441
|
-
source: Literal | null;
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
export interface ExportSpecifier extends _Node {
|
|
445
|
-
type: 'ExportSpecifier';
|
|
446
|
-
local: Identifier;
|
|
447
|
-
exported: Identifier;
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
export interface ExpressionStatement extends _Node {
|
|
451
|
-
type: 'ExpressionStatement';
|
|
452
|
-
expression: Expression;
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
export interface ForInStatement extends _Node {
|
|
456
|
-
type: 'ForInStatement';
|
|
457
|
-
left: ForInitialiser;
|
|
458
|
-
right: Expression;
|
|
459
|
-
body: Statement;
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
export interface ForOfStatement extends _Node {
|
|
463
|
-
type: 'ForOfStatement';
|
|
464
|
-
left: ForInitialiser;
|
|
465
|
-
right: Expression;
|
|
466
|
-
body: Statement;
|
|
467
|
-
await: boolean;
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
export interface ForStatement extends _Node {
|
|
471
|
-
type: 'ForStatement';
|
|
472
|
-
init: Expression | ForInitialiser | null;
|
|
473
|
-
test: Expression | null;
|
|
474
|
-
update: Expression | null;
|
|
475
|
-
body: Statement;
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
export interface FunctionDeclaration extends FunctionDeclarationBase {
|
|
479
|
-
type: 'FunctionDeclaration';
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
export interface FunctionExpression extends FunctionDeclarationBase {
|
|
483
|
-
type: 'FunctionExpression';
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
export interface Identifier extends _Node {
|
|
487
|
-
type: 'Identifier';
|
|
488
|
-
name: string;
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
export interface IfStatement extends _Node {
|
|
492
|
-
type: 'IfStatement';
|
|
493
|
-
test: Expression;
|
|
494
|
-
consequent: Statement;
|
|
495
|
-
alternate: Statement | null;
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
export interface Import extends _Node {
|
|
499
|
-
type: 'Import';
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
export interface ImportDeclaration extends _Node {
|
|
503
|
-
type: 'ImportDeclaration';
|
|
504
|
-
source: Literal;
|
|
505
|
-
specifiers: ImportClause[];
|
|
506
|
-
attributes?: ImportAttribute[];
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
export interface ImportAttribute extends _Node {
|
|
510
|
-
type: 'ImportAttribute';
|
|
511
|
-
key: Identifier | Literal;
|
|
512
|
-
value: Literal;
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
export interface ImportDefaultSpecifier extends _Node {
|
|
516
|
-
type: 'ImportDefaultSpecifier';
|
|
517
|
-
local: Identifier;
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
export interface ImportNamespaceSpecifier extends _Node {
|
|
521
|
-
type: 'ImportNamespaceSpecifier';
|
|
522
|
-
local: Identifier;
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
export interface ImportSpecifier extends _Node {
|
|
526
|
-
type: 'ImportSpecifier';
|
|
527
|
-
local: Identifier;
|
|
528
|
-
imported: Identifier;
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
export interface JSXNamespacedName extends _Node {
|
|
532
|
-
type: 'JSXNamespacedName';
|
|
533
|
-
namespace: JSXIdentifier | JSXMemberExpression;
|
|
534
|
-
name: JSXIdentifier;
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
export type JSXAttributeValue =
|
|
538
|
-
| JSXIdentifier
|
|
539
|
-
| Literal
|
|
540
|
-
| JSXElement
|
|
541
|
-
| JSXFragment
|
|
542
|
-
| JSXExpressionContainer
|
|
543
|
-
| JSXSpreadChild
|
|
544
|
-
| null;
|
|
545
|
-
|
|
546
|
-
export interface JSXAttribute extends _Node {
|
|
547
|
-
type: 'JSXAttribute';
|
|
548
|
-
name: JSXNamespacedName | JSXIdentifier;
|
|
549
|
-
value: JSXAttributeValue;
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
export interface JSXClosingElement extends _Node {
|
|
553
|
-
type: 'JSXClosingElement';
|
|
554
|
-
name: JSXTagNameExpression;
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
export interface JSXClosingFragment extends _Node {
|
|
558
|
-
type: 'JSXClosingFragment';
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
export interface JSXElement extends _Node {
|
|
562
|
-
type: 'JSXElement';
|
|
563
|
-
openingElement: JSXOpeningElement;
|
|
564
|
-
closingElement: JSXClosingElement | null;
|
|
565
|
-
children: JSXChild[];
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
export interface JSXEmptyExpression extends _Node {
|
|
569
|
-
type: 'JSXEmptyExpression';
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
export interface JSXExpressionContainer extends _Node {
|
|
573
|
-
type: 'JSXExpressionContainer';
|
|
574
|
-
expression: Expression | JSXEmptyExpression;
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
export interface JSXFragment extends _Node {
|
|
578
|
-
type: 'JSXFragment';
|
|
579
|
-
openingFragment: JSXOpeningFragment;
|
|
580
|
-
closingFragment: JSXClosingFragment;
|
|
581
|
-
children: JSXChild[];
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
export interface JSXIdentifier extends _Node {
|
|
585
|
-
type: 'JSXIdentifier';
|
|
586
|
-
name: string;
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
export interface JSXMemberExpression extends _Node {
|
|
590
|
-
type: 'JSXMemberExpression';
|
|
591
|
-
object: JSXTagNameExpression;
|
|
592
|
-
property: JSXIdentifier;
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
export interface JSXOpeningElement extends _Node {
|
|
596
|
-
type: 'JSXOpeningElement';
|
|
597
|
-
selfClosing: boolean;
|
|
598
|
-
name: JSXTagNameExpression;
|
|
599
|
-
attributes: (JSXAttribute | JSXSpreadAttribute)[];
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
export interface JSXOpeningFragment extends _Node {
|
|
603
|
-
type: 'JSXOpeningFragment';
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
export interface JSXSpreadAttribute extends _Node {
|
|
607
|
-
type: 'JSXSpreadAttribute';
|
|
608
|
-
argument: Expression;
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
export interface JSXSpreadChild extends _Node {
|
|
612
|
-
type: 'JSXSpreadChild';
|
|
613
|
-
expression: Expression | JSXEmptyExpression;
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
export interface JSXText extends _Node {
|
|
617
|
-
type: 'JSXText';
|
|
618
|
-
value: string;
|
|
619
|
-
raw?: string;
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
export interface LabeledStatement extends _Node {
|
|
623
|
-
type: 'LabeledStatement';
|
|
624
|
-
label: Identifier;
|
|
625
|
-
body: Statement;
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
export interface Literal extends _Node {
|
|
629
|
-
type: 'Literal';
|
|
630
|
-
value: boolean | number | string | null | RegExp | bigint;
|
|
631
|
-
raw?: string;
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
export interface LogicalExpression extends _Node {
|
|
635
|
-
type: 'LogicalExpression';
|
|
636
|
-
operator: string;
|
|
637
|
-
left: Expression;
|
|
638
|
-
right: Expression;
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
export interface MemberExpression extends _Node {
|
|
642
|
-
type: 'MemberExpression';
|
|
643
|
-
object: Expression | Super;
|
|
644
|
-
property: Expression | PrivateIdentifier;
|
|
645
|
-
computed?: boolean;
|
|
646
|
-
optional?: boolean;
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
export type Pattern = Identifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | MemberExpression;
|
|
650
|
-
|
|
651
|
-
export interface MetaProperty extends _Node {
|
|
652
|
-
type: 'MetaProperty';
|
|
653
|
-
meta: Identifier;
|
|
654
|
-
property: Identifier;
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
export interface MethodDefinition extends MethodDefinitionBase {
|
|
658
|
-
type: 'MethodDefinition';
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
export interface NewExpression extends _Node {
|
|
662
|
-
type: 'NewExpression';
|
|
663
|
-
callee: LeftHandSideExpression;
|
|
664
|
-
arguments: Expression[];
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
export interface ObjectExpression extends _Node {
|
|
668
|
-
type: 'ObjectExpression';
|
|
669
|
-
properties: ObjectLiteralElementLike[];
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
export interface ObjectPattern extends _Node {
|
|
673
|
-
type: 'ObjectPattern';
|
|
674
|
-
properties: ObjectLiteralElementLike[];
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
export interface Program extends _Node {
|
|
678
|
-
type: 'Program';
|
|
679
|
-
body: Statement[];
|
|
680
|
-
sourceType: 'module' | 'script';
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
export interface ParenthesizedExpression extends _Node {
|
|
684
|
-
type: 'ParenthesizedExpression';
|
|
685
|
-
expression: Expression;
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
export interface Property extends _Node {
|
|
689
|
-
type: 'Property';
|
|
690
|
-
key: Expression;
|
|
691
|
-
value: Expression | AssignmentPattern | BindingPattern | Identifier;
|
|
692
|
-
computed: boolean;
|
|
693
|
-
method: boolean;
|
|
694
|
-
shorthand: boolean;
|
|
695
|
-
kind: 'init' | 'get' | 'set';
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
export interface RegExpLiteral extends Literal {
|
|
699
|
-
regex: {
|
|
700
|
-
pattern: string;
|
|
701
|
-
flags: string;
|
|
702
|
-
};
|
|
703
|
-
}
|
|
704
|
-
|
|
705
|
-
export interface RestElement extends _Node {
|
|
706
|
-
type: 'RestElement';
|
|
707
|
-
argument: BindingPattern | Identifier | Expression | PropertyName;
|
|
708
|
-
value?: AssignmentPattern;
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
export interface ReturnStatement extends _Node {
|
|
712
|
-
type: 'ReturnStatement';
|
|
713
|
-
argument: Expression | null;
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
export interface SequenceExpression extends _Node {
|
|
717
|
-
type: 'SequenceExpression';
|
|
718
|
-
expressions: Expression[];
|
|
719
|
-
}
|
|
720
|
-
|
|
721
|
-
export type SpreadArgument = BindingPattern | Identifier | Expression | PropertyName | SpreadElement;
|
|
722
|
-
|
|
723
|
-
export interface SpreadElement extends _Node {
|
|
724
|
-
type: 'SpreadElement';
|
|
725
|
-
argument: SpreadArgument;
|
|
726
|
-
}
|
|
727
|
-
|
|
728
|
-
export interface Super extends _Node {
|
|
729
|
-
type: 'Super';
|
|
730
|
-
}
|
|
731
|
-
|
|
732
|
-
export interface SwitchCase extends _Node {
|
|
733
|
-
type: 'SwitchCase';
|
|
734
|
-
test: Expression | null;
|
|
735
|
-
consequent: Statement[];
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
export interface SwitchStatement extends _Node {
|
|
739
|
-
type: 'SwitchStatement';
|
|
740
|
-
discriminant: Expression;
|
|
741
|
-
cases: SwitchCase[];
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
export interface TaggedTemplateExpression extends _Node {
|
|
745
|
-
type: 'TaggedTemplateExpression';
|
|
746
|
-
tag: Expression;
|
|
747
|
-
quasi: TemplateLiteral;
|
|
748
|
-
}
|
|
749
|
-
|
|
750
|
-
export interface TemplateElement extends _Node {
|
|
751
|
-
type: 'TemplateElement';
|
|
752
|
-
value: {
|
|
753
|
-
raw: string;
|
|
754
|
-
cooked: string | null;
|
|
755
|
-
};
|
|
756
|
-
tail: boolean;
|
|
757
|
-
}
|
|
758
|
-
|
|
759
|
-
export interface TemplateLiteral extends _Node {
|
|
760
|
-
type: 'TemplateLiteral';
|
|
761
|
-
quasis: TemplateElement[];
|
|
762
|
-
expressions: Expression[];
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
export interface ThisExpression extends _Node {
|
|
766
|
-
type: 'ThisExpression';
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
export interface ThrowStatement extends _Node {
|
|
770
|
-
type: 'ThrowStatement';
|
|
771
|
-
argument: Expression;
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
export interface TryStatement extends _Node {
|
|
775
|
-
type: 'TryStatement';
|
|
776
|
-
block: BlockStatement;
|
|
777
|
-
handler: CatchClause | null;
|
|
778
|
-
finalizer: BlockStatement | null;
|
|
779
|
-
}
|
|
780
|
-
|
|
781
|
-
export type UnaryOperator = '-' | '+' | '!' | '~' | 'typeof' | 'void' | 'delete';
|
|
782
|
-
export type UpdateOperator = '++' | '--';
|
|
783
|
-
|
|
784
|
-
export interface UpdateExpression extends _Node {
|
|
785
|
-
type: 'UpdateExpression';
|
|
786
|
-
operator: UpdateOperator;
|
|
787
|
-
argument: Expression;
|
|
788
|
-
prefix: boolean;
|
|
789
|
-
}
|
|
790
|
-
|
|
791
|
-
export interface UnaryExpression extends _Node {
|
|
792
|
-
type: 'UnaryExpression';
|
|
793
|
-
operator: UnaryOperator;
|
|
794
|
-
prefix: true;
|
|
795
|
-
argument: Expression;
|
|
796
|
-
}
|
|
797
|
-
|
|
798
|
-
export interface VariableDeclaration extends _Node {
|
|
799
|
-
type: 'VariableDeclaration';
|
|
800
|
-
declarations: VariableDeclarator[];
|
|
801
|
-
kind: 'let' | 'const' | 'var';
|
|
802
|
-
}
|
|
803
|
-
|
|
804
|
-
export interface VariableDeclarator extends _Node {
|
|
805
|
-
type: 'VariableDeclarator';
|
|
806
|
-
id: Expression | BindingPattern | Identifier;
|
|
807
|
-
init: Expression | null;
|
|
808
|
-
definite?: boolean;
|
|
809
|
-
}
|
|
810
|
-
|
|
811
|
-
export interface WhileStatement extends _Node {
|
|
812
|
-
type: 'WhileStatement';
|
|
813
|
-
test: Expression;
|
|
814
|
-
body: Statement;
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
export interface WithStatement extends _Node {
|
|
818
|
-
type: 'WithStatement';
|
|
819
|
-
object: Expression;
|
|
820
|
-
body: Statement;
|
|
821
|
-
}
|
|
822
|
-
|
|
823
|
-
export interface YieldExpression extends _Node {
|
|
824
|
-
type: 'YieldExpression';
|
|
825
|
-
delegate: boolean;
|
|
826
|
-
argument?: Expression | null;
|
|
827
|
-
}
|