@cloud-cli/on 1.59.0 → 1.60.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/README.md +8 -5
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/db-client-BvMkK1lx.js +8 -0
- package/dist/db-client.d.ts +10 -16
- package/dist/db-client.d.ts.map +1 -1
- package/dist/events-BoODn7MY.js +56 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/matrix-expander-BItKqWu2.js +3439 -0
- package/dist/oidc.d.ts +39 -0
- package/dist/oidc.d.ts.map +1 -0
- package/dist/on.js +76 -22512
- package/dist/queue-DhXXzxm3.js +200 -0
- package/dist/rolldown-runtime-B0aSnxlc.js +20 -0
- package/dist/scheduler-2d1UPcxM.js +96 -0
- package/dist/secrets-BR6K16WY.js +30 -0
- package/dist/secrets-DhkqmawU.js +2 -0
- package/dist/server-CpHe08Nv.js +13445 -0
- package/dist/server.d.ts +13 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/test-setup.d.ts +2 -0
- package/dist/test-setup.d.ts.map +1 -0
- package/dist/timestamped-log-Dtz_Euu0.js +36 -0
- package/dist/types.d.ts +6 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/worker-riimPLUr.js +895 -0
- package/dist/workflow-registry-D4IciIF7.js +61 -0
- package/dist/workflows-BF2K4GpM.js +2 -0
- package/dist/workflows-Dm_0dWb_.js +4472 -0
- package/package.json +1 -1
|
@@ -0,0 +1,3439 @@
|
|
|
1
|
+
import e from "node:fs";
|
|
2
|
+
import t from "node:path";
|
|
3
|
+
//#region node_modules/.pnpm/acorn@8.18.0/node_modules/acorn/dist/acorn.mjs
|
|
4
|
+
var n = [
|
|
5
|
+
509,
|
|
6
|
+
0,
|
|
7
|
+
227,
|
|
8
|
+
0,
|
|
9
|
+
150,
|
|
10
|
+
4,
|
|
11
|
+
294,
|
|
12
|
+
9,
|
|
13
|
+
1368,
|
|
14
|
+
2,
|
|
15
|
+
2,
|
|
16
|
+
1,
|
|
17
|
+
6,
|
|
18
|
+
3,
|
|
19
|
+
41,
|
|
20
|
+
2,
|
|
21
|
+
5,
|
|
22
|
+
0,
|
|
23
|
+
166,
|
|
24
|
+
1,
|
|
25
|
+
574,
|
|
26
|
+
3,
|
|
27
|
+
9,
|
|
28
|
+
9,
|
|
29
|
+
7,
|
|
30
|
+
9,
|
|
31
|
+
32,
|
|
32
|
+
4,
|
|
33
|
+
318,
|
|
34
|
+
1,
|
|
35
|
+
78,
|
|
36
|
+
5,
|
|
37
|
+
71,
|
|
38
|
+
10,
|
|
39
|
+
50,
|
|
40
|
+
3,
|
|
41
|
+
123,
|
|
42
|
+
2,
|
|
43
|
+
54,
|
|
44
|
+
14,
|
|
45
|
+
32,
|
|
46
|
+
10,
|
|
47
|
+
3,
|
|
48
|
+
1,
|
|
49
|
+
11,
|
|
50
|
+
3,
|
|
51
|
+
46,
|
|
52
|
+
10,
|
|
53
|
+
8,
|
|
54
|
+
0,
|
|
55
|
+
46,
|
|
56
|
+
9,
|
|
57
|
+
7,
|
|
58
|
+
2,
|
|
59
|
+
37,
|
|
60
|
+
13,
|
|
61
|
+
2,
|
|
62
|
+
9,
|
|
63
|
+
6,
|
|
64
|
+
1,
|
|
65
|
+
45,
|
|
66
|
+
0,
|
|
67
|
+
13,
|
|
68
|
+
2,
|
|
69
|
+
49,
|
|
70
|
+
13,
|
|
71
|
+
9,
|
|
72
|
+
3,
|
|
73
|
+
2,
|
|
74
|
+
11,
|
|
75
|
+
83,
|
|
76
|
+
11,
|
|
77
|
+
7,
|
|
78
|
+
0,
|
|
79
|
+
3,
|
|
80
|
+
0,
|
|
81
|
+
158,
|
|
82
|
+
11,
|
|
83
|
+
6,
|
|
84
|
+
9,
|
|
85
|
+
7,
|
|
86
|
+
3,
|
|
87
|
+
56,
|
|
88
|
+
1,
|
|
89
|
+
2,
|
|
90
|
+
6,
|
|
91
|
+
3,
|
|
92
|
+
1,
|
|
93
|
+
3,
|
|
94
|
+
2,
|
|
95
|
+
10,
|
|
96
|
+
0,
|
|
97
|
+
11,
|
|
98
|
+
1,
|
|
99
|
+
3,
|
|
100
|
+
6,
|
|
101
|
+
4,
|
|
102
|
+
4,
|
|
103
|
+
68,
|
|
104
|
+
8,
|
|
105
|
+
2,
|
|
106
|
+
0,
|
|
107
|
+
3,
|
|
108
|
+
0,
|
|
109
|
+
2,
|
|
110
|
+
3,
|
|
111
|
+
2,
|
|
112
|
+
4,
|
|
113
|
+
2,
|
|
114
|
+
0,
|
|
115
|
+
15,
|
|
116
|
+
1,
|
|
117
|
+
83,
|
|
118
|
+
17,
|
|
119
|
+
10,
|
|
120
|
+
9,
|
|
121
|
+
5,
|
|
122
|
+
0,
|
|
123
|
+
82,
|
|
124
|
+
19,
|
|
125
|
+
13,
|
|
126
|
+
9,
|
|
127
|
+
214,
|
|
128
|
+
6,
|
|
129
|
+
3,
|
|
130
|
+
8,
|
|
131
|
+
28,
|
|
132
|
+
1,
|
|
133
|
+
83,
|
|
134
|
+
16,
|
|
135
|
+
16,
|
|
136
|
+
9,
|
|
137
|
+
82,
|
|
138
|
+
12,
|
|
139
|
+
9,
|
|
140
|
+
9,
|
|
141
|
+
7,
|
|
142
|
+
19,
|
|
143
|
+
58,
|
|
144
|
+
14,
|
|
145
|
+
5,
|
|
146
|
+
9,
|
|
147
|
+
243,
|
|
148
|
+
14,
|
|
149
|
+
166,
|
|
150
|
+
9,
|
|
151
|
+
71,
|
|
152
|
+
5,
|
|
153
|
+
2,
|
|
154
|
+
1,
|
|
155
|
+
3,
|
|
156
|
+
3,
|
|
157
|
+
2,
|
|
158
|
+
0,
|
|
159
|
+
2,
|
|
160
|
+
1,
|
|
161
|
+
13,
|
|
162
|
+
9,
|
|
163
|
+
120,
|
|
164
|
+
6,
|
|
165
|
+
3,
|
|
166
|
+
6,
|
|
167
|
+
4,
|
|
168
|
+
0,
|
|
169
|
+
29,
|
|
170
|
+
9,
|
|
171
|
+
41,
|
|
172
|
+
6,
|
|
173
|
+
2,
|
|
174
|
+
3,
|
|
175
|
+
9,
|
|
176
|
+
0,
|
|
177
|
+
10,
|
|
178
|
+
10,
|
|
179
|
+
47,
|
|
180
|
+
15,
|
|
181
|
+
199,
|
|
182
|
+
7,
|
|
183
|
+
137,
|
|
184
|
+
9,
|
|
185
|
+
54,
|
|
186
|
+
7,
|
|
187
|
+
2,
|
|
188
|
+
7,
|
|
189
|
+
17,
|
|
190
|
+
9,
|
|
191
|
+
57,
|
|
192
|
+
21,
|
|
193
|
+
2,
|
|
194
|
+
13,
|
|
195
|
+
123,
|
|
196
|
+
5,
|
|
197
|
+
4,
|
|
198
|
+
0,
|
|
199
|
+
2,
|
|
200
|
+
1,
|
|
201
|
+
2,
|
|
202
|
+
6,
|
|
203
|
+
2,
|
|
204
|
+
0,
|
|
205
|
+
9,
|
|
206
|
+
9,
|
|
207
|
+
49,
|
|
208
|
+
4,
|
|
209
|
+
2,
|
|
210
|
+
1,
|
|
211
|
+
2,
|
|
212
|
+
4,
|
|
213
|
+
9,
|
|
214
|
+
9,
|
|
215
|
+
55,
|
|
216
|
+
9,
|
|
217
|
+
266,
|
|
218
|
+
3,
|
|
219
|
+
10,
|
|
220
|
+
1,
|
|
221
|
+
2,
|
|
222
|
+
0,
|
|
223
|
+
49,
|
|
224
|
+
6,
|
|
225
|
+
4,
|
|
226
|
+
4,
|
|
227
|
+
14,
|
|
228
|
+
10,
|
|
229
|
+
5350,
|
|
230
|
+
0,
|
|
231
|
+
7,
|
|
232
|
+
14,
|
|
233
|
+
11465,
|
|
234
|
+
27,
|
|
235
|
+
2343,
|
|
236
|
+
9,
|
|
237
|
+
87,
|
|
238
|
+
9,
|
|
239
|
+
39,
|
|
240
|
+
4,
|
|
241
|
+
60,
|
|
242
|
+
6,
|
|
243
|
+
26,
|
|
244
|
+
9,
|
|
245
|
+
535,
|
|
246
|
+
9,
|
|
247
|
+
470,
|
|
248
|
+
0,
|
|
249
|
+
2,
|
|
250
|
+
54,
|
|
251
|
+
8,
|
|
252
|
+
3,
|
|
253
|
+
82,
|
|
254
|
+
0,
|
|
255
|
+
12,
|
|
256
|
+
1,
|
|
257
|
+
19628,
|
|
258
|
+
1,
|
|
259
|
+
4178,
|
|
260
|
+
9,
|
|
261
|
+
519,
|
|
262
|
+
45,
|
|
263
|
+
3,
|
|
264
|
+
22,
|
|
265
|
+
543,
|
|
266
|
+
4,
|
|
267
|
+
4,
|
|
268
|
+
5,
|
|
269
|
+
9,
|
|
270
|
+
7,
|
|
271
|
+
3,
|
|
272
|
+
6,
|
|
273
|
+
31,
|
|
274
|
+
3,
|
|
275
|
+
149,
|
|
276
|
+
2,
|
|
277
|
+
1418,
|
|
278
|
+
49,
|
|
279
|
+
513,
|
|
280
|
+
54,
|
|
281
|
+
5,
|
|
282
|
+
49,
|
|
283
|
+
9,
|
|
284
|
+
0,
|
|
285
|
+
15,
|
|
286
|
+
0,
|
|
287
|
+
23,
|
|
288
|
+
4,
|
|
289
|
+
2,
|
|
290
|
+
14,
|
|
291
|
+
1361,
|
|
292
|
+
6,
|
|
293
|
+
2,
|
|
294
|
+
16,
|
|
295
|
+
3,
|
|
296
|
+
6,
|
|
297
|
+
2,
|
|
298
|
+
1,
|
|
299
|
+
2,
|
|
300
|
+
4,
|
|
301
|
+
101,
|
|
302
|
+
0,
|
|
303
|
+
161,
|
|
304
|
+
6,
|
|
305
|
+
10,
|
|
306
|
+
9,
|
|
307
|
+
357,
|
|
308
|
+
0,
|
|
309
|
+
62,
|
|
310
|
+
13,
|
|
311
|
+
499,
|
|
312
|
+
13,
|
|
313
|
+
245,
|
|
314
|
+
1,
|
|
315
|
+
2,
|
|
316
|
+
9,
|
|
317
|
+
233,
|
|
318
|
+
0,
|
|
319
|
+
3,
|
|
320
|
+
0,
|
|
321
|
+
8,
|
|
322
|
+
1,
|
|
323
|
+
6,
|
|
324
|
+
0,
|
|
325
|
+
475,
|
|
326
|
+
6,
|
|
327
|
+
110,
|
|
328
|
+
6,
|
|
329
|
+
6,
|
|
330
|
+
9,
|
|
331
|
+
4759,
|
|
332
|
+
9,
|
|
333
|
+
787719,
|
|
334
|
+
239
|
|
335
|
+
], r = [
|
|
336
|
+
0,
|
|
337
|
+
11,
|
|
338
|
+
2,
|
|
339
|
+
25,
|
|
340
|
+
2,
|
|
341
|
+
18,
|
|
342
|
+
2,
|
|
343
|
+
1,
|
|
344
|
+
2,
|
|
345
|
+
14,
|
|
346
|
+
3,
|
|
347
|
+
13,
|
|
348
|
+
35,
|
|
349
|
+
122,
|
|
350
|
+
70,
|
|
351
|
+
52,
|
|
352
|
+
268,
|
|
353
|
+
28,
|
|
354
|
+
4,
|
|
355
|
+
48,
|
|
356
|
+
48,
|
|
357
|
+
31,
|
|
358
|
+
14,
|
|
359
|
+
29,
|
|
360
|
+
6,
|
|
361
|
+
37,
|
|
362
|
+
11,
|
|
363
|
+
29,
|
|
364
|
+
3,
|
|
365
|
+
35,
|
|
366
|
+
5,
|
|
367
|
+
7,
|
|
368
|
+
2,
|
|
369
|
+
4,
|
|
370
|
+
43,
|
|
371
|
+
157,
|
|
372
|
+
19,
|
|
373
|
+
35,
|
|
374
|
+
5,
|
|
375
|
+
35,
|
|
376
|
+
5,
|
|
377
|
+
39,
|
|
378
|
+
9,
|
|
379
|
+
51,
|
|
380
|
+
13,
|
|
381
|
+
10,
|
|
382
|
+
2,
|
|
383
|
+
14,
|
|
384
|
+
2,
|
|
385
|
+
6,
|
|
386
|
+
2,
|
|
387
|
+
1,
|
|
388
|
+
2,
|
|
389
|
+
10,
|
|
390
|
+
2,
|
|
391
|
+
14,
|
|
392
|
+
2,
|
|
393
|
+
6,
|
|
394
|
+
2,
|
|
395
|
+
1,
|
|
396
|
+
4,
|
|
397
|
+
51,
|
|
398
|
+
13,
|
|
399
|
+
310,
|
|
400
|
+
10,
|
|
401
|
+
21,
|
|
402
|
+
11,
|
|
403
|
+
7,
|
|
404
|
+
25,
|
|
405
|
+
5,
|
|
406
|
+
2,
|
|
407
|
+
41,
|
|
408
|
+
2,
|
|
409
|
+
8,
|
|
410
|
+
70,
|
|
411
|
+
5,
|
|
412
|
+
3,
|
|
413
|
+
0,
|
|
414
|
+
2,
|
|
415
|
+
43,
|
|
416
|
+
2,
|
|
417
|
+
1,
|
|
418
|
+
4,
|
|
419
|
+
0,
|
|
420
|
+
3,
|
|
421
|
+
22,
|
|
422
|
+
11,
|
|
423
|
+
22,
|
|
424
|
+
10,
|
|
425
|
+
30,
|
|
426
|
+
66,
|
|
427
|
+
18,
|
|
428
|
+
2,
|
|
429
|
+
1,
|
|
430
|
+
11,
|
|
431
|
+
21,
|
|
432
|
+
11,
|
|
433
|
+
25,
|
|
434
|
+
7,
|
|
435
|
+
25,
|
|
436
|
+
39,
|
|
437
|
+
55,
|
|
438
|
+
7,
|
|
439
|
+
1,
|
|
440
|
+
65,
|
|
441
|
+
0,
|
|
442
|
+
16,
|
|
443
|
+
3,
|
|
444
|
+
2,
|
|
445
|
+
2,
|
|
446
|
+
2,
|
|
447
|
+
28,
|
|
448
|
+
43,
|
|
449
|
+
28,
|
|
450
|
+
4,
|
|
451
|
+
28,
|
|
452
|
+
36,
|
|
453
|
+
7,
|
|
454
|
+
2,
|
|
455
|
+
27,
|
|
456
|
+
28,
|
|
457
|
+
53,
|
|
458
|
+
11,
|
|
459
|
+
21,
|
|
460
|
+
11,
|
|
461
|
+
18,
|
|
462
|
+
14,
|
|
463
|
+
17,
|
|
464
|
+
111,
|
|
465
|
+
72,
|
|
466
|
+
56,
|
|
467
|
+
50,
|
|
468
|
+
14,
|
|
469
|
+
50,
|
|
470
|
+
14,
|
|
471
|
+
35,
|
|
472
|
+
39,
|
|
473
|
+
27,
|
|
474
|
+
10,
|
|
475
|
+
22,
|
|
476
|
+
251,
|
|
477
|
+
41,
|
|
478
|
+
7,
|
|
479
|
+
1,
|
|
480
|
+
17,
|
|
481
|
+
5,
|
|
482
|
+
57,
|
|
483
|
+
28,
|
|
484
|
+
11,
|
|
485
|
+
0,
|
|
486
|
+
9,
|
|
487
|
+
21,
|
|
488
|
+
43,
|
|
489
|
+
17,
|
|
490
|
+
47,
|
|
491
|
+
20,
|
|
492
|
+
28,
|
|
493
|
+
22,
|
|
494
|
+
13,
|
|
495
|
+
52,
|
|
496
|
+
58,
|
|
497
|
+
1,
|
|
498
|
+
3,
|
|
499
|
+
0,
|
|
500
|
+
14,
|
|
501
|
+
44,
|
|
502
|
+
33,
|
|
503
|
+
24,
|
|
504
|
+
27,
|
|
505
|
+
35,
|
|
506
|
+
30,
|
|
507
|
+
0,
|
|
508
|
+
3,
|
|
509
|
+
0,
|
|
510
|
+
9,
|
|
511
|
+
34,
|
|
512
|
+
4,
|
|
513
|
+
0,
|
|
514
|
+
13,
|
|
515
|
+
47,
|
|
516
|
+
15,
|
|
517
|
+
3,
|
|
518
|
+
22,
|
|
519
|
+
0,
|
|
520
|
+
2,
|
|
521
|
+
0,
|
|
522
|
+
36,
|
|
523
|
+
17,
|
|
524
|
+
2,
|
|
525
|
+
24,
|
|
526
|
+
20,
|
|
527
|
+
1,
|
|
528
|
+
64,
|
|
529
|
+
6,
|
|
530
|
+
2,
|
|
531
|
+
0,
|
|
532
|
+
2,
|
|
533
|
+
3,
|
|
534
|
+
2,
|
|
535
|
+
14,
|
|
536
|
+
2,
|
|
537
|
+
9,
|
|
538
|
+
8,
|
|
539
|
+
46,
|
|
540
|
+
39,
|
|
541
|
+
7,
|
|
542
|
+
3,
|
|
543
|
+
1,
|
|
544
|
+
3,
|
|
545
|
+
21,
|
|
546
|
+
2,
|
|
547
|
+
6,
|
|
548
|
+
2,
|
|
549
|
+
1,
|
|
550
|
+
2,
|
|
551
|
+
4,
|
|
552
|
+
4,
|
|
553
|
+
0,
|
|
554
|
+
19,
|
|
555
|
+
0,
|
|
556
|
+
13,
|
|
557
|
+
4,
|
|
558
|
+
31,
|
|
559
|
+
9,
|
|
560
|
+
2,
|
|
561
|
+
0,
|
|
562
|
+
3,
|
|
563
|
+
0,
|
|
564
|
+
2,
|
|
565
|
+
37,
|
|
566
|
+
2,
|
|
567
|
+
0,
|
|
568
|
+
26,
|
|
569
|
+
0,
|
|
570
|
+
2,
|
|
571
|
+
0,
|
|
572
|
+
45,
|
|
573
|
+
52,
|
|
574
|
+
19,
|
|
575
|
+
3,
|
|
576
|
+
21,
|
|
577
|
+
2,
|
|
578
|
+
31,
|
|
579
|
+
47,
|
|
580
|
+
21,
|
|
581
|
+
1,
|
|
582
|
+
2,
|
|
583
|
+
0,
|
|
584
|
+
185,
|
|
585
|
+
46,
|
|
586
|
+
42,
|
|
587
|
+
3,
|
|
588
|
+
37,
|
|
589
|
+
47,
|
|
590
|
+
21,
|
|
591
|
+
0,
|
|
592
|
+
60,
|
|
593
|
+
42,
|
|
594
|
+
14,
|
|
595
|
+
0,
|
|
596
|
+
72,
|
|
597
|
+
26,
|
|
598
|
+
38,
|
|
599
|
+
6,
|
|
600
|
+
186,
|
|
601
|
+
43,
|
|
602
|
+
117,
|
|
603
|
+
63,
|
|
604
|
+
32,
|
|
605
|
+
7,
|
|
606
|
+
3,
|
|
607
|
+
0,
|
|
608
|
+
3,
|
|
609
|
+
7,
|
|
610
|
+
2,
|
|
611
|
+
1,
|
|
612
|
+
2,
|
|
613
|
+
23,
|
|
614
|
+
16,
|
|
615
|
+
0,
|
|
616
|
+
2,
|
|
617
|
+
0,
|
|
618
|
+
95,
|
|
619
|
+
7,
|
|
620
|
+
3,
|
|
621
|
+
38,
|
|
622
|
+
17,
|
|
623
|
+
0,
|
|
624
|
+
2,
|
|
625
|
+
0,
|
|
626
|
+
29,
|
|
627
|
+
0,
|
|
628
|
+
11,
|
|
629
|
+
39,
|
|
630
|
+
8,
|
|
631
|
+
0,
|
|
632
|
+
22,
|
|
633
|
+
0,
|
|
634
|
+
12,
|
|
635
|
+
45,
|
|
636
|
+
20,
|
|
637
|
+
0,
|
|
638
|
+
19,
|
|
639
|
+
72,
|
|
640
|
+
200,
|
|
641
|
+
32,
|
|
642
|
+
32,
|
|
643
|
+
8,
|
|
644
|
+
2,
|
|
645
|
+
36,
|
|
646
|
+
18,
|
|
647
|
+
0,
|
|
648
|
+
50,
|
|
649
|
+
29,
|
|
650
|
+
113,
|
|
651
|
+
6,
|
|
652
|
+
2,
|
|
653
|
+
1,
|
|
654
|
+
2,
|
|
655
|
+
37,
|
|
656
|
+
22,
|
|
657
|
+
0,
|
|
658
|
+
26,
|
|
659
|
+
5,
|
|
660
|
+
2,
|
|
661
|
+
1,
|
|
662
|
+
2,
|
|
663
|
+
31,
|
|
664
|
+
15,
|
|
665
|
+
0,
|
|
666
|
+
24,
|
|
667
|
+
43,
|
|
668
|
+
261,
|
|
669
|
+
18,
|
|
670
|
+
16,
|
|
671
|
+
0,
|
|
672
|
+
2,
|
|
673
|
+
12,
|
|
674
|
+
2,
|
|
675
|
+
33,
|
|
676
|
+
125,
|
|
677
|
+
0,
|
|
678
|
+
80,
|
|
679
|
+
921,
|
|
680
|
+
103,
|
|
681
|
+
110,
|
|
682
|
+
18,
|
|
683
|
+
195,
|
|
684
|
+
2637,
|
|
685
|
+
96,
|
|
686
|
+
16,
|
|
687
|
+
1071,
|
|
688
|
+
18,
|
|
689
|
+
5,
|
|
690
|
+
26,
|
|
691
|
+
3994,
|
|
692
|
+
6,
|
|
693
|
+
582,
|
|
694
|
+
6842,
|
|
695
|
+
29,
|
|
696
|
+
1763,
|
|
697
|
+
568,
|
|
698
|
+
8,
|
|
699
|
+
30,
|
|
700
|
+
18,
|
|
701
|
+
78,
|
|
702
|
+
18,
|
|
703
|
+
29,
|
|
704
|
+
19,
|
|
705
|
+
47,
|
|
706
|
+
17,
|
|
707
|
+
3,
|
|
708
|
+
32,
|
|
709
|
+
20,
|
|
710
|
+
6,
|
|
711
|
+
18,
|
|
712
|
+
433,
|
|
713
|
+
44,
|
|
714
|
+
212,
|
|
715
|
+
63,
|
|
716
|
+
33,
|
|
717
|
+
24,
|
|
718
|
+
3,
|
|
719
|
+
24,
|
|
720
|
+
45,
|
|
721
|
+
74,
|
|
722
|
+
6,
|
|
723
|
+
0,
|
|
724
|
+
67,
|
|
725
|
+
12,
|
|
726
|
+
65,
|
|
727
|
+
1,
|
|
728
|
+
2,
|
|
729
|
+
0,
|
|
730
|
+
15,
|
|
731
|
+
4,
|
|
732
|
+
10,
|
|
733
|
+
7381,
|
|
734
|
+
42,
|
|
735
|
+
31,
|
|
736
|
+
98,
|
|
737
|
+
114,
|
|
738
|
+
8702,
|
|
739
|
+
3,
|
|
740
|
+
2,
|
|
741
|
+
6,
|
|
742
|
+
2,
|
|
743
|
+
1,
|
|
744
|
+
2,
|
|
745
|
+
290,
|
|
746
|
+
16,
|
|
747
|
+
0,
|
|
748
|
+
30,
|
|
749
|
+
2,
|
|
750
|
+
3,
|
|
751
|
+
0,
|
|
752
|
+
15,
|
|
753
|
+
3,
|
|
754
|
+
9,
|
|
755
|
+
395,
|
|
756
|
+
2309,
|
|
757
|
+
106,
|
|
758
|
+
6,
|
|
759
|
+
12,
|
|
760
|
+
4,
|
|
761
|
+
8,
|
|
762
|
+
8,
|
|
763
|
+
9,
|
|
764
|
+
5991,
|
|
765
|
+
84,
|
|
766
|
+
2,
|
|
767
|
+
70,
|
|
768
|
+
2,
|
|
769
|
+
1,
|
|
770
|
+
3,
|
|
771
|
+
0,
|
|
772
|
+
3,
|
|
773
|
+
1,
|
|
774
|
+
3,
|
|
775
|
+
3,
|
|
776
|
+
2,
|
|
777
|
+
11,
|
|
778
|
+
2,
|
|
779
|
+
0,
|
|
780
|
+
2,
|
|
781
|
+
6,
|
|
782
|
+
2,
|
|
783
|
+
64,
|
|
784
|
+
2,
|
|
785
|
+
3,
|
|
786
|
+
3,
|
|
787
|
+
7,
|
|
788
|
+
2,
|
|
789
|
+
6,
|
|
790
|
+
2,
|
|
791
|
+
27,
|
|
792
|
+
2,
|
|
793
|
+
3,
|
|
794
|
+
2,
|
|
795
|
+
4,
|
|
796
|
+
2,
|
|
797
|
+
0,
|
|
798
|
+
4,
|
|
799
|
+
6,
|
|
800
|
+
2,
|
|
801
|
+
339,
|
|
802
|
+
3,
|
|
803
|
+
24,
|
|
804
|
+
2,
|
|
805
|
+
24,
|
|
806
|
+
2,
|
|
807
|
+
30,
|
|
808
|
+
2,
|
|
809
|
+
24,
|
|
810
|
+
2,
|
|
811
|
+
30,
|
|
812
|
+
2,
|
|
813
|
+
24,
|
|
814
|
+
2,
|
|
815
|
+
30,
|
|
816
|
+
2,
|
|
817
|
+
24,
|
|
818
|
+
2,
|
|
819
|
+
30,
|
|
820
|
+
2,
|
|
821
|
+
24,
|
|
822
|
+
2,
|
|
823
|
+
7,
|
|
824
|
+
1845,
|
|
825
|
+
30,
|
|
826
|
+
7,
|
|
827
|
+
5,
|
|
828
|
+
262,
|
|
829
|
+
61,
|
|
830
|
+
147,
|
|
831
|
+
44,
|
|
832
|
+
11,
|
|
833
|
+
6,
|
|
834
|
+
17,
|
|
835
|
+
0,
|
|
836
|
+
322,
|
|
837
|
+
29,
|
|
838
|
+
19,
|
|
839
|
+
43,
|
|
840
|
+
485,
|
|
841
|
+
27,
|
|
842
|
+
229,
|
|
843
|
+
29,
|
|
844
|
+
3,
|
|
845
|
+
0,
|
|
846
|
+
208,
|
|
847
|
+
30,
|
|
848
|
+
2,
|
|
849
|
+
2,
|
|
850
|
+
2,
|
|
851
|
+
1,
|
|
852
|
+
2,
|
|
853
|
+
6,
|
|
854
|
+
3,
|
|
855
|
+
4,
|
|
856
|
+
10,
|
|
857
|
+
1,
|
|
858
|
+
225,
|
|
859
|
+
6,
|
|
860
|
+
2,
|
|
861
|
+
3,
|
|
862
|
+
2,
|
|
863
|
+
1,
|
|
864
|
+
2,
|
|
865
|
+
14,
|
|
866
|
+
2,
|
|
867
|
+
196,
|
|
868
|
+
60,
|
|
869
|
+
67,
|
|
870
|
+
8,
|
|
871
|
+
0,
|
|
872
|
+
1205,
|
|
873
|
+
3,
|
|
874
|
+
2,
|
|
875
|
+
26,
|
|
876
|
+
2,
|
|
877
|
+
1,
|
|
878
|
+
2,
|
|
879
|
+
0,
|
|
880
|
+
3,
|
|
881
|
+
0,
|
|
882
|
+
2,
|
|
883
|
+
9,
|
|
884
|
+
2,
|
|
885
|
+
3,
|
|
886
|
+
2,
|
|
887
|
+
0,
|
|
888
|
+
2,
|
|
889
|
+
0,
|
|
890
|
+
7,
|
|
891
|
+
0,
|
|
892
|
+
5,
|
|
893
|
+
0,
|
|
894
|
+
2,
|
|
895
|
+
0,
|
|
896
|
+
2,
|
|
897
|
+
0,
|
|
898
|
+
2,
|
|
899
|
+
2,
|
|
900
|
+
2,
|
|
901
|
+
1,
|
|
902
|
+
2,
|
|
903
|
+
0,
|
|
904
|
+
3,
|
|
905
|
+
0,
|
|
906
|
+
2,
|
|
907
|
+
0,
|
|
908
|
+
2,
|
|
909
|
+
0,
|
|
910
|
+
2,
|
|
911
|
+
0,
|
|
912
|
+
2,
|
|
913
|
+
0,
|
|
914
|
+
2,
|
|
915
|
+
1,
|
|
916
|
+
2,
|
|
917
|
+
0,
|
|
918
|
+
3,
|
|
919
|
+
3,
|
|
920
|
+
2,
|
|
921
|
+
6,
|
|
922
|
+
2,
|
|
923
|
+
3,
|
|
924
|
+
2,
|
|
925
|
+
3,
|
|
926
|
+
2,
|
|
927
|
+
0,
|
|
928
|
+
2,
|
|
929
|
+
9,
|
|
930
|
+
2,
|
|
931
|
+
16,
|
|
932
|
+
6,
|
|
933
|
+
2,
|
|
934
|
+
2,
|
|
935
|
+
4,
|
|
936
|
+
2,
|
|
937
|
+
16,
|
|
938
|
+
4421,
|
|
939
|
+
42719,
|
|
940
|
+
33,
|
|
941
|
+
4381,
|
|
942
|
+
3,
|
|
943
|
+
5773,
|
|
944
|
+
3,
|
|
945
|
+
7472,
|
|
946
|
+
16,
|
|
947
|
+
621,
|
|
948
|
+
2467,
|
|
949
|
+
541,
|
|
950
|
+
1507,
|
|
951
|
+
4938,
|
|
952
|
+
6,
|
|
953
|
+
8489
|
|
954
|
+
], i = "·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ--ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・", a = "ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ", o = {
|
|
955
|
+
3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",
|
|
956
|
+
5: "class enum extends super const export import",
|
|
957
|
+
6: "enum",
|
|
958
|
+
strict: "implements interface let package private protected public static yield",
|
|
959
|
+
strictBind: "eval arguments"
|
|
960
|
+
}, s = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this", c = {
|
|
961
|
+
5: s,
|
|
962
|
+
"5module": s + " export import",
|
|
963
|
+
6: s + " const class extends export import super"
|
|
964
|
+
}, l = /^in(stanceof)?$/, u = RegExp("[" + a + "]"), d = RegExp("[" + a + i + "]");
|
|
965
|
+
function f(e, t) {
|
|
966
|
+
for (var n = 65536, r = 0; r < t.length; r += 2) {
|
|
967
|
+
if (n += t[r], n > e) return !1;
|
|
968
|
+
if (n += t[r + 1], n >= e) return !0;
|
|
969
|
+
}
|
|
970
|
+
return !1;
|
|
971
|
+
}
|
|
972
|
+
function p(e, t) {
|
|
973
|
+
return e < 65 ? e === 36 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 && u.test(String.fromCharCode(e)) : t !== !1 && f(e, r);
|
|
974
|
+
}
|
|
975
|
+
function m(e, t) {
|
|
976
|
+
return e < 48 ? e === 36 : e < 58 ? !0 : e < 65 ? !1 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 && d.test(String.fromCharCode(e)) : t === !1 ? !1 : f(e, r) || f(e, n);
|
|
977
|
+
}
|
|
978
|
+
var h = function(e, t) {
|
|
979
|
+
t === void 0 && (t = {}), this.label = e, this.keyword = t.keyword, this.beforeExpr = !!t.beforeExpr, this.startsExpr = !!t.startsExpr, this.isLoop = !!t.isLoop, this.isAssign = !!t.isAssign, this.prefix = !!t.prefix, this.postfix = !!t.postfix, this.binop = t.binop || null, this.updateContext = null;
|
|
980
|
+
};
|
|
981
|
+
function g(e, t) {
|
|
982
|
+
return new h(e, {
|
|
983
|
+
beforeExpr: !0,
|
|
984
|
+
binop: t
|
|
985
|
+
});
|
|
986
|
+
}
|
|
987
|
+
var _ = { beforeExpr: !0 }, v = { startsExpr: !0 }, ee = {};
|
|
988
|
+
function y(e, t) {
|
|
989
|
+
return t === void 0 && (t = {}), t.keyword = e, ee[e] = new h(e, t);
|
|
990
|
+
}
|
|
991
|
+
var b = {
|
|
992
|
+
num: new h("num", v),
|
|
993
|
+
regexp: new h("regexp", v),
|
|
994
|
+
string: new h("string", v),
|
|
995
|
+
name: new h("name", v),
|
|
996
|
+
privateId: new h("privateId", v),
|
|
997
|
+
eof: new h("eof"),
|
|
998
|
+
bracketL: new h("[", {
|
|
999
|
+
beforeExpr: !0,
|
|
1000
|
+
startsExpr: !0
|
|
1001
|
+
}),
|
|
1002
|
+
bracketR: new h("]"),
|
|
1003
|
+
braceL: new h("{", {
|
|
1004
|
+
beforeExpr: !0,
|
|
1005
|
+
startsExpr: !0
|
|
1006
|
+
}),
|
|
1007
|
+
braceR: new h("}"),
|
|
1008
|
+
parenL: new h("(", {
|
|
1009
|
+
beforeExpr: !0,
|
|
1010
|
+
startsExpr: !0
|
|
1011
|
+
}),
|
|
1012
|
+
parenR: new h(")"),
|
|
1013
|
+
comma: new h(",", _),
|
|
1014
|
+
semi: new h(";", _),
|
|
1015
|
+
colon: new h(":", _),
|
|
1016
|
+
dot: new h("."),
|
|
1017
|
+
question: new h("?", _),
|
|
1018
|
+
questionDot: new h("?."),
|
|
1019
|
+
arrow: new h("=>", _),
|
|
1020
|
+
template: new h("template"),
|
|
1021
|
+
invalidTemplate: new h("invalidTemplate"),
|
|
1022
|
+
ellipsis: new h("...", _),
|
|
1023
|
+
backQuote: new h("`", v),
|
|
1024
|
+
dollarBraceL: new h("${", {
|
|
1025
|
+
beforeExpr: !0,
|
|
1026
|
+
startsExpr: !0
|
|
1027
|
+
}),
|
|
1028
|
+
eq: new h("=", {
|
|
1029
|
+
beforeExpr: !0,
|
|
1030
|
+
isAssign: !0
|
|
1031
|
+
}),
|
|
1032
|
+
assign: new h("_=", {
|
|
1033
|
+
beforeExpr: !0,
|
|
1034
|
+
isAssign: !0
|
|
1035
|
+
}),
|
|
1036
|
+
incDec: new h("++/--", {
|
|
1037
|
+
prefix: !0,
|
|
1038
|
+
postfix: !0,
|
|
1039
|
+
startsExpr: !0
|
|
1040
|
+
}),
|
|
1041
|
+
prefix: new h("!/~", {
|
|
1042
|
+
beforeExpr: !0,
|
|
1043
|
+
prefix: !0,
|
|
1044
|
+
startsExpr: !0
|
|
1045
|
+
}),
|
|
1046
|
+
logicalOR: g("||", 1),
|
|
1047
|
+
logicalAND: g("&&", 2),
|
|
1048
|
+
bitwiseOR: g("|", 3),
|
|
1049
|
+
bitwiseXOR: g("^", 4),
|
|
1050
|
+
bitwiseAND: g("&", 5),
|
|
1051
|
+
equality: g("==/!=/===/!==", 6),
|
|
1052
|
+
relational: g("</>/<=/>=", 7),
|
|
1053
|
+
bitShift: g("<</>>/>>>", 8),
|
|
1054
|
+
plusMin: new h("+/-", {
|
|
1055
|
+
beforeExpr: !0,
|
|
1056
|
+
binop: 9,
|
|
1057
|
+
prefix: !0,
|
|
1058
|
+
startsExpr: !0
|
|
1059
|
+
}),
|
|
1060
|
+
modulo: g("%", 10),
|
|
1061
|
+
star: g("*", 10),
|
|
1062
|
+
slash: g("/", 10),
|
|
1063
|
+
starstar: new h("**", { beforeExpr: !0 }),
|
|
1064
|
+
coalesce: g("??", 1),
|
|
1065
|
+
_break: y("break"),
|
|
1066
|
+
_case: y("case", _),
|
|
1067
|
+
_catch: y("catch"),
|
|
1068
|
+
_continue: y("continue"),
|
|
1069
|
+
_debugger: y("debugger"),
|
|
1070
|
+
_default: y("default", _),
|
|
1071
|
+
_do: y("do", {
|
|
1072
|
+
isLoop: !0,
|
|
1073
|
+
beforeExpr: !0
|
|
1074
|
+
}),
|
|
1075
|
+
_else: y("else", _),
|
|
1076
|
+
_finally: y("finally"),
|
|
1077
|
+
_for: y("for", { isLoop: !0 }),
|
|
1078
|
+
_function: y("function", v),
|
|
1079
|
+
_if: y("if"),
|
|
1080
|
+
_return: y("return", _),
|
|
1081
|
+
_switch: y("switch"),
|
|
1082
|
+
_throw: y("throw", _),
|
|
1083
|
+
_try: y("try"),
|
|
1084
|
+
_var: y("var"),
|
|
1085
|
+
_const: y("const"),
|
|
1086
|
+
_while: y("while", { isLoop: !0 }),
|
|
1087
|
+
_with: y("with"),
|
|
1088
|
+
_new: y("new", {
|
|
1089
|
+
beforeExpr: !0,
|
|
1090
|
+
startsExpr: !0
|
|
1091
|
+
}),
|
|
1092
|
+
_this: y("this", v),
|
|
1093
|
+
_super: y("super", v),
|
|
1094
|
+
_class: y("class", v),
|
|
1095
|
+
_extends: y("extends", _),
|
|
1096
|
+
_export: y("export"),
|
|
1097
|
+
_import: y("import", v),
|
|
1098
|
+
_null: y("null", v),
|
|
1099
|
+
_true: y("true", v),
|
|
1100
|
+
_false: y("false", v),
|
|
1101
|
+
_in: y("in", {
|
|
1102
|
+
beforeExpr: !0,
|
|
1103
|
+
binop: 7
|
|
1104
|
+
}),
|
|
1105
|
+
_instanceof: y("instanceof", {
|
|
1106
|
+
beforeExpr: !0,
|
|
1107
|
+
binop: 7
|
|
1108
|
+
}),
|
|
1109
|
+
_typeof: y("typeof", {
|
|
1110
|
+
beforeExpr: !0,
|
|
1111
|
+
prefix: !0,
|
|
1112
|
+
startsExpr: !0
|
|
1113
|
+
}),
|
|
1114
|
+
_void: y("void", {
|
|
1115
|
+
beforeExpr: !0,
|
|
1116
|
+
prefix: !0,
|
|
1117
|
+
startsExpr: !0
|
|
1118
|
+
}),
|
|
1119
|
+
_delete: y("delete", {
|
|
1120
|
+
beforeExpr: !0,
|
|
1121
|
+
prefix: !0,
|
|
1122
|
+
startsExpr: !0
|
|
1123
|
+
})
|
|
1124
|
+
}, x = /\r\n?|\n|\u2028|\u2029/, te = new RegExp(x.source, "g");
|
|
1125
|
+
function S(e) {
|
|
1126
|
+
return e === 10 || e === 13 || e === 8232 || e === 8233;
|
|
1127
|
+
}
|
|
1128
|
+
function ne(e, t, n) {
|
|
1129
|
+
n === void 0 && (n = e.length);
|
|
1130
|
+
for (var r = t; r < n; r++) {
|
|
1131
|
+
var i = e.charCodeAt(r);
|
|
1132
|
+
if (S(i)) return r < n - 1 && i === 13 && e.charCodeAt(r + 1) === 10 ? r + 2 : r + 1;
|
|
1133
|
+
}
|
|
1134
|
+
return -1;
|
|
1135
|
+
}
|
|
1136
|
+
var re = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/, C = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, ie = Object.prototype, ae = ie.hasOwnProperty, oe = ie.toString, w = Object.hasOwn || (function(e, t) {
|
|
1137
|
+
return ae.call(e, t);
|
|
1138
|
+
}), se = Array.isArray || (function(e) {
|
|
1139
|
+
return oe.call(e) === "[object Array]";
|
|
1140
|
+
}), ce = Object.create(null);
|
|
1141
|
+
function T(e) {
|
|
1142
|
+
return ce[e] || (ce[e] = RegExp("^(?:" + e.replace(/ /g, "|") + ")$"));
|
|
1143
|
+
}
|
|
1144
|
+
function E(e) {
|
|
1145
|
+
return e <= 65535 ? String.fromCharCode(e) : (e -= 65536, String.fromCharCode((e >> 10) + 55296, (e & 1023) + 56320));
|
|
1146
|
+
}
|
|
1147
|
+
var le = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/, D = function(e, t) {
|
|
1148
|
+
this.line = e, this.column = t;
|
|
1149
|
+
};
|
|
1150
|
+
D.prototype.offset = function(e) {
|
|
1151
|
+
return new D(this.line, this.column + e);
|
|
1152
|
+
};
|
|
1153
|
+
var ue = function(e, t, n) {
|
|
1154
|
+
this.start = t, this.end = n, e.sourceFile !== null && (this.source = e.sourceFile);
|
|
1155
|
+
};
|
|
1156
|
+
function de(e, t) {
|
|
1157
|
+
for (var n = 1, r = 0;;) {
|
|
1158
|
+
var i = ne(e, r, t);
|
|
1159
|
+
if (i < 0) return new D(n, t - r);
|
|
1160
|
+
++n, r = i;
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
var fe = {
|
|
1164
|
+
ecmaVersion: null,
|
|
1165
|
+
sourceType: "script",
|
|
1166
|
+
strict: !1,
|
|
1167
|
+
onInsertedSemicolon: null,
|
|
1168
|
+
onTrailingComma: null,
|
|
1169
|
+
allowReserved: null,
|
|
1170
|
+
allowReturnOutsideFunction: !1,
|
|
1171
|
+
allowImportExportEverywhere: !1,
|
|
1172
|
+
allowAwaitOutsideFunction: null,
|
|
1173
|
+
allowSuperOutsideMethod: null,
|
|
1174
|
+
allowHashBang: !1,
|
|
1175
|
+
checkPrivateFields: !0,
|
|
1176
|
+
locations: !1,
|
|
1177
|
+
startLocation: null,
|
|
1178
|
+
onToken: null,
|
|
1179
|
+
onComment: null,
|
|
1180
|
+
ranges: !1,
|
|
1181
|
+
program: null,
|
|
1182
|
+
sourceFile: null,
|
|
1183
|
+
directSourceFile: null,
|
|
1184
|
+
preserveParens: !1
|
|
1185
|
+
}, pe = !1;
|
|
1186
|
+
function me(e) {
|
|
1187
|
+
var t = {};
|
|
1188
|
+
for (var n in fe) t[n] = e && w(e, n) ? e[n] : fe[n];
|
|
1189
|
+
if (t.ecmaVersion === "latest" ? t.ecmaVersion = 1e8 : t.ecmaVersion == null ? (!pe && typeof console == "object" && console.warn && (pe = !0, console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")), t.ecmaVersion = 11) : t.ecmaVersion >= 2015 && (t.ecmaVersion -= 2009), t.allowReserved ??= t.ecmaVersion < 5, (!e || e.allowHashBang == null) && (t.allowHashBang = t.ecmaVersion >= 14), se(t.onToken)) {
|
|
1190
|
+
var r = t.onToken;
|
|
1191
|
+
t.onToken = function(e) {
|
|
1192
|
+
return r.push(e);
|
|
1193
|
+
};
|
|
1194
|
+
}
|
|
1195
|
+
if (se(t.onComment) && (t.onComment = he(t, t.onComment)), t.sourceType === "commonjs" && t.allowAwaitOutsideFunction) throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");
|
|
1196
|
+
return t;
|
|
1197
|
+
}
|
|
1198
|
+
function he(e, t) {
|
|
1199
|
+
return function(n, r, i, a, o, s) {
|
|
1200
|
+
var c = {
|
|
1201
|
+
type: n ? "Block" : "Line",
|
|
1202
|
+
value: r,
|
|
1203
|
+
start: i,
|
|
1204
|
+
end: a
|
|
1205
|
+
};
|
|
1206
|
+
e.locations && (c.loc = new ue(this, o, s)), e.ranges && (c.range = [i, a]), t.push(c);
|
|
1207
|
+
};
|
|
1208
|
+
}
|
|
1209
|
+
var O = 1, k = 2, ge = 4, _e = 8, ve = 16, ye = 32, A = 64, be = 128, j = 256, M = 512, xe = 1024, N = O | k | j;
|
|
1210
|
+
function Se(e, t) {
|
|
1211
|
+
return k | (e ? ge : 0) | (t ? _e : 0);
|
|
1212
|
+
}
|
|
1213
|
+
var P = 0, Ce = 1, F = 2, we = 3, Te = 4, Ee = 5, I = function(e, t, n) {
|
|
1214
|
+
this.options = e = me(e), this.sourceFile = e.sourceFile, this.keywords = T(c[e.ecmaVersion >= 6 ? 6 : e.sourceType === "module" ? "5module" : 5]);
|
|
1215
|
+
var r = "";
|
|
1216
|
+
e.allowReserved !== !0 && (r = o[e.ecmaVersion >= 6 ? 6 : e.ecmaVersion === 5 ? 5 : 3], e.sourceType === "module" && (r += " await")), this.reservedWords = T(r);
|
|
1217
|
+
var i = (r ? r + " " : "") + o.strict;
|
|
1218
|
+
this.reservedWordsStrict = T(i), this.reservedWordsStrictBind = T(i + " " + o.strictBind), this.input = String(t), this.containsEsc = !1, this.pos = n || 0, this.curLine = 1, e.startLocation ? (this.lineStart = this.pos - e.startLocation.column, this.curLine = e.startLocation.line) : n ? (this.lineStart = this.input.lastIndexOf("\n", n - 1) + 1, this.options.locations && (this.curLine = this.input.slice(0, this.lineStart).split(x).length)) : this.lineStart = 0, this.type = b.eof, this.value = null, this.start = this.end = this.pos, this.startLoc = this.endLoc = this.curPosition(), this.lastTokEndLoc = this.lastTokStartLoc = null, this.lastTokStart = this.lastTokEnd = this.pos, this.context = this.initialContext(), this.exprAllowed = !0, this.inModule = e.sourceType === "module", this.strict = this.inModule || e.strict === !0 || this.strictDirective(this.pos), this.potentialArrowAt = -1, this.potentialArrowInForAwait = !1, this.yieldPos = this.awaitPos = this.awaitIdentPos = 0, this.labels = [], this.undefinedExports = Object.create(null), this.pos === 0 && e.allowHashBang && this.input.slice(0, 2) === "#!" && this.skipLineComment(2), this.scopeStack = [], this.enterScope(this.options.sourceType === "commonjs" ? k : O), this.regexpState = null, this.privateNameStack = [];
|
|
1219
|
+
}, L = {
|
|
1220
|
+
inFunction: { configurable: !0 },
|
|
1221
|
+
inGenerator: { configurable: !0 },
|
|
1222
|
+
inAsync: { configurable: !0 },
|
|
1223
|
+
canAwait: { configurable: !0 },
|
|
1224
|
+
allowReturn: { configurable: !0 },
|
|
1225
|
+
allowSuper: { configurable: !0 },
|
|
1226
|
+
allowDirectSuper: { configurable: !0 },
|
|
1227
|
+
treatFunctionsAsVar: { configurable: !0 },
|
|
1228
|
+
allowNewDotTarget: { configurable: !0 },
|
|
1229
|
+
allowUsing: { configurable: !0 },
|
|
1230
|
+
inClassStaticBlock: { configurable: !0 }
|
|
1231
|
+
};
|
|
1232
|
+
I.prototype.parse = function() {
|
|
1233
|
+
var e = this, t = this.options.program || this.startNode();
|
|
1234
|
+
return this.nextToken(), this.catchStackOverflow(function() {
|
|
1235
|
+
return e.parseTopLevel(t);
|
|
1236
|
+
});
|
|
1237
|
+
}, L.inFunction.get = function() {
|
|
1238
|
+
return (this.currentVarScope().flags & k) > 0;
|
|
1239
|
+
}, L.inGenerator.get = function() {
|
|
1240
|
+
return (this.currentVarScope().flags & _e) > 0;
|
|
1241
|
+
}, L.inAsync.get = function() {
|
|
1242
|
+
return (this.currentVarScope().flags & ge) > 0;
|
|
1243
|
+
}, L.canAwait.get = function() {
|
|
1244
|
+
for (var e = this.scopeStack.length - 1; e >= 0; e--) {
|
|
1245
|
+
var t = this.scopeStack[e].flags;
|
|
1246
|
+
if (t & (j | M)) return !1;
|
|
1247
|
+
if (t & k) return (t & ge) > 0;
|
|
1248
|
+
}
|
|
1249
|
+
return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction;
|
|
1250
|
+
}, L.allowReturn.get = function() {
|
|
1251
|
+
return !!(this.inFunction || this.options.allowReturnOutsideFunction && this.currentVarScope().flags & O);
|
|
1252
|
+
}, L.allowSuper.get = function() {
|
|
1253
|
+
return (this.currentThisScope().flags & A) > 0 || this.options.allowSuperOutsideMethod;
|
|
1254
|
+
}, L.allowDirectSuper.get = function() {
|
|
1255
|
+
return (this.currentThisScope().flags & be) > 0;
|
|
1256
|
+
}, L.treatFunctionsAsVar.get = function() {
|
|
1257
|
+
return this.treatFunctionsAsVarInScope(this.currentScope());
|
|
1258
|
+
}, L.allowNewDotTarget.get = function() {
|
|
1259
|
+
for (var e = this.scopeStack.length - 1; e >= 0; e--) {
|
|
1260
|
+
var t = this.scopeStack[e].flags;
|
|
1261
|
+
if (t & (j | M) || t & k && !(t & ve)) return !0;
|
|
1262
|
+
}
|
|
1263
|
+
return !1;
|
|
1264
|
+
}, L.allowUsing.get = function() {
|
|
1265
|
+
var e = this.currentScope().flags;
|
|
1266
|
+
return !(e & xe || !this.inModule && e & O);
|
|
1267
|
+
}, L.inClassStaticBlock.get = function() {
|
|
1268
|
+
return (this.currentVarScope().flags & j) > 0;
|
|
1269
|
+
}, I.extend = function() {
|
|
1270
|
+
for (var e = [], t = arguments.length; t--;) e[t] = arguments[t];
|
|
1271
|
+
for (var n = this, r = 0; r < e.length; r++) n = e[r](n);
|
|
1272
|
+
return n;
|
|
1273
|
+
}, I.parse = function(e, t) {
|
|
1274
|
+
return new this(t, e).parse();
|
|
1275
|
+
}, I.parseExpressionAt = function(e, t, n) {
|
|
1276
|
+
var r = new this(n, e, t);
|
|
1277
|
+
return r.nextToken(), r.parseExpression();
|
|
1278
|
+
}, I.tokenizer = function(e, t) {
|
|
1279
|
+
return new this(t, e);
|
|
1280
|
+
}, Object.defineProperties(I.prototype, L);
|
|
1281
|
+
var R = I.prototype, De = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;
|
|
1282
|
+
R.strictDirective = function(e) {
|
|
1283
|
+
if (this.options.ecmaVersion < 5) return !1;
|
|
1284
|
+
for (;;) {
|
|
1285
|
+
C.lastIndex = e, e += C.exec(this.input)[0].length;
|
|
1286
|
+
var t = De.exec(this.input.slice(e));
|
|
1287
|
+
if (!t) return !1;
|
|
1288
|
+
if ((t[1] || t[2]) === "use strict") {
|
|
1289
|
+
C.lastIndex = e + t[0].length;
|
|
1290
|
+
var n = C.exec(this.input), r = n.index + n[0].length, i = this.input.charAt(r);
|
|
1291
|
+
return i === ";" || i === "}" || x.test(n[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(i) || i === "!" && this.input.charAt(r + 1) === "=");
|
|
1292
|
+
}
|
|
1293
|
+
e += t[0].length, C.lastIndex = e, e += C.exec(this.input)[0].length, this.input[e] === ";" && e++;
|
|
1294
|
+
}
|
|
1295
|
+
}, R.eat = function(e) {
|
|
1296
|
+
return this.type === e && (this.next(), !0);
|
|
1297
|
+
}, R.isContextual = function(e) {
|
|
1298
|
+
return this.type === b.name && this.value === e && !this.containsEsc;
|
|
1299
|
+
}, R.eatContextual = function(e) {
|
|
1300
|
+
return this.isContextual(e) ? (this.next(), !0) : !1;
|
|
1301
|
+
}, R.catchStackOverflow = function(e) {
|
|
1302
|
+
try {
|
|
1303
|
+
return e();
|
|
1304
|
+
} catch (e) {
|
|
1305
|
+
if (e instanceof Error && (/\bstack\b.*\b(exceeded|overflow)\b/i.test(e.message) || /\btoo much recursion\b/i.test(e.message))) this.raise(this.start, "Not enough stack space to parse input");
|
|
1306
|
+
else throw e;
|
|
1307
|
+
}
|
|
1308
|
+
}, R.expectContextual = function(e) {
|
|
1309
|
+
this.eatContextual(e) || this.unexpected();
|
|
1310
|
+
}, R.canInsertSemicolon = function() {
|
|
1311
|
+
return this.type === b.eof || this.type === b.braceR || x.test(this.input.slice(this.lastTokEnd, this.start));
|
|
1312
|
+
}, R.insertSemicolon = function() {
|
|
1313
|
+
if (this.canInsertSemicolon()) return this.options.onInsertedSemicolon && this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc), !0;
|
|
1314
|
+
}, R.semicolon = function() {
|
|
1315
|
+
!this.eat(b.semi) && !this.insertSemicolon() && this.unexpected();
|
|
1316
|
+
}, R.afterTrailingComma = function(e, t) {
|
|
1317
|
+
if (this.type === e) return this.options.onTrailingComma && this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc), t || this.next(), !0;
|
|
1318
|
+
}, R.expect = function(e) {
|
|
1319
|
+
this.eat(e) || this.unexpected();
|
|
1320
|
+
}, R.unexpected = function(e) {
|
|
1321
|
+
this.raise(e ?? this.start, "Unexpected token");
|
|
1322
|
+
};
|
|
1323
|
+
var z = function() {
|
|
1324
|
+
this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1;
|
|
1325
|
+
};
|
|
1326
|
+
R.checkPatternErrors = function(e, t) {
|
|
1327
|
+
if (e) {
|
|
1328
|
+
e.trailingComma > -1 && this.raiseRecoverable(e.trailingComma, "Comma is not permitted after the rest element");
|
|
1329
|
+
var n = t ? e.parenthesizedAssign : e.parenthesizedBind;
|
|
1330
|
+
n > -1 && this.raiseRecoverable(n, t ? "Assigning to rvalue" : "Parenthesized pattern");
|
|
1331
|
+
}
|
|
1332
|
+
}, R.checkExpressionErrors = function(e, t) {
|
|
1333
|
+
if (!e) return !1;
|
|
1334
|
+
var n = e.shorthandAssign, r = e.doubleProto;
|
|
1335
|
+
if (!t) return n >= 0 || r >= 0;
|
|
1336
|
+
n >= 0 && this.raise(n, "Shorthand property assignments are valid only in destructuring patterns"), r >= 0 && this.raiseRecoverable(r, "Redefinition of __proto__ property");
|
|
1337
|
+
}, R.checkYieldAwaitInDefaultParams = function() {
|
|
1338
|
+
this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos) && this.raise(this.yieldPos, "Yield expression cannot be a default value"), this.awaitPos && this.raise(this.awaitPos, "Await expression cannot be a default value");
|
|
1339
|
+
}, R.isSimpleAssignTarget = function(e) {
|
|
1340
|
+
return e.type === "ParenthesizedExpression" ? this.isSimpleAssignTarget(e.expression) : e.type === "Identifier" || e.type === "MemberExpression";
|
|
1341
|
+
};
|
|
1342
|
+
var B = I.prototype;
|
|
1343
|
+
B.parseTopLevel = function(e) {
|
|
1344
|
+
var t = Object.create(null);
|
|
1345
|
+
for (e.body ||= []; this.type !== b.eof;) {
|
|
1346
|
+
var n = this.parseStatement(null, !0, t);
|
|
1347
|
+
e.body.push(n);
|
|
1348
|
+
}
|
|
1349
|
+
if (this.inModule) for (var r = 0, i = Object.keys(this.undefinedExports); r < i.length; r += 1) {
|
|
1350
|
+
var a = i[r];
|
|
1351
|
+
this.raiseRecoverable(this.undefinedExports[a].start, "Export '" + a + "' is not defined");
|
|
1352
|
+
}
|
|
1353
|
+
return this.adaptDirectivePrologue(e.body), this.next(), e.sourceType = this.options.sourceType === "commonjs" ? "script" : this.options.sourceType, this.finishNode(e, "Program");
|
|
1354
|
+
};
|
|
1355
|
+
var Oe = { kind: "loop" }, ke = { kind: "switch" };
|
|
1356
|
+
B.isLet = function(e) {
|
|
1357
|
+
if (this.options.ecmaVersion < 6 || !this.isContextual("let")) return !1;
|
|
1358
|
+
C.lastIndex = this.pos;
|
|
1359
|
+
var t = C.exec(this.input), n = this.pos + t[0].length, r = this.fullCharCodeAt(n);
|
|
1360
|
+
if (r === 91 || r === 92) return !0;
|
|
1361
|
+
if (e) return !1;
|
|
1362
|
+
if (r === 123) return !0;
|
|
1363
|
+
if (p(r)) {
|
|
1364
|
+
var i = n;
|
|
1365
|
+
do
|
|
1366
|
+
n += r <= 65535 ? 1 : 2;
|
|
1367
|
+
while (m(r = this.fullCharCodeAt(n)));
|
|
1368
|
+
if (r === 92) return !0;
|
|
1369
|
+
var a = this.input.slice(i, n);
|
|
1370
|
+
if (!l.test(a)) return !0;
|
|
1371
|
+
}
|
|
1372
|
+
return !1;
|
|
1373
|
+
}, B.isAsyncFunction = function() {
|
|
1374
|
+
if (this.options.ecmaVersion < 8 || !this.isContextual("async")) return !1;
|
|
1375
|
+
C.lastIndex = this.pos;
|
|
1376
|
+
var e = C.exec(this.input), t = this.pos + e[0].length, n;
|
|
1377
|
+
return !x.test(this.input.slice(this.pos, t)) && this.input.slice(t, t + 8) === "function" && (t + 8 === this.input.length || !(m(n = this.fullCharCodeAt(t + 8)) || n === 92));
|
|
1378
|
+
}, B.isUsingKeyword = function(e, t) {
|
|
1379
|
+
if (this.options.ecmaVersion < 17 || !this.isContextual(e ? "await" : "using")) return !1;
|
|
1380
|
+
C.lastIndex = this.pos;
|
|
1381
|
+
var n = C.exec(this.input), r = this.pos + n[0].length;
|
|
1382
|
+
if (x.test(this.input.slice(this.pos, r))) return !1;
|
|
1383
|
+
if (e) {
|
|
1384
|
+
var i = r + 5, a;
|
|
1385
|
+
if (this.input.slice(r, i) !== "using" || i === this.input.length || m(a = this.fullCharCodeAt(i)) || a === 92) return !1;
|
|
1386
|
+
C.lastIndex = i;
|
|
1387
|
+
var o = C.exec(this.input);
|
|
1388
|
+
if (r = i + o[0].length, o && x.test(this.input.slice(i, r))) return !1;
|
|
1389
|
+
}
|
|
1390
|
+
var s = this.fullCharCodeAt(r);
|
|
1391
|
+
if (!p(s) && s !== 92) return !1;
|
|
1392
|
+
var c = r;
|
|
1393
|
+
do
|
|
1394
|
+
r += s <= 65535 ? 1 : 2;
|
|
1395
|
+
while (m(s = this.fullCharCodeAt(r)));
|
|
1396
|
+
if (s === 92) return !0;
|
|
1397
|
+
var u = this.input.slice(c, r);
|
|
1398
|
+
if (l.test(u)) return !1;
|
|
1399
|
+
if (t && !e && u === "of") {
|
|
1400
|
+
C.lastIndex = r;
|
|
1401
|
+
var d = C.exec(this.input);
|
|
1402
|
+
if (r += d[0].length, this.input.charCodeAt(r) !== 61 || (s = this.input.charCodeAt(r + 1)) === 61 || s === 62) return !1;
|
|
1403
|
+
}
|
|
1404
|
+
return !0;
|
|
1405
|
+
}, B.isAwaitUsing = function(e) {
|
|
1406
|
+
return this.isUsingKeyword(!0, e);
|
|
1407
|
+
}, B.isUsing = function(e) {
|
|
1408
|
+
return this.isUsingKeyword(!1, e);
|
|
1409
|
+
}, B.parseStatement = function(e, t, n) {
|
|
1410
|
+
var r = this.type, i = this.startNode(), a;
|
|
1411
|
+
switch (this.isLet(e) && (r = b._var, a = "let"), r) {
|
|
1412
|
+
case b._break:
|
|
1413
|
+
case b._continue: return this.parseBreakContinueStatement(i, r.keyword);
|
|
1414
|
+
case b._debugger: return this.parseDebuggerStatement(i);
|
|
1415
|
+
case b._do: return this.parseDoStatement(i);
|
|
1416
|
+
case b._for: return this.parseForStatement(i);
|
|
1417
|
+
case b._function: return e && (this.strict || e !== "if" && e !== "label") && this.options.ecmaVersion >= 6 && this.unexpected(), this.parseFunctionStatement(i, !1, !e);
|
|
1418
|
+
case b._class: return e && this.unexpected(), this.parseClass(i, !0);
|
|
1419
|
+
case b._if: return this.parseIfStatement(i);
|
|
1420
|
+
case b._return: return this.parseReturnStatement(i);
|
|
1421
|
+
case b._switch: return this.parseSwitchStatement(i);
|
|
1422
|
+
case b._throw: return this.parseThrowStatement(i);
|
|
1423
|
+
case b._try: return this.parseTryStatement(i);
|
|
1424
|
+
case b._const:
|
|
1425
|
+
case b._var: return a ||= this.value, e && a !== "var" && this.unexpected(), this.parseVarStatement(i, a);
|
|
1426
|
+
case b._while: return this.parseWhileStatement(i);
|
|
1427
|
+
case b._with: return this.parseWithStatement(i);
|
|
1428
|
+
case b.braceL: return this.parseBlock(!0, i);
|
|
1429
|
+
case b.semi: return this.parseEmptyStatement(i);
|
|
1430
|
+
case b._export:
|
|
1431
|
+
case b._import:
|
|
1432
|
+
if (this.options.ecmaVersion > 10 && r === b._import) {
|
|
1433
|
+
C.lastIndex = this.pos;
|
|
1434
|
+
var o = C.exec(this.input), s = this.pos + o[0].length, c = this.input.charCodeAt(s);
|
|
1435
|
+
if (c === 40 || c === 46) return this.parseExpressionStatement(i, this.parseExpression());
|
|
1436
|
+
}
|
|
1437
|
+
return this.options.allowImportExportEverywhere || (t || this.raise(this.start, "'import' and 'export' may only appear at the top level"), this.inModule || this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'")), r === b._import ? this.parseImport(i) : this.parseExport(i, n);
|
|
1438
|
+
default:
|
|
1439
|
+
if (this.isAsyncFunction()) return e && this.unexpected(), this.next(), this.parseFunctionStatement(i, !0, !e);
|
|
1440
|
+
var l = this.isAwaitUsing(!1) ? "await using" : this.isUsing(!1) ? "using" : null;
|
|
1441
|
+
if (l) return this.allowUsing || this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"), e && this.raise(this.start, "Using declaration is not allowed in single-statement positions"), l === "await using" && (this.canAwait || this.raise(this.start, "Await using cannot appear outside of async function"), this.next()), this.next(), this.parseVar(i, !1, l), this.semicolon(), this.finishNode(i, "VariableDeclaration");
|
|
1442
|
+
var u = this.value, d = this.parseExpression();
|
|
1443
|
+
return r === b.name && d.type === "Identifier" && this.eat(b.colon) ? this.parseLabeledStatement(i, u, d, e) : this.parseExpressionStatement(i, d);
|
|
1444
|
+
}
|
|
1445
|
+
}, B.parseBreakContinueStatement = function(e, t) {
|
|
1446
|
+
var n = t === "break";
|
|
1447
|
+
this.next(), this.eat(b.semi) || this.insertSemicolon() ? e.label = null : this.type === b.name ? (e.label = this.parseIdent(), this.semicolon()) : this.unexpected();
|
|
1448
|
+
for (var r = 0; r < this.labels.length; ++r) {
|
|
1449
|
+
var i = this.labels[r];
|
|
1450
|
+
if ((e.label == null || i.name === e.label.name) && (i.kind != null && (n || i.kind === "loop") || e.label && n)) break;
|
|
1451
|
+
}
|
|
1452
|
+
return r === this.labels.length && this.raise(e.start, "Unsyntactic " + t), this.finishNode(e, n ? "BreakStatement" : "ContinueStatement");
|
|
1453
|
+
}, B.parseDebuggerStatement = function(e) {
|
|
1454
|
+
return this.next(), this.semicolon(), this.finishNode(e, "DebuggerStatement");
|
|
1455
|
+
}, B.parseDoStatement = function(e) {
|
|
1456
|
+
return this.next(), this.labels.push(Oe), e.body = this.parseStatement("do"), this.labels.pop(), this.expect(b._while), e.test = this.parseParenExpression(), this.options.ecmaVersion >= 6 ? this.eat(b.semi) : this.semicolon(), this.finishNode(e, "DoWhileStatement");
|
|
1457
|
+
}, B.parseForStatement = function(e) {
|
|
1458
|
+
this.next();
|
|
1459
|
+
var t = this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await") ? this.lastTokStart : -1;
|
|
1460
|
+
if (this.labels.push(Oe), this.enterScope(0), this.expect(b.parenL), this.type === b.semi) return t > -1 && this.unexpected(t), this.parseFor(e, null);
|
|
1461
|
+
var n = this.isLet();
|
|
1462
|
+
if (this.type === b._var || this.type === b._const || n) {
|
|
1463
|
+
var r = this.startNode(), i = n ? "let" : this.value;
|
|
1464
|
+
return this.next(), this.parseVar(r, !0, i), this.finishNode(r, "VariableDeclaration"), this.parseForAfterInit(e, r, t);
|
|
1465
|
+
}
|
|
1466
|
+
var a = this.isContextual("let"), o = !1, s = this.isUsing(!0) ? "using" : this.isAwaitUsing(!0) ? "await using" : null;
|
|
1467
|
+
if (s) {
|
|
1468
|
+
var c = this.startNode();
|
|
1469
|
+
return this.next(), s === "await using" && (this.canAwait || this.raise(this.start, "Await using cannot appear outside of async function"), this.next()), this.parseVar(c, !0, s), this.finishNode(c, "VariableDeclaration"), this.parseForAfterInit(e, c, t);
|
|
1470
|
+
}
|
|
1471
|
+
var l = this.containsEsc, u = new z(), d = this.start, f = t > -1 ? this.parseExprSubscripts(u, "await") : this.parseExpression(!0, u);
|
|
1472
|
+
return this.type === b._in || (o = this.options.ecmaVersion >= 6 && this.isContextual("of")) ? (t > -1 ? (this.type === b._in && this.unexpected(t), e.await = !0) : o && this.options.ecmaVersion >= 8 && (f.start === d && !l && f.type === "Identifier" && f.name === "async" ? this.unexpected() : this.options.ecmaVersion >= 9 && (e.await = !1)), a && o && this.raise(f.start, "The left-hand side of a for-of loop may not start with 'let'."), this.toAssignable(f, !1, u), this.checkLValPattern(f), this.parseForIn(e, f)) : (this.checkExpressionErrors(u, !0), t > -1 && this.unexpected(t), this.parseFor(e, f));
|
|
1473
|
+
}, B.parseForAfterInit = function(e, t, n) {
|
|
1474
|
+
return (this.type === b._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && t.declarations.length === 1 ? (this.type === b._in ? ((t.kind === "using" || t.kind === "await using") && !t.declarations[0].init && this.raise(this.start, "Using declaration is not allowed in for-in loops"), this.options.ecmaVersion >= 9 && n > -1 && this.unexpected(n)) : this.options.ecmaVersion >= 9 && (e.await = n > -1), this.parseForIn(e, t)) : (n > -1 && this.unexpected(n), this.parseFor(e, t));
|
|
1475
|
+
}, B.parseFunctionStatement = function(e, t, n) {
|
|
1476
|
+
return this.next(), this.parseFunction(e, V | (n ? 0 : je), !1, t);
|
|
1477
|
+
}, B.parseIfStatement = function(e) {
|
|
1478
|
+
return this.next(), e.test = this.parseParenExpression(), e.consequent = this.parseStatement("if"), e.alternate = this.eat(b._else) ? this.parseStatement("if") : null, this.finishNode(e, "IfStatement");
|
|
1479
|
+
}, B.parseReturnStatement = function(e) {
|
|
1480
|
+
return this.allowReturn || this.raise(this.start, "'return' outside of function"), this.next(), this.eat(b.semi) || this.insertSemicolon() ? e.argument = null : (e.argument = this.parseExpression(), this.semicolon()), this.finishNode(e, "ReturnStatement");
|
|
1481
|
+
}, B.parseSwitchStatement = function(e) {
|
|
1482
|
+
this.next(), e.discriminant = this.parseParenExpression(), e.cases = [], this.expect(b.braceL), this.labels.push(ke), this.enterScope(xe);
|
|
1483
|
+
for (var t, n = !1; this.type !== b.braceR;) if (this.type === b._case || this.type === b._default) {
|
|
1484
|
+
var r = this.type === b._case;
|
|
1485
|
+
t && this.finishNode(t, "SwitchCase"), e.cases.push(t = this.startNode()), t.consequent = [], this.next(), r ? t.test = this.parseExpression() : (n && this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"), n = !0, t.test = null), this.expect(b.colon);
|
|
1486
|
+
} else t || this.unexpected(), t.consequent.push(this.parseStatement(null));
|
|
1487
|
+
return this.exitScope(), t && this.finishNode(t, "SwitchCase"), this.next(), this.labels.pop(), this.finishNode(e, "SwitchStatement");
|
|
1488
|
+
}, B.parseThrowStatement = function(e) {
|
|
1489
|
+
return this.next(), x.test(this.input.slice(this.lastTokEnd, this.start)) && this.raise(this.lastTokEnd, "Illegal newline after throw"), e.argument = this.parseExpression(), this.semicolon(), this.finishNode(e, "ThrowStatement");
|
|
1490
|
+
};
|
|
1491
|
+
var Ae = [];
|
|
1492
|
+
B.parseCatchClauseParam = function() {
|
|
1493
|
+
var e = this.parseBindingAtom(), t = e.type === "Identifier";
|
|
1494
|
+
return this.enterScope(t ? ye : 0), this.checkLValPattern(e, t ? Te : F), this.expect(b.parenR), e;
|
|
1495
|
+
}, B.parseTryStatement = function(e) {
|
|
1496
|
+
if (this.next(), e.block = this.parseBlock(), e.handler = null, this.type === b._catch) {
|
|
1497
|
+
var t = this.startNode();
|
|
1498
|
+
this.next(), this.eat(b.parenL) ? t.param = this.parseCatchClauseParam() : (this.options.ecmaVersion < 10 && this.unexpected(), t.param = null, this.enterScope(0)), t.body = this.parseBlock(!1), this.exitScope(), e.handler = this.finishNode(t, "CatchClause");
|
|
1499
|
+
}
|
|
1500
|
+
return e.finalizer = this.eat(b._finally) ? this.parseBlock() : null, !e.handler && !e.finalizer && this.raise(e.start, "Missing catch or finally clause"), this.finishNode(e, "TryStatement");
|
|
1501
|
+
}, B.parseVarStatement = function(e, t, n) {
|
|
1502
|
+
return this.next(), this.parseVar(e, !1, t, n), this.semicolon(), this.finishNode(e, "VariableDeclaration");
|
|
1503
|
+
}, B.parseWhileStatement = function(e) {
|
|
1504
|
+
return this.next(), e.test = this.parseParenExpression(), this.labels.push(Oe), e.body = this.parseStatement("while"), this.labels.pop(), this.finishNode(e, "WhileStatement");
|
|
1505
|
+
}, B.parseWithStatement = function(e) {
|
|
1506
|
+
return this.strict && this.raise(this.start, "'with' in strict mode"), this.next(), e.object = this.parseParenExpression(), e.body = this.parseStatement("with"), this.finishNode(e, "WithStatement");
|
|
1507
|
+
}, B.parseEmptyStatement = function(e) {
|
|
1508
|
+
return this.next(), this.finishNode(e, "EmptyStatement");
|
|
1509
|
+
}, B.parseLabeledStatement = function(e, t, n, r) {
|
|
1510
|
+
for (var i = 0, a = this.labels; i < a.length; i += 1) a[i].name === t && this.raise(n.start, "Label '" + t + "' is already declared");
|
|
1511
|
+
for (var o = this.type.isLoop ? "loop" : this.type === b._switch ? "switch" : null, s = this.labels.length - 1; s >= 0; s--) {
|
|
1512
|
+
var c = this.labels[s];
|
|
1513
|
+
if (c.statementStart === e.start) c.statementStart = this.start, c.kind = o;
|
|
1514
|
+
else break;
|
|
1515
|
+
}
|
|
1516
|
+
return this.labels.push({
|
|
1517
|
+
name: t,
|
|
1518
|
+
kind: o,
|
|
1519
|
+
statementStart: this.start
|
|
1520
|
+
}), e.body = this.parseStatement(r ? r.indexOf("label") === -1 ? r + "label" : r : "label"), this.labels.pop(), e.label = n, this.finishNode(e, "LabeledStatement");
|
|
1521
|
+
}, B.parseExpressionStatement = function(e, t) {
|
|
1522
|
+
return e.expression = t, this.semicolon(), this.finishNode(e, "ExpressionStatement");
|
|
1523
|
+
}, B.parseBlock = function(e, t, n) {
|
|
1524
|
+
for (e === void 0 && (e = !0), t === void 0 && (t = this.startNode()), t.body = [], this.expect(b.braceL), e && this.enterScope(0); this.type !== b.braceR;) {
|
|
1525
|
+
var r = this.parseStatement(null);
|
|
1526
|
+
t.body.push(r);
|
|
1527
|
+
}
|
|
1528
|
+
return n && (this.strict = !1), this.next(), e && this.exitScope(), this.finishNode(t, "BlockStatement");
|
|
1529
|
+
}, B.parseFor = function(e, t) {
|
|
1530
|
+
return e.init = t, this.expect(b.semi), e.test = this.type === b.semi ? null : this.parseExpression(), this.expect(b.semi), e.update = this.type === b.parenR ? null : this.parseExpression(), this.expect(b.parenR), e.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(e, "ForStatement");
|
|
1531
|
+
}, B.parseForIn = function(e, t) {
|
|
1532
|
+
var n = this.type === b._in;
|
|
1533
|
+
return this.next(), t.type === "VariableDeclaration" && t.declarations[0].init != null && (!n || this.options.ecmaVersion < 8 || this.strict || t.kind !== "var" || t.declarations[0].id.type !== "Identifier") && this.raise(t.start, (n ? "for-in" : "for-of") + " loop variable declaration may not have an initializer"), e.left = t, e.right = n ? this.parseExpression() : this.parseMaybeAssign(), this.expect(b.parenR), e.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(e, n ? "ForInStatement" : "ForOfStatement");
|
|
1534
|
+
}, B.parseVar = function(e, t, n, r) {
|
|
1535
|
+
for (e.declarations = [], e.kind = n;;) {
|
|
1536
|
+
var i = this.startNode();
|
|
1537
|
+
if (this.parseVarId(i, n), this.eat(b.eq) ? i.init = this.parseMaybeAssign(t) : !r && n === "const" && !(this.type === b._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) ? this.unexpected() : !r && (n === "using" || n === "await using") && this.options.ecmaVersion >= 17 && this.type !== b._in && !this.isContextual("of") ? this.raise(this.lastTokEnd, "Missing initializer in " + n + " declaration") : !r && i.id.type !== "Identifier" && (!t || this.type !== b._in && !this.isContextual("of")) ? this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value") : i.init = null, e.declarations.push(this.finishNode(i, "VariableDeclarator")), !this.eat(b.comma)) break;
|
|
1538
|
+
}
|
|
1539
|
+
return e;
|
|
1540
|
+
}, B.parseVarId = function(e, t) {
|
|
1541
|
+
e.id = t === "using" || t === "await using" ? this.parseIdent() : this.parseBindingAtom(), this.checkLValPattern(e.id, t === "var" ? Ce : F, !1);
|
|
1542
|
+
};
|
|
1543
|
+
var V = 1, je = 2, Me = 4;
|
|
1544
|
+
B.parseFunction = function(e, t, n, r, i) {
|
|
1545
|
+
this.initFunction(e), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !r) && (this.type === b.star && t & je && this.unexpected(), e.generator = this.eat(b.star)), this.options.ecmaVersion >= 8 && (e.async = !!r), t & V && (e.id = t & Me && this.type !== b.name ? null : this.parseIdent(), e.id && !(t & je) && this.checkLValSimple(e.id, this.strict || e.generator || e.async ? this.treatFunctionsAsVar ? Ce : F : we));
|
|
1546
|
+
var a = this.yieldPos, o = this.awaitPos, s = this.awaitIdentPos;
|
|
1547
|
+
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Se(e.async, e.generator)), t & V || (e.id = this.type === b.name ? this.parseIdent() : null), this.parseFunctionParams(e), this.parseFunctionBody(e, n, !1, i), this.yieldPos = a, this.awaitPos = o, this.awaitIdentPos = s, this.finishNode(e, t & V ? "FunctionDeclaration" : "FunctionExpression");
|
|
1548
|
+
}, B.parseFunctionParams = function(e) {
|
|
1549
|
+
this.expect(b.parenL), e.params = this.parseBindingList(b.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams();
|
|
1550
|
+
}, B.parseClass = function(e, t) {
|
|
1551
|
+
this.next();
|
|
1552
|
+
var n = this.strict;
|
|
1553
|
+
this.strict = !0, this.parseClassId(e, t), this.parseClassSuper(e);
|
|
1554
|
+
var r = this.enterClassBody(), i = this.startNode(), a = !1;
|
|
1555
|
+
for (i.body = [], this.expect(b.braceL); this.type !== b.braceR;) {
|
|
1556
|
+
var o = this.parseClassElement(e.superClass !== null);
|
|
1557
|
+
o && (i.body.push(o), o.type === "MethodDefinition" && o.kind === "constructor" ? (a && this.raiseRecoverable(o.start, "Duplicate constructor in the same class"), a = !0) : o.key && o.key.type === "PrivateIdentifier" && Ne(r, o) && this.raiseRecoverable(o.key.start, "Identifier '#" + o.key.name + "' has already been declared"));
|
|
1558
|
+
}
|
|
1559
|
+
return this.strict = n, this.next(), e.body = this.finishNode(i, "ClassBody"), this.exitClassBody(), this.finishNode(e, t ? "ClassDeclaration" : "ClassExpression");
|
|
1560
|
+
}, B.parseClassElement = function(e) {
|
|
1561
|
+
if (this.eat(b.semi)) return null;
|
|
1562
|
+
var t = this.options.ecmaVersion, n = this.startNode(), r = "", i = !1, a = !1, o = "method", s = !1;
|
|
1563
|
+
if (this.eatContextual("static")) {
|
|
1564
|
+
if (t >= 13 && this.eat(b.braceL)) return this.parseClassStaticBlock(n), n;
|
|
1565
|
+
this.isClassElementNameStart() || this.type === b.star ? s = !0 : r = "static";
|
|
1566
|
+
}
|
|
1567
|
+
if (n.static = s, !r && t >= 8 && this.eatContextual("async") && ((this.isClassElementNameStart() || this.type === b.star) && !this.canInsertSemicolon() ? a = !0 : r = "async"), !r && (t >= 9 || !a) && this.eat(b.star) && (i = !0), !r && !a && !i) {
|
|
1568
|
+
var c = this.value;
|
|
1569
|
+
(this.eatContextual("get") || this.eatContextual("set")) && (this.isClassElementNameStart() ? o = c : r = c);
|
|
1570
|
+
}
|
|
1571
|
+
if (r ? (n.computed = !1, n.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc), n.key.name = r, this.finishNode(n.key, "Identifier")) : this.parseClassElementName(n), t < 13 || this.type === b.parenL || o !== "method" || i || a) {
|
|
1572
|
+
var l = !n.static && Pe(n, "constructor"), u = l && e;
|
|
1573
|
+
l && o !== "method" && this.raise(n.key.start, "Constructor can't have get/set modifier"), n.kind = l ? "constructor" : o, this.parseClassMethod(n, i, a, u);
|
|
1574
|
+
} else this.parseClassField(n);
|
|
1575
|
+
return n;
|
|
1576
|
+
}, B.isClassElementNameStart = function() {
|
|
1577
|
+
return this.type === b.name || this.type === b.privateId || this.type === b.num || this.type === b.string || this.type === b.bracketL || this.type.keyword;
|
|
1578
|
+
}, B.parseClassElementName = function(e) {
|
|
1579
|
+
this.type === b.privateId ? (this.value === "constructor" && this.raise(this.start, "Classes can't have an element named '#constructor'"), e.computed = !1, e.key = this.parsePrivateIdent()) : this.parsePropertyName(e);
|
|
1580
|
+
}, B.parseClassMethod = function(e, t, n, r) {
|
|
1581
|
+
var i = e.key;
|
|
1582
|
+
e.kind === "constructor" ? (t && this.raise(i.start, "Constructor can't be a generator"), n && this.raise(i.start, "Constructor can't be an async method")) : e.static && Pe(e, "prototype") && this.raise(i.start, "Classes may not have a static property named prototype");
|
|
1583
|
+
var a = e.value = this.parseMethod(t, n, r);
|
|
1584
|
+
return e.kind === "get" && a.params.length !== 0 && this.raiseRecoverable(a.start, "getter should have no params"), e.kind === "set" && a.params.length !== 1 && this.raiseRecoverable(a.start, "setter should have exactly one param"), e.kind === "set" && a.params[0].type === "RestElement" && this.raiseRecoverable(a.params[0].start, "Setter cannot use rest params"), this.finishNode(e, "MethodDefinition");
|
|
1585
|
+
}, B.parseClassField = function(e) {
|
|
1586
|
+
return Pe(e, "constructor") ? this.raise(e.key.start, "Classes can't have a field named 'constructor'") : e.static && Pe(e, "prototype") && this.raise(e.key.start, "Classes can't have a static field named 'prototype'"), this.eat(b.eq) ? (this.enterScope(M | A), e.value = this.parseMaybeAssign(), this.exitScope()) : e.value = null, this.semicolon(), this.finishNode(e, "PropertyDefinition");
|
|
1587
|
+
}, B.parseClassStaticBlock = function(e) {
|
|
1588
|
+
e.body = [];
|
|
1589
|
+
var t = this.labels;
|
|
1590
|
+
for (this.labels = [], this.enterScope(j | A); this.type !== b.braceR;) {
|
|
1591
|
+
var n = this.parseStatement(null);
|
|
1592
|
+
e.body.push(n);
|
|
1593
|
+
}
|
|
1594
|
+
return this.next(), this.exitScope(), this.labels = t, this.finishNode(e, "StaticBlock");
|
|
1595
|
+
}, B.parseClassId = function(e, t) {
|
|
1596
|
+
this.type === b.name ? (e.id = this.parseIdent(), t && this.checkLValSimple(e.id, F, !1)) : (t === !0 && this.unexpected(), e.id = null);
|
|
1597
|
+
}, B.parseClassSuper = function(e) {
|
|
1598
|
+
e.superClass = this.eat(b._extends) ? this.parseExprSubscripts(null, !1) : null;
|
|
1599
|
+
}, B.enterClassBody = function() {
|
|
1600
|
+
var e = {
|
|
1601
|
+
declared: Object.create(null),
|
|
1602
|
+
used: []
|
|
1603
|
+
};
|
|
1604
|
+
return this.privateNameStack.push(e), e.declared;
|
|
1605
|
+
}, B.exitClassBody = function() {
|
|
1606
|
+
var e = this.privateNameStack.pop(), t = e.declared, n = e.used;
|
|
1607
|
+
if (this.options.checkPrivateFields) for (var r = this.privateNameStack.length, i = r === 0 ? null : this.privateNameStack[r - 1], a = 0; a < n.length; ++a) {
|
|
1608
|
+
var o = n[a];
|
|
1609
|
+
w(t, o.name) || (i ? i.used.push(o) : this.raiseRecoverable(o.start, "Private field '#" + o.name + "' must be declared in an enclosing class"));
|
|
1610
|
+
}
|
|
1611
|
+
};
|
|
1612
|
+
function Ne(e, t) {
|
|
1613
|
+
var n = t.key.name, r = e[n], i = "true";
|
|
1614
|
+
return t.type === "MethodDefinition" && (t.kind === "get" || t.kind === "set") && (i = (t.static ? "s" : "i") + t.kind), r === "iget" && i === "iset" || r === "iset" && i === "iget" || r === "sget" && i === "sset" || r === "sset" && i === "sget" ? (e[n] = "true", !1) : r ? !0 : (e[n] = i, !1);
|
|
1615
|
+
}
|
|
1616
|
+
function Pe(e, t) {
|
|
1617
|
+
var n = e.computed, r = e.key;
|
|
1618
|
+
return !n && (r.type === "Identifier" && r.name === t || r.type === "Literal" && r.value === t);
|
|
1619
|
+
}
|
|
1620
|
+
B.parseExportAllDeclaration = function(e, t) {
|
|
1621
|
+
return this.options.ecmaVersion >= 11 && (this.eatContextual("as") ? (e.exported = this.parseModuleExportName(), this.checkExport(t, e.exported, this.lastTokStart)) : e.exported = null), this.expectContextual("from"), this.type !== b.string && this.unexpected(), e.source = this.parseExprAtom(), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(e, "ExportAllDeclaration");
|
|
1622
|
+
}, B.parseExport = function(e, t) {
|
|
1623
|
+
if (this.next(), this.eat(b.star)) return this.parseExportAllDeclaration(e, t);
|
|
1624
|
+
if (this.eat(b._default)) return this.checkExport(t, "default", this.lastTokStart), e.declaration = this.parseExportDefaultDeclaration(), this.finishNode(e, "ExportDefaultDeclaration");
|
|
1625
|
+
if (this.shouldParseExportStatement()) e.declaration = this.parseExportDeclaration(e), e.declaration.type === "VariableDeclaration" ? this.checkVariableExport(t, e.declaration.declarations) : this.checkExport(t, e.declaration.id, e.declaration.id.start), e.specifiers = [], e.source = null, this.options.ecmaVersion >= 16 && (e.attributes = []);
|
|
1626
|
+
else {
|
|
1627
|
+
if (e.declaration = null, e.specifiers = this.parseExportSpecifiers(t), this.eatContextual("from")) this.type !== b.string && this.unexpected(), e.source = this.parseExprAtom(), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause());
|
|
1628
|
+
else {
|
|
1629
|
+
for (var n = 0, r = e.specifiers; n < r.length; n += 1) {
|
|
1630
|
+
var i = r[n];
|
|
1631
|
+
this.checkUnreserved(i.local), this.checkLocalExport(i.local), i.local.type === "Literal" && this.raise(i.local.start, "A string literal cannot be used as an exported binding without `from`.");
|
|
1632
|
+
}
|
|
1633
|
+
e.source = null, this.options.ecmaVersion >= 16 && (e.attributes = []);
|
|
1634
|
+
}
|
|
1635
|
+
this.semicolon();
|
|
1636
|
+
}
|
|
1637
|
+
return this.finishNode(e, "ExportNamedDeclaration");
|
|
1638
|
+
}, B.parseExportDeclaration = function(e) {
|
|
1639
|
+
return this.parseStatement(null);
|
|
1640
|
+
}, B.parseExportDefaultDeclaration = function() {
|
|
1641
|
+
var e;
|
|
1642
|
+
if (this.type === b._function || (e = this.isAsyncFunction())) {
|
|
1643
|
+
var t = this.startNode();
|
|
1644
|
+
return this.next(), e && this.next(), this.parseFunction(t, V | Me, !1, e);
|
|
1645
|
+
}
|
|
1646
|
+
if (this.type === b._class) {
|
|
1647
|
+
var n = this.startNode();
|
|
1648
|
+
return this.parseClass(n, "nullableID");
|
|
1649
|
+
}
|
|
1650
|
+
var r = this.parseMaybeAssign();
|
|
1651
|
+
return this.semicolon(), r;
|
|
1652
|
+
}, B.checkExport = function(e, t, n) {
|
|
1653
|
+
e && (typeof t != "string" && (t = t.type === "Identifier" ? t.name : t.value), w(e, t) && this.raiseRecoverable(n, "Duplicate export '" + t + "'"), e[t] = !0);
|
|
1654
|
+
}, B.checkPatternExport = function(e, t) {
|
|
1655
|
+
var n = t.type;
|
|
1656
|
+
if (n === "Identifier") this.checkExport(e, t, t.start);
|
|
1657
|
+
else if (n === "ObjectPattern") for (var r = 0, i = t.properties; r < i.length; r += 1) {
|
|
1658
|
+
var a = i[r];
|
|
1659
|
+
this.checkPatternExport(e, a);
|
|
1660
|
+
}
|
|
1661
|
+
else if (n === "ArrayPattern") for (var o = 0, s = t.elements; o < s.length; o += 1) {
|
|
1662
|
+
var c = s[o];
|
|
1663
|
+
c && this.checkPatternExport(e, c);
|
|
1664
|
+
}
|
|
1665
|
+
else n === "Property" ? this.checkPatternExport(e, t.value) : n === "AssignmentPattern" ? this.checkPatternExport(e, t.left) : n === "RestElement" && this.checkPatternExport(e, t.argument);
|
|
1666
|
+
}, B.checkVariableExport = function(e, t) {
|
|
1667
|
+
if (e) for (var n = 0, r = t; n < r.length; n += 1) {
|
|
1668
|
+
var i = r[n];
|
|
1669
|
+
this.checkPatternExport(e, i.id);
|
|
1670
|
+
}
|
|
1671
|
+
}, B.shouldParseExportStatement = function() {
|
|
1672
|
+
return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction();
|
|
1673
|
+
}, B.parseExportSpecifier = function(e) {
|
|
1674
|
+
var t = this.startNode();
|
|
1675
|
+
return t.local = this.parseModuleExportName(), t.exported = this.eatContextual("as") ? this.parseModuleExportName() : t.local, this.checkExport(e, t.exported, t.exported.start), this.finishNode(t, "ExportSpecifier");
|
|
1676
|
+
}, B.parseExportSpecifiers = function(e) {
|
|
1677
|
+
var t = [], n = !0;
|
|
1678
|
+
for (this.expect(b.braceL); !this.eat(b.braceR);) {
|
|
1679
|
+
if (n) n = !1;
|
|
1680
|
+
else if (this.expect(b.comma), this.afterTrailingComma(b.braceR)) break;
|
|
1681
|
+
t.push(this.parseExportSpecifier(e));
|
|
1682
|
+
}
|
|
1683
|
+
return t;
|
|
1684
|
+
}, B.parseImport = function(e) {
|
|
1685
|
+
return this.next(), this.type === b.string ? (e.specifiers = Ae, e.source = this.parseExprAtom()) : (e.specifiers = this.parseImportSpecifiers(), this.expectContextual("from"), e.source = this.type === b.string ? this.parseExprAtom() : this.unexpected()), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(e, "ImportDeclaration");
|
|
1686
|
+
}, B.parseImportSpecifier = function() {
|
|
1687
|
+
var e = this.startNode();
|
|
1688
|
+
return e.imported = this.parseModuleExportName(), this.eatContextual("as") ? e.local = this.parseIdent() : (this.checkUnreserved(e.imported), e.local = e.imported), this.checkLValSimple(e.local, F), this.finishNode(e, "ImportSpecifier");
|
|
1689
|
+
}, B.parseImportDefaultSpecifier = function() {
|
|
1690
|
+
var e = this.startNode();
|
|
1691
|
+
return e.local = this.parseIdent(), this.checkLValSimple(e.local, F), this.finishNode(e, "ImportDefaultSpecifier");
|
|
1692
|
+
}, B.parseImportNamespaceSpecifier = function() {
|
|
1693
|
+
var e = this.startNode();
|
|
1694
|
+
return this.next(), this.expectContextual("as"), e.local = this.parseIdent(), this.checkLValSimple(e.local, F), this.finishNode(e, "ImportNamespaceSpecifier");
|
|
1695
|
+
}, B.parseImportSpecifiers = function() {
|
|
1696
|
+
var e = [], t = !0;
|
|
1697
|
+
if (this.type === b.name && (e.push(this.parseImportDefaultSpecifier()), !this.eat(b.comma))) return e;
|
|
1698
|
+
if (this.type === b.star) return e.push(this.parseImportNamespaceSpecifier()), e;
|
|
1699
|
+
for (this.expect(b.braceL); !this.eat(b.braceR);) {
|
|
1700
|
+
if (t) t = !1;
|
|
1701
|
+
else if (this.expect(b.comma), this.afterTrailingComma(b.braceR)) break;
|
|
1702
|
+
e.push(this.parseImportSpecifier());
|
|
1703
|
+
}
|
|
1704
|
+
return e;
|
|
1705
|
+
}, B.parseWithClause = function() {
|
|
1706
|
+
var e = [];
|
|
1707
|
+
if (!this.eat(b._with)) return e;
|
|
1708
|
+
this.expect(b.braceL);
|
|
1709
|
+
for (var t = {}, n = !0; !this.eat(b.braceR);) {
|
|
1710
|
+
if (n) n = !1;
|
|
1711
|
+
else if (this.expect(b.comma), this.afterTrailingComma(b.braceR)) break;
|
|
1712
|
+
var r = this.parseImportAttribute(), i = r.key.type === "Identifier" ? r.key.name : r.key.value;
|
|
1713
|
+
w(t, i) && this.raiseRecoverable(r.key.start, "Duplicate attribute key '" + i + "'"), t[i] = !0, e.push(r);
|
|
1714
|
+
}
|
|
1715
|
+
return e;
|
|
1716
|
+
}, B.parseImportAttribute = function() {
|
|
1717
|
+
var e = this.startNode();
|
|
1718
|
+
return e.key = this.type === b.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never"), this.expect(b.colon), this.type !== b.string && this.unexpected(), e.value = this.parseExprAtom(), this.finishNode(e, "ImportAttribute");
|
|
1719
|
+
}, B.parseModuleExportName = function() {
|
|
1720
|
+
if (this.options.ecmaVersion >= 13 && this.type === b.string) {
|
|
1721
|
+
var e = this.parseLiteral(this.value);
|
|
1722
|
+
return le.test(e.value) && this.raise(e.start, "An export name cannot include a lone surrogate."), e;
|
|
1723
|
+
}
|
|
1724
|
+
return this.parseIdent(!0);
|
|
1725
|
+
}, B.adaptDirectivePrologue = function(e) {
|
|
1726
|
+
for (var t = 0; t < e.length && this.isDirectiveCandidate(e[t]); ++t) e[t].directive = e[t].expression.raw.slice(1, -1);
|
|
1727
|
+
}, B.isDirectiveCandidate = function(e) {
|
|
1728
|
+
return this.options.ecmaVersion >= 5 && e.type === "ExpressionStatement" && e.expression.type === "Literal" && typeof e.expression.value == "string" && (this.input[e.start] === "\"" || this.input[e.start] === "'");
|
|
1729
|
+
};
|
|
1730
|
+
var H = I.prototype;
|
|
1731
|
+
H.toAssignable = function(e, t, n) {
|
|
1732
|
+
if (this.options.ecmaVersion >= 6 && e) switch (e.type) {
|
|
1733
|
+
case "Identifier":
|
|
1734
|
+
this.inAsync && e.name === "await" && this.raise(e.start, "Cannot use 'await' as identifier inside an async function");
|
|
1735
|
+
break;
|
|
1736
|
+
case "ObjectPattern":
|
|
1737
|
+
case "ArrayPattern":
|
|
1738
|
+
case "AssignmentPattern":
|
|
1739
|
+
case "RestElement": break;
|
|
1740
|
+
case "ObjectExpression":
|
|
1741
|
+
e.type = "ObjectPattern", n && this.checkPatternErrors(n, !0);
|
|
1742
|
+
for (var r = 0, i = e.properties; r < i.length; r += 1) {
|
|
1743
|
+
var a = i[r];
|
|
1744
|
+
this.toAssignable(a, t), a.type === "RestElement" && (a.argument.type === "ArrayPattern" || a.argument.type === "ObjectPattern") && this.raise(a.argument.start, "Unexpected token");
|
|
1745
|
+
}
|
|
1746
|
+
break;
|
|
1747
|
+
case "Property":
|
|
1748
|
+
e.kind !== "init" && this.raise(e.key.start, "Object pattern can't contain getter or setter"), this.toAssignable(e.value, t);
|
|
1749
|
+
break;
|
|
1750
|
+
case "ArrayExpression":
|
|
1751
|
+
e.type = "ArrayPattern", n && this.checkPatternErrors(n, !0), this.toAssignableList(e.elements, t);
|
|
1752
|
+
break;
|
|
1753
|
+
case "SpreadElement":
|
|
1754
|
+
e.type = "RestElement", this.toAssignable(e.argument, t), e.argument.type === "AssignmentPattern" && this.raise(e.argument.start, "Rest elements cannot have a default value");
|
|
1755
|
+
break;
|
|
1756
|
+
case "AssignmentExpression":
|
|
1757
|
+
e.operator !== "=" && this.raise(e.left.end, "Only '=' operator can be used for specifying default value."), e.type = "AssignmentPattern", delete e.operator, this.toAssignable(e.left, t);
|
|
1758
|
+
break;
|
|
1759
|
+
case "ParenthesizedExpression":
|
|
1760
|
+
this.toAssignable(e.expression, t, n);
|
|
1761
|
+
break;
|
|
1762
|
+
case "ChainExpression":
|
|
1763
|
+
this.raiseRecoverable(e.start, "Optional chaining cannot appear in left-hand side");
|
|
1764
|
+
break;
|
|
1765
|
+
case "MemberExpression": if (!t) break;
|
|
1766
|
+
default: this.raise(e.start, "Assigning to rvalue");
|
|
1767
|
+
}
|
|
1768
|
+
else n && this.checkPatternErrors(n, !0);
|
|
1769
|
+
return e;
|
|
1770
|
+
}, H.toAssignableList = function(e, t) {
|
|
1771
|
+
for (var n = e.length, r = 0; r < n; r++) {
|
|
1772
|
+
var i = e[r];
|
|
1773
|
+
i && this.toAssignable(i, t);
|
|
1774
|
+
}
|
|
1775
|
+
if (n) {
|
|
1776
|
+
var a = e[n - 1];
|
|
1777
|
+
this.options.ecmaVersion === 6 && t && a && a.type === "RestElement" && a.argument.type !== "Identifier" && this.unexpected(a.argument.start);
|
|
1778
|
+
}
|
|
1779
|
+
return e;
|
|
1780
|
+
}, H.parseSpread = function(e) {
|
|
1781
|
+
var t = this.startNode();
|
|
1782
|
+
return this.next(), t.argument = this.parseMaybeAssign(!1, e), this.finishNode(t, "SpreadElement");
|
|
1783
|
+
}, H.parseRestBinding = function() {
|
|
1784
|
+
var e = this.startNode();
|
|
1785
|
+
return this.next(), this.options.ecmaVersion === 6 && this.type !== b.name && this.unexpected(), e.argument = this.parseBindingAtom(), this.finishNode(e, "RestElement");
|
|
1786
|
+
}, H.parseBindingAtom = function() {
|
|
1787
|
+
if (this.options.ecmaVersion >= 6) switch (this.type) {
|
|
1788
|
+
case b.bracketL:
|
|
1789
|
+
var e = this.startNode();
|
|
1790
|
+
return this.next(), e.elements = this.parseBindingList(b.bracketR, !0, !0), this.finishNode(e, "ArrayPattern");
|
|
1791
|
+
case b.braceL: return this.parseObj(!0);
|
|
1792
|
+
}
|
|
1793
|
+
return this.parseIdent();
|
|
1794
|
+
}, H.parseBindingList = function(e, t, n, r) {
|
|
1795
|
+
for (var i = [], a = !0; !this.eat(e);) if (a ? a = !1 : this.expect(b.comma), t && this.type === b.comma) i.push(null);
|
|
1796
|
+
else if (n && this.afterTrailingComma(e)) break;
|
|
1797
|
+
else if (this.type === b.ellipsis) {
|
|
1798
|
+
var o = this.parseRestBinding();
|
|
1799
|
+
this.parseBindingListItem(o), i.push(o), this.type === b.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.expect(e);
|
|
1800
|
+
break;
|
|
1801
|
+
} else i.push(this.parseAssignableListItem(r));
|
|
1802
|
+
return i;
|
|
1803
|
+
}, H.parseAssignableListItem = function(e) {
|
|
1804
|
+
var t = this.parseMaybeDefault(this.start, this.startLoc);
|
|
1805
|
+
return this.parseBindingListItem(t), t;
|
|
1806
|
+
}, H.parseBindingListItem = function(e) {
|
|
1807
|
+
return e;
|
|
1808
|
+
}, H.parseMaybeDefault = function(e, t, n) {
|
|
1809
|
+
if (n ||= this.parseBindingAtom(), this.options.ecmaVersion < 6 || !this.eat(b.eq)) return n;
|
|
1810
|
+
var r = this.startNodeAt(e, t);
|
|
1811
|
+
return r.left = n, r.right = this.parseMaybeAssign(), this.finishNode(r, "AssignmentPattern");
|
|
1812
|
+
}, H.checkLValSimple = function(e, t, n) {
|
|
1813
|
+
t === void 0 && (t = P);
|
|
1814
|
+
var r = t !== P;
|
|
1815
|
+
switch (e.type) {
|
|
1816
|
+
case "Identifier":
|
|
1817
|
+
this.strict && this.reservedWordsStrictBind.test(e.name) && this.raiseRecoverable(e.start, (r ? "Binding " : "Assigning to ") + e.name + " in strict mode"), r && (t === F && e.name === "let" && this.raiseRecoverable(e.start, "let is disallowed as a lexically bound name"), n && (w(n, e.name) && this.raiseRecoverable(e.start, "Argument name clash"), n[e.name] = !0), t !== Ee && this.declareName(e.name, t, e.start));
|
|
1818
|
+
break;
|
|
1819
|
+
case "ChainExpression":
|
|
1820
|
+
this.raiseRecoverable(e.start, "Optional chaining cannot appear in left-hand side");
|
|
1821
|
+
break;
|
|
1822
|
+
case "MemberExpression":
|
|
1823
|
+
r && this.raiseRecoverable(e.start, "Binding member expression");
|
|
1824
|
+
break;
|
|
1825
|
+
case "ParenthesizedExpression": return r && this.raiseRecoverable(e.start, "Binding parenthesized expression"), this.checkLValSimple(e.expression, t, n);
|
|
1826
|
+
default: this.raise(e.start, (r ? "Binding" : "Assigning to") + " rvalue");
|
|
1827
|
+
}
|
|
1828
|
+
}, H.checkLValPattern = function(e, t, n) {
|
|
1829
|
+
switch (t === void 0 && (t = P), e.type) {
|
|
1830
|
+
case "ObjectPattern":
|
|
1831
|
+
for (var r = 0, i = e.properties; r < i.length; r += 1) {
|
|
1832
|
+
var a = i[r];
|
|
1833
|
+
this.checkLValInnerPattern(a, t, n);
|
|
1834
|
+
}
|
|
1835
|
+
break;
|
|
1836
|
+
case "ArrayPattern":
|
|
1837
|
+
for (var o = 0, s = e.elements; o < s.length; o += 1) {
|
|
1838
|
+
var c = s[o];
|
|
1839
|
+
c && this.checkLValInnerPattern(c, t, n);
|
|
1840
|
+
}
|
|
1841
|
+
break;
|
|
1842
|
+
default: this.checkLValSimple(e, t, n);
|
|
1843
|
+
}
|
|
1844
|
+
}, H.checkLValInnerPattern = function(e, t, n) {
|
|
1845
|
+
switch (t === void 0 && (t = P), e.type) {
|
|
1846
|
+
case "Property":
|
|
1847
|
+
this.checkLValInnerPattern(e.value, t, n);
|
|
1848
|
+
break;
|
|
1849
|
+
case "AssignmentPattern":
|
|
1850
|
+
this.checkLValPattern(e.left, t, n);
|
|
1851
|
+
break;
|
|
1852
|
+
case "RestElement":
|
|
1853
|
+
this.checkLValPattern(e.argument, t, n);
|
|
1854
|
+
break;
|
|
1855
|
+
default: this.checkLValPattern(e, t, n);
|
|
1856
|
+
}
|
|
1857
|
+
};
|
|
1858
|
+
var U = function(e, t, n, r, i) {
|
|
1859
|
+
this.token = e, this.isExpr = !!t, this.preserveSpace = !!n, this.override = r, this.generator = !!i;
|
|
1860
|
+
}, W = {
|
|
1861
|
+
b_stat: new U("{", !1),
|
|
1862
|
+
b_expr: new U("{", !0),
|
|
1863
|
+
b_tmpl: new U("${", !1),
|
|
1864
|
+
p_stat: new U("(", !1),
|
|
1865
|
+
p_expr: new U("(", !0),
|
|
1866
|
+
q_tmpl: new U("`", !0, !0, function(e) {
|
|
1867
|
+
return e.tryReadTemplateToken();
|
|
1868
|
+
}),
|
|
1869
|
+
f_stat: new U("function", !1),
|
|
1870
|
+
f_expr: new U("function", !0),
|
|
1871
|
+
f_expr_gen: new U("function", !0, !1, null, !0),
|
|
1872
|
+
f_gen: new U("function", !1, !1, null, !0)
|
|
1873
|
+
}, G = I.prototype;
|
|
1874
|
+
G.initialContext = function() {
|
|
1875
|
+
return [W.b_stat];
|
|
1876
|
+
}, G.curContext = function() {
|
|
1877
|
+
return this.context[this.context.length - 1];
|
|
1878
|
+
}, G.braceIsBlock = function(e) {
|
|
1879
|
+
var t = this.curContext();
|
|
1880
|
+
return t === W.f_expr || t === W.f_stat ? !0 : e === b.colon && (t === W.b_stat || t === W.b_expr) ? !t.isExpr : e === b._return || e === b.name && this.exprAllowed ? x.test(this.input.slice(this.lastTokEnd, this.start)) : e === b._else || e === b.semi || e === b.eof || e === b.parenR || e === b.arrow ? !0 : e === b.braceL ? t === W.b_stat : e === b._var || e === b._const || e === b.name ? !1 : !this.exprAllowed;
|
|
1881
|
+
}, G.inGeneratorContext = function() {
|
|
1882
|
+
for (var e = this.context.length - 1; e >= 1; e--) {
|
|
1883
|
+
var t = this.context[e];
|
|
1884
|
+
if (t.token === "function") return t.generator;
|
|
1885
|
+
}
|
|
1886
|
+
return !1;
|
|
1887
|
+
}, G.updateContext = function(e) {
|
|
1888
|
+
var t, n = this.type;
|
|
1889
|
+
n.keyword && e === b.dot ? this.exprAllowed = !1 : (t = n.updateContext) ? t.call(this, e) : this.exprAllowed = n.beforeExpr;
|
|
1890
|
+
}, G.overrideContext = function(e) {
|
|
1891
|
+
this.curContext() !== e && (this.context[this.context.length - 1] = e);
|
|
1892
|
+
}, b.parenR.updateContext = b.braceR.updateContext = function() {
|
|
1893
|
+
if (this.context.length === 1) {
|
|
1894
|
+
this.exprAllowed = !0;
|
|
1895
|
+
return;
|
|
1896
|
+
}
|
|
1897
|
+
var e = this.context.pop();
|
|
1898
|
+
e === W.b_stat && this.curContext().token === "function" && (e = this.context.pop()), this.exprAllowed = !e.isExpr;
|
|
1899
|
+
}, b.braceL.updateContext = function(e) {
|
|
1900
|
+
this.context.push(this.braceIsBlock(e) ? W.b_stat : W.b_expr), this.exprAllowed = !0;
|
|
1901
|
+
}, b.dollarBraceL.updateContext = function() {
|
|
1902
|
+
this.context.push(W.b_tmpl), this.exprAllowed = !0;
|
|
1903
|
+
}, b.parenL.updateContext = function(e) {
|
|
1904
|
+
var t = e === b._if || e === b._for || e === b._with || e === b._while;
|
|
1905
|
+
this.context.push(t ? W.p_stat : W.p_expr), this.exprAllowed = !0;
|
|
1906
|
+
}, b.incDec.updateContext = function() {}, b._function.updateContext = b._class.updateContext = function(e) {
|
|
1907
|
+
e.beforeExpr && e !== b._else && (e !== b.semi || this.curContext() === W.p_stat) && !(e === b._return && x.test(this.input.slice(this.lastTokEnd, this.start))) && (e !== b.colon && e !== b.braceL || this.curContext() !== W.b_stat) ? this.context.push(W.f_expr) : this.context.push(W.f_stat), this.exprAllowed = !1;
|
|
1908
|
+
}, b.colon.updateContext = function() {
|
|
1909
|
+
this.curContext().token === "function" && this.context.pop(), this.exprAllowed = !0;
|
|
1910
|
+
}, b.backQuote.updateContext = function() {
|
|
1911
|
+
this.curContext() === W.q_tmpl ? this.context.pop() : this.context.push(W.q_tmpl), this.exprAllowed = !1;
|
|
1912
|
+
}, b.star.updateContext = function(e) {
|
|
1913
|
+
if (e === b._function) {
|
|
1914
|
+
var t = this.context.length - 1;
|
|
1915
|
+
this.context[t] === W.f_expr ? this.context[t] = W.f_expr_gen : this.context[t] = W.f_gen;
|
|
1916
|
+
}
|
|
1917
|
+
this.exprAllowed = !0;
|
|
1918
|
+
}, b.name.updateContext = function(e) {
|
|
1919
|
+
var t = !1;
|
|
1920
|
+
this.options.ecmaVersion >= 6 && e !== b.dot && (this.value === "of" && !this.exprAllowed || this.value === "yield" && this.inGeneratorContext()) && (t = !0), this.exprAllowed = t;
|
|
1921
|
+
};
|
|
1922
|
+
var K = I.prototype;
|
|
1923
|
+
K.checkPropClash = function(e, t, n) {
|
|
1924
|
+
if (!(this.options.ecmaVersion >= 9 && e.type === "SpreadElement") && !(this.options.ecmaVersion >= 6 && (e.computed || e.method || e.shorthand))) {
|
|
1925
|
+
var r = e.key, i;
|
|
1926
|
+
switch (r.type) {
|
|
1927
|
+
case "Identifier":
|
|
1928
|
+
i = r.name;
|
|
1929
|
+
break;
|
|
1930
|
+
case "Literal":
|
|
1931
|
+
i = String(r.value);
|
|
1932
|
+
break;
|
|
1933
|
+
default: return;
|
|
1934
|
+
}
|
|
1935
|
+
var a = e.kind;
|
|
1936
|
+
if (this.options.ecmaVersion >= 6) {
|
|
1937
|
+
i === "__proto__" && a === "init" && (t.proto && (n ? n.doubleProto < 0 && (n.doubleProto = r.start) : this.raiseRecoverable(r.start, "Redefinition of __proto__ property")), t.proto = !0);
|
|
1938
|
+
return;
|
|
1939
|
+
}
|
|
1940
|
+
i = "$" + i;
|
|
1941
|
+
var o = t[i];
|
|
1942
|
+
o ? (a === "init" ? this.strict && o.init || o.get || o.set : o.init || o[a]) && this.raiseRecoverable(r.start, "Redefinition of property") : o = t[i] = {
|
|
1943
|
+
init: !1,
|
|
1944
|
+
get: !1,
|
|
1945
|
+
set: !1
|
|
1946
|
+
}, o[a] = !0;
|
|
1947
|
+
}
|
|
1948
|
+
}, K.parseExpression = function(e, t) {
|
|
1949
|
+
var n = this;
|
|
1950
|
+
return this.catchStackOverflow(function() {
|
|
1951
|
+
var r = n.start, i = n.startLoc, a = n.parseMaybeAssign(e, t);
|
|
1952
|
+
if (n.type === b.comma) {
|
|
1953
|
+
var o = n.startNodeAt(r, i);
|
|
1954
|
+
for (o.expressions = [a]; n.eat(b.comma);) o.expressions.push(n.parseMaybeAssign(e, t));
|
|
1955
|
+
return n.finishNode(o, "SequenceExpression");
|
|
1956
|
+
}
|
|
1957
|
+
return a;
|
|
1958
|
+
});
|
|
1959
|
+
}, K.parseMaybeAssign = function(e, t, n) {
|
|
1960
|
+
if (this.isContextual("yield")) {
|
|
1961
|
+
if (this.inGenerator) return this.parseYield(e);
|
|
1962
|
+
this.exprAllowed = !1;
|
|
1963
|
+
}
|
|
1964
|
+
var r = !1, i = -1, a = -1, o = -1;
|
|
1965
|
+
t ? (i = t.parenthesizedAssign, a = t.trailingComma, o = t.doubleProto, t.parenthesizedAssign = t.trailingComma = -1) : (t = new z(), r = !0);
|
|
1966
|
+
var s = this.start, c = this.startLoc;
|
|
1967
|
+
(this.type === b.parenL || this.type === b.name) && (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = e === "await");
|
|
1968
|
+
var l = this.parseMaybeConditional(e, t);
|
|
1969
|
+
if (n && (l = n.call(this, l, s, c)), this.type.isAssign) {
|
|
1970
|
+
var u = this.startNodeAt(s, c);
|
|
1971
|
+
return u.operator = this.value, this.type === b.eq && (l = this.toAssignable(l, !1, t)), r || (t.parenthesizedAssign = t.trailingComma = t.doubleProto = -1), t.shorthandAssign >= l.start && (t.shorthandAssign = -1), this.type === b.eq ? this.checkLValPattern(l) : this.checkLValSimple(l), u.left = l, this.next(), u.right = this.parseMaybeAssign(e), o > -1 && (t.doubleProto = o), this.finishNode(u, "AssignmentExpression");
|
|
1972
|
+
}
|
|
1973
|
+
return r && this.checkExpressionErrors(t, !0), i > -1 && (t.parenthesizedAssign = i), a > -1 && (t.trailingComma = a), l;
|
|
1974
|
+
}, K.parseMaybeConditional = function(e, t) {
|
|
1975
|
+
var n = this.start, r = this.startLoc, i = this.parseExprOps(e, t);
|
|
1976
|
+
if (this.checkExpressionErrors(t)) return i;
|
|
1977
|
+
if ((i.type !== "ArrowFunctionExpression" || i.start !== n) && this.eat(b.question)) {
|
|
1978
|
+
var a = this.startNodeAt(n, r);
|
|
1979
|
+
return a.test = i, a.consequent = this.parseMaybeAssign(), this.expect(b.colon), a.alternate = this.parseMaybeAssign(e), this.finishNode(a, "ConditionalExpression");
|
|
1980
|
+
}
|
|
1981
|
+
return i;
|
|
1982
|
+
}, K.parseExprOps = function(e, t) {
|
|
1983
|
+
var n = this.start, r = this.startLoc, i = this.parseMaybeUnary(t, !1, !1, e);
|
|
1984
|
+
return this.checkExpressionErrors(t) || i.start === n && i.type === "ArrowFunctionExpression" ? i : this.parseExprOp(i, n, r, -1, e);
|
|
1985
|
+
}, K.parseExprOp = function(e, t, n, r, i) {
|
|
1986
|
+
var a = this.type.binop;
|
|
1987
|
+
if (a != null && (!i || this.type !== b._in) && a > r) {
|
|
1988
|
+
var o = this.type === b.logicalOR || this.type === b.logicalAND, s = this.type === b.coalesce;
|
|
1989
|
+
s && (a = b.logicalAND.binop);
|
|
1990
|
+
var c = this.value;
|
|
1991
|
+
this.next();
|
|
1992
|
+
var l = this.start, u = this.startLoc, d = this.parseExprOp(this.parseMaybeUnary(null, !1, !1, i), l, u, a, i), f = this.buildBinary(t, n, e, d, c, o || s);
|
|
1993
|
+
return (o && this.type === b.coalesce || s && (this.type === b.logicalOR || this.type === b.logicalAND)) && this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"), this.parseExprOp(f, t, n, r, i);
|
|
1994
|
+
}
|
|
1995
|
+
return e;
|
|
1996
|
+
}, K.buildBinary = function(e, t, n, r, i, a) {
|
|
1997
|
+
r.type === "PrivateIdentifier" && this.raise(r.start, "Private identifier can only be left side of binary expression");
|
|
1998
|
+
var o = this.startNodeAt(e, t);
|
|
1999
|
+
return o.left = n, o.operator = i, o.right = r, this.finishNode(o, a ? "LogicalExpression" : "BinaryExpression");
|
|
2000
|
+
}, K.parseMaybeUnary = function(e, t, n, r) {
|
|
2001
|
+
var i = this.start, a = this.startLoc, o;
|
|
2002
|
+
if (this.isContextual("await") && this.canAwait) o = this.parseAwait(r), t = !0;
|
|
2003
|
+
else if (this.type.prefix) {
|
|
2004
|
+
var s = this.startNode(), c = this.type === b.incDec;
|
|
2005
|
+
s.operator = this.value, s.prefix = !0, this.next(), s.argument = this.parseMaybeUnary(null, !0, c, r), this.checkExpressionErrors(e, !0), c ? this.checkLValSimple(s.argument) : this.strict && s.operator === "delete" && Fe(s.argument) ? this.raiseRecoverable(s.start, "Deleting local variable in strict mode") : s.operator === "delete" && Ie(s.argument) ? this.raiseRecoverable(s.start, "Private fields can not be deleted") : t = !0, o = this.finishNode(s, c ? "UpdateExpression" : "UnaryExpression");
|
|
2006
|
+
} else if (!t && this.type === b.privateId) (r || this.privateNameStack.length === 0) && this.options.checkPrivateFields && this.unexpected(), o = this.parsePrivateIdent(), this.type !== b._in && this.unexpected();
|
|
2007
|
+
else {
|
|
2008
|
+
if (o = this.parseExprSubscripts(e, r), this.checkExpressionErrors(e)) return o;
|
|
2009
|
+
for (; this.type.postfix && !this.canInsertSemicolon();) {
|
|
2010
|
+
var l = this.startNodeAt(i, a);
|
|
2011
|
+
l.operator = this.value, l.prefix = !1, l.argument = o, this.checkLValSimple(o), this.next(), o = this.finishNode(l, "UpdateExpression");
|
|
2012
|
+
}
|
|
2013
|
+
}
|
|
2014
|
+
if (!n && (o.type !== "ArrowFunctionExpression" || o.start !== i) && this.eat(b.starstar)) {
|
|
2015
|
+
if (t) this.unexpected(this.lastTokStart);
|
|
2016
|
+
else return this.buildBinary(i, a, o, this.parseMaybeUnary(null, !1, !1, r), "**", !1);
|
|
2017
|
+
} else return o;
|
|
2018
|
+
};
|
|
2019
|
+
function Fe(e) {
|
|
2020
|
+
return e.type === "Identifier" || e.type === "ParenthesizedExpression" && Fe(e.expression);
|
|
2021
|
+
}
|
|
2022
|
+
function Ie(e) {
|
|
2023
|
+
return e.type === "MemberExpression" && e.property.type === "PrivateIdentifier" || e.type === "ChainExpression" && Ie(e.expression) || e.type === "ParenthesizedExpression" && Ie(e.expression);
|
|
2024
|
+
}
|
|
2025
|
+
K.parseExprSubscripts = function(e, t) {
|
|
2026
|
+
var n = this.start, r = this.startLoc, i = this.parseExprAtom(e, t);
|
|
2027
|
+
if (i.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")") return i;
|
|
2028
|
+
var a = this.parseSubscripts(i, n, r, !1, t);
|
|
2029
|
+
return e && a.type === "MemberExpression" && (e.parenthesizedAssign >= a.start && (e.parenthesizedAssign = -1), e.parenthesizedBind >= a.start && (e.parenthesizedBind = -1), e.trailingComma >= a.start && (e.trailingComma = -1)), a;
|
|
2030
|
+
}, K.parseSubscripts = function(e, t, n, r, i) {
|
|
2031
|
+
for (var a = this.options.ecmaVersion >= 8 && e.type === "Identifier" && e.name === "async" && this.lastTokEnd === e.end && !this.canInsertSemicolon() && e.end - e.start === 5 && this.potentialArrowAt === e.start, o = !1;;) {
|
|
2032
|
+
var s = this.parseSubscript(e, t, n, r, a, o, i);
|
|
2033
|
+
if (s.optional && (o = !0), s === e || s.type === "ArrowFunctionExpression") {
|
|
2034
|
+
if (o) {
|
|
2035
|
+
var c = this.startNodeAt(t, n);
|
|
2036
|
+
c.expression = s, s = this.finishNode(c, "ChainExpression");
|
|
2037
|
+
}
|
|
2038
|
+
return s;
|
|
2039
|
+
}
|
|
2040
|
+
e = s;
|
|
2041
|
+
}
|
|
2042
|
+
}, K.shouldParseAsyncArrow = function() {
|
|
2043
|
+
return !this.canInsertSemicolon() && this.eat(b.arrow);
|
|
2044
|
+
}, K.parseSubscriptAsyncArrow = function(e, t, n, r) {
|
|
2045
|
+
return this.parseArrowExpression(this.startNodeAt(e, t), n, !0, r);
|
|
2046
|
+
}, K.parseSubscript = function(e, t, n, r, i, a, o) {
|
|
2047
|
+
var s = this.options.ecmaVersion >= 11, c = s && this.eat(b.questionDot);
|
|
2048
|
+
r && c && this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions");
|
|
2049
|
+
var l = this.eat(b.bracketL);
|
|
2050
|
+
if (l || c && this.type !== b.parenL && this.type !== b.backQuote || this.eat(b.dot)) {
|
|
2051
|
+
var u = this.startNodeAt(t, n);
|
|
2052
|
+
u.object = e, l ? (u.property = this.parseExpression(), this.expect(b.bracketR)) : u.property = this.type === b.privateId && e.type !== "Super" ? this.parsePrivateIdent() : this.parseIdent(this.options.allowReserved !== "never"), u.computed = !!l, s && (u.optional = c), e = this.finishNode(u, "MemberExpression");
|
|
2053
|
+
} else if (!r && this.eat(b.parenL)) {
|
|
2054
|
+
var d = new z(), f = this.yieldPos, p = this.awaitPos, m = this.awaitIdentPos;
|
|
2055
|
+
this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
|
|
2056
|
+
var h = this.parseExprList(b.parenR, this.options.ecmaVersion >= 8, !1, d);
|
|
2057
|
+
if (i && !c && this.shouldParseAsyncArrow()) return this.checkPatternErrors(d, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = f, this.awaitPos = p, this.awaitIdentPos = m, this.parseSubscriptAsyncArrow(t, n, h, o);
|
|
2058
|
+
this.checkExpressionErrors(d, !0), this.yieldPos = f || this.yieldPos, this.awaitPos = p || this.awaitPos, this.awaitIdentPos = m || this.awaitIdentPos;
|
|
2059
|
+
var g = this.startNodeAt(t, n);
|
|
2060
|
+
g.callee = e, g.arguments = h, s && (g.optional = c), e = this.finishNode(g, "CallExpression");
|
|
2061
|
+
} else if (this.type === b.backQuote) {
|
|
2062
|
+
(c || a) && this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
|
|
2063
|
+
var _ = this.startNodeAt(t, n);
|
|
2064
|
+
_.tag = e, _.quasi = this.parseTemplate({ isTagged: !0 }), e = this.finishNode(_, "TaggedTemplateExpression");
|
|
2065
|
+
}
|
|
2066
|
+
return e;
|
|
2067
|
+
}, K.parseExprAtom = function(e, t, n) {
|
|
2068
|
+
this.type === b.slash && this.readRegexp();
|
|
2069
|
+
var r, i = this.potentialArrowAt === this.start;
|
|
2070
|
+
switch (this.type) {
|
|
2071
|
+
case b._super: return this.allowSuper || this.raise(this.start, "'super' keyword outside a method"), r = this.startNode(), this.next(), this.type === b.parenL && !this.allowDirectSuper && this.raise(r.start, "super() call outside constructor of a subclass"), this.type !== b.dot && this.type !== b.bracketL && this.type !== b.parenL && this.unexpected(), this.finishNode(r, "Super");
|
|
2072
|
+
case b._this: return r = this.startNode(), this.next(), this.finishNode(r, "ThisExpression");
|
|
2073
|
+
case b.name:
|
|
2074
|
+
var a = this.start, o = this.startLoc, s = this.containsEsc, c = this.parseIdent(!1);
|
|
2075
|
+
if (this.options.ecmaVersion >= 8 && !s && c.name === "async" && !this.canInsertSemicolon() && this.eat(b._function)) return this.overrideContext(W.f_expr), this.parseFunction(this.startNodeAt(a, o), 0, !1, !0, t);
|
|
2076
|
+
if (i && !this.canInsertSemicolon()) {
|
|
2077
|
+
if (this.eat(b.arrow)) return this.parseArrowExpression(this.startNodeAt(a, o), [c], !1, t);
|
|
2078
|
+
if (this.options.ecmaVersion >= 8 && c.name === "async" && this.type === b.name && !s && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) return c = this.parseIdent(!1), (this.canInsertSemicolon() || !this.eat(b.arrow)) && this.unexpected(), this.parseArrowExpression(this.startNodeAt(a, o), [c], !0, t);
|
|
2079
|
+
}
|
|
2080
|
+
return c;
|
|
2081
|
+
case b.regexp:
|
|
2082
|
+
var l = this.value;
|
|
2083
|
+
return r = this.parseLiteral(l.value), r.regex = {
|
|
2084
|
+
pattern: l.pattern,
|
|
2085
|
+
flags: l.flags
|
|
2086
|
+
}, r;
|
|
2087
|
+
case b.num:
|
|
2088
|
+
case b.string: return this.parseLiteral(this.value);
|
|
2089
|
+
case b._null:
|
|
2090
|
+
case b._true:
|
|
2091
|
+
case b._false: return r = this.startNode(), r.value = this.type === b._null ? null : this.type === b._true, r.raw = this.type.keyword, this.next(), this.finishNode(r, "Literal");
|
|
2092
|
+
case b.parenL:
|
|
2093
|
+
var u = this.start, d = this.parseParenAndDistinguishExpression(i, t);
|
|
2094
|
+
return e && (e.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(d) && (e.parenthesizedAssign = u), e.parenthesizedBind < 0 && (e.parenthesizedBind = u)), d;
|
|
2095
|
+
case b.bracketL: return r = this.startNode(), this.next(), r.elements = this.parseExprList(b.bracketR, !0, !0, e), this.finishNode(r, "ArrayExpression");
|
|
2096
|
+
case b.braceL: return this.overrideContext(W.b_expr), this.parseObj(!1, e);
|
|
2097
|
+
case b._function: return r = this.startNode(), this.next(), this.parseFunction(r, 0);
|
|
2098
|
+
case b._class: return this.parseClass(this.startNode(), !1);
|
|
2099
|
+
case b._new: return this.parseNew();
|
|
2100
|
+
case b.backQuote: return this.parseTemplate();
|
|
2101
|
+
case b._import: return this.options.ecmaVersion >= 11 ? this.parseExprImport(n) : this.unexpected();
|
|
2102
|
+
default: return this.parseExprAtomDefault();
|
|
2103
|
+
}
|
|
2104
|
+
}, K.parseExprAtomDefault = function() {
|
|
2105
|
+
this.unexpected();
|
|
2106
|
+
}, K.parseExprImport = function(e) {
|
|
2107
|
+
var t = this.startNode();
|
|
2108
|
+
if (this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword import"), this.next(), this.type === b.parenL && !e) return this.parseDynamicImport(t);
|
|
2109
|
+
if (this.type === b.dot) {
|
|
2110
|
+
var n = this.startNodeAt(t.start, t.loc && t.loc.start);
|
|
2111
|
+
return n.name = "import", t.meta = this.finishNode(n, "Identifier"), this.parseImportMeta(t);
|
|
2112
|
+
}
|
|
2113
|
+
this.unexpected();
|
|
2114
|
+
}, K.parseDynamicImport = function(e) {
|
|
2115
|
+
if (this.next(), e.source = this.parseMaybeAssign(), this.options.ecmaVersion >= 16) this.eat(b.parenR) ? e.options = null : (this.expect(b.comma), this.afterTrailingComma(b.parenR) ? e.options = null : (e.options = this.parseMaybeAssign(), this.eat(b.parenR) || (this.expect(b.comma), this.afterTrailingComma(b.parenR) || this.unexpected())));
|
|
2116
|
+
else if (!this.eat(b.parenR)) {
|
|
2117
|
+
var t = this.start;
|
|
2118
|
+
this.eat(b.comma) && this.eat(b.parenR) ? this.raiseRecoverable(t, "Trailing comma is not allowed in import()") : this.unexpected(t);
|
|
2119
|
+
}
|
|
2120
|
+
return this.finishNode(e, "ImportExpression");
|
|
2121
|
+
}, K.parseImportMeta = function(e) {
|
|
2122
|
+
this.next();
|
|
2123
|
+
var t = this.containsEsc;
|
|
2124
|
+
return e.property = this.parseIdent(!0), e.property.name !== "meta" && this.raiseRecoverable(e.property.start, "The only valid meta property for import is 'import.meta'"), t && this.raiseRecoverable(e.start, "'import.meta' must not contain escaped characters"), this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere && this.raiseRecoverable(e.start, "Cannot use 'import.meta' outside a module"), this.finishNode(e, "MetaProperty");
|
|
2125
|
+
}, K.parseLiteral = function(e) {
|
|
2126
|
+
var t = this.startNode();
|
|
2127
|
+
return t.value = e, t.raw = this.input.slice(this.start, this.end), t.raw.charCodeAt(t.raw.length - 1) === 110 && (t.bigint = t.value == null ? t.raw.slice(0, -1).replace(/_/g, "") : t.value.toString()), this.next(), this.finishNode(t, "Literal");
|
|
2128
|
+
}, K.parseParenExpression = function() {
|
|
2129
|
+
this.expect(b.parenL);
|
|
2130
|
+
var e = this.parseExpression();
|
|
2131
|
+
return this.expect(b.parenR), e;
|
|
2132
|
+
}, K.shouldParseArrow = function(e) {
|
|
2133
|
+
return !this.canInsertSemicolon();
|
|
2134
|
+
}, K.parseParenAndDistinguishExpression = function(e, t) {
|
|
2135
|
+
var n = this.start, r = this.startLoc, i, a = this.options.ecmaVersion >= 8;
|
|
2136
|
+
if (this.options.ecmaVersion >= 6) {
|
|
2137
|
+
this.next();
|
|
2138
|
+
var o = this.start, s = this.startLoc, c = [], l = !0, u = !1, d = new z(), f = this.yieldPos, p = this.awaitPos, m;
|
|
2139
|
+
for (this.yieldPos = 0, this.awaitPos = 0; this.type !== b.parenR;) {
|
|
2140
|
+
if (l ? l = !1 : this.expect(b.comma), a && this.afterTrailingComma(b.parenR, !0)) {
|
|
2141
|
+
u = !0;
|
|
2142
|
+
break;
|
|
2143
|
+
}
|
|
2144
|
+
if (this.type === b.ellipsis) {
|
|
2145
|
+
m = this.start, c.push(this.parseParenItem(this.parseRestBinding())), this.type === b.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element");
|
|
2146
|
+
break;
|
|
2147
|
+
}
|
|
2148
|
+
c.push(this.parseMaybeAssign(!1, d, this.parseParenItem));
|
|
2149
|
+
}
|
|
2150
|
+
var h = this.lastTokEnd, g = this.lastTokEndLoc;
|
|
2151
|
+
if (this.expect(b.parenR), e && this.shouldParseArrow(c) && this.eat(b.arrow)) return this.checkPatternErrors(d, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = f, this.awaitPos = p, this.parseParenArrowList(n, r, c, t);
|
|
2152
|
+
(!c.length || u) && this.unexpected(this.lastTokStart), m && this.unexpected(m), this.checkExpressionErrors(d, !0), this.yieldPos = f || this.yieldPos, this.awaitPos = p || this.awaitPos, c.length > 1 ? (i = this.startNodeAt(o, s), i.expressions = c, this.finishNodeAt(i, "SequenceExpression", h, g)) : i = c[0];
|
|
2153
|
+
} else i = this.parseParenExpression();
|
|
2154
|
+
if (this.options.preserveParens) {
|
|
2155
|
+
var _ = this.startNodeAt(n, r);
|
|
2156
|
+
return _.expression = i, this.finishNode(_, "ParenthesizedExpression");
|
|
2157
|
+
}
|
|
2158
|
+
return i;
|
|
2159
|
+
}, K.parseParenItem = function(e) {
|
|
2160
|
+
return e;
|
|
2161
|
+
}, K.parseParenArrowList = function(e, t, n, r) {
|
|
2162
|
+
return this.parseArrowExpression(this.startNodeAt(e, t), n, !1, r);
|
|
2163
|
+
};
|
|
2164
|
+
var Le = [];
|
|
2165
|
+
K.parseNew = function() {
|
|
2166
|
+
this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword new");
|
|
2167
|
+
var e = this.startNode();
|
|
2168
|
+
if (this.next(), this.options.ecmaVersion >= 6 && this.type === b.dot) {
|
|
2169
|
+
var t = this.startNodeAt(e.start, e.loc && e.loc.start);
|
|
2170
|
+
t.name = "new", e.meta = this.finishNode(t, "Identifier"), this.next();
|
|
2171
|
+
var n = this.containsEsc;
|
|
2172
|
+
return e.property = this.parseIdent(!0), e.property.name !== "target" && this.raiseRecoverable(e.property.start, "The only valid meta property for new is 'new.target'"), n && this.raiseRecoverable(e.start, "'new.target' must not contain escaped characters"), this.allowNewDotTarget || this.raiseRecoverable(e.start, "'new.target' can only be used in functions and class static block"), this.finishNode(e, "MetaProperty");
|
|
2173
|
+
}
|
|
2174
|
+
var r = this.start, i = this.startLoc;
|
|
2175
|
+
return e.callee = this.parseSubscripts(this.parseExprAtom(null, !1, !0), r, i, !0, !1), e.callee.type === "Super" && this.raiseRecoverable(r, "Invalid use of 'super'"), e.arguments = this.eat(b.parenL) ? this.parseExprList(b.parenR, this.options.ecmaVersion >= 8, !1) : Le, this.finishNode(e, "NewExpression");
|
|
2176
|
+
}, K.parseTemplateElement = function(e) {
|
|
2177
|
+
var t = e.isTagged, n = this.startNode();
|
|
2178
|
+
return this.type === b.invalidTemplate ? (t || this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"), n.value = {
|
|
2179
|
+
raw: this.value.replace(/\r\n?/g, "\n"),
|
|
2180
|
+
cooked: null
|
|
2181
|
+
}) : n.value = {
|
|
2182
|
+
raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"),
|
|
2183
|
+
cooked: this.value
|
|
2184
|
+
}, this.next(), n.tail = this.type === b.backQuote, this.finishNode(n, "TemplateElement");
|
|
2185
|
+
}, K.parseTemplate = function(e) {
|
|
2186
|
+
e === void 0 && (e = {});
|
|
2187
|
+
var t = e.isTagged;
|
|
2188
|
+
t === void 0 && (t = !1);
|
|
2189
|
+
var n = this.startNode();
|
|
2190
|
+
this.next(), n.expressions = [];
|
|
2191
|
+
var r = this.parseTemplateElement({ isTagged: t });
|
|
2192
|
+
for (n.quasis = [r]; !r.tail;) this.type === b.eof && this.raise(this.pos, "Unterminated template literal"), this.expect(b.dollarBraceL), n.expressions.push(this.parseExpression()), this.expect(b.braceR), n.quasis.push(r = this.parseTemplateElement({ isTagged: t }));
|
|
2193
|
+
return this.next(), this.finishNode(n, "TemplateLiteral");
|
|
2194
|
+
}, K.isAsyncProp = function(e) {
|
|
2195
|
+
return !e.computed && e.key.type === "Identifier" && e.key.name === "async" && (this.type === b.name || this.type === b.num || this.type === b.string || this.type === b.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === b.star) && !x.test(this.input.slice(this.lastTokEnd, this.start));
|
|
2196
|
+
}, K.parseObj = function(e, t) {
|
|
2197
|
+
var n = this.startNode(), r = !0, i = {};
|
|
2198
|
+
for (n.properties = [], this.next(); !this.eat(b.braceR);) {
|
|
2199
|
+
if (r) r = !1;
|
|
2200
|
+
else if (this.expect(b.comma), this.options.ecmaVersion >= 5 && this.afterTrailingComma(b.braceR)) break;
|
|
2201
|
+
var a = this.parseProperty(e, t);
|
|
2202
|
+
e || this.checkPropClash(a, i, t), n.properties.push(a);
|
|
2203
|
+
}
|
|
2204
|
+
return this.finishNode(n, e ? "ObjectPattern" : "ObjectExpression");
|
|
2205
|
+
}, K.parseProperty = function(e, t) {
|
|
2206
|
+
var n = this.startNode(), r, i, a, o;
|
|
2207
|
+
if (this.options.ecmaVersion >= 9 && this.eat(b.ellipsis)) return e ? (n.argument = this.parseIdent(!1), this.type === b.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.finishNode(n, "RestElement")) : (n.argument = this.parseMaybeAssign(!1, t), this.type === b.comma && t && t.trailingComma < 0 && (t.trailingComma = this.start), this.finishNode(n, "SpreadElement"));
|
|
2208
|
+
this.options.ecmaVersion >= 6 && (n.method = !1, n.shorthand = !1, (e || t) && (a = this.start, o = this.startLoc), e || (r = this.eat(b.star)));
|
|
2209
|
+
var s = this.containsEsc;
|
|
2210
|
+
return this.parsePropertyName(n), !e && !s && this.options.ecmaVersion >= 8 && !r && this.isAsyncProp(n) ? (i = !0, r = this.options.ecmaVersion >= 9 && this.eat(b.star), this.parsePropertyName(n)) : i = !1, this.parsePropertyValue(n, e, r, i, a, o, t, s), this.finishNode(n, "Property");
|
|
2211
|
+
}, K.parseGetterSetter = function(e) {
|
|
2212
|
+
var t = e.key.name;
|
|
2213
|
+
this.parsePropertyName(e), e.value = this.parseMethod(!1), e.kind = t;
|
|
2214
|
+
var n = e.kind === "get" ? 0 : 1;
|
|
2215
|
+
if (e.value.params.length !== n) {
|
|
2216
|
+
var r = e.value.start;
|
|
2217
|
+
e.kind === "get" ? this.raiseRecoverable(r, "getter should have no params") : this.raiseRecoverable(r, "setter should have exactly one param");
|
|
2218
|
+
} else e.kind === "set" && e.value.params[0].type === "RestElement" && this.raiseRecoverable(e.value.params[0].start, "Setter cannot use rest params");
|
|
2219
|
+
}, K.parsePropertyValue = function(e, t, n, r, i, a, o, s) {
|
|
2220
|
+
(n || r) && this.type === b.colon && this.unexpected(), this.eat(b.colon) ? (e.value = t ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(!1, o), e.kind = "init") : this.options.ecmaVersion >= 6 && this.type === b.parenL ? (t && this.unexpected(), e.method = !0, e.value = this.parseMethod(n, r), e.kind = "init") : !t && !s && this.options.ecmaVersion >= 5 && !e.computed && e.key.type === "Identifier" && (e.key.name === "get" || e.key.name === "set") && this.type !== b.comma && this.type !== b.braceR && this.type !== b.eq ? ((n || r) && this.unexpected(), this.parseGetterSetter(e)) : this.options.ecmaVersion >= 6 && !e.computed && e.key.type === "Identifier" ? ((n || r) && this.unexpected(), this.checkUnreserved(e.key), e.key.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = i), t ? e.value = this.parseMaybeDefault(i, a, this.copyNode(e.key)) : this.type === b.eq && o ? (o.shorthandAssign < 0 && (o.shorthandAssign = this.start), e.value = this.parseMaybeDefault(i, a, this.copyNode(e.key))) : e.value = this.copyNode(e.key), e.kind = "init", e.shorthand = !0) : this.unexpected();
|
|
2221
|
+
}, K.parsePropertyName = function(e) {
|
|
2222
|
+
if (this.options.ecmaVersion >= 6) {
|
|
2223
|
+
if (this.eat(b.bracketL)) return e.computed = !0, e.key = this.parseMaybeAssign(), this.expect(b.bracketR), e.key;
|
|
2224
|
+
e.computed = !1;
|
|
2225
|
+
}
|
|
2226
|
+
return e.key = this.type === b.num || this.type === b.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never");
|
|
2227
|
+
}, K.initFunction = function(e) {
|
|
2228
|
+
e.id = null, this.options.ecmaVersion >= 6 && (e.generator = e.expression = !1), this.options.ecmaVersion >= 8 && (e.async = !1);
|
|
2229
|
+
}, K.parseMethod = function(e, t, n) {
|
|
2230
|
+
var r = this.startNode(), i = this.yieldPos, a = this.awaitPos, o = this.awaitIdentPos;
|
|
2231
|
+
return this.initFunction(r), this.options.ecmaVersion >= 6 && (r.generator = e), this.options.ecmaVersion >= 8 && (r.async = !!t), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Se(t, r.generator) | A | (n ? be : 0)), this.expect(b.parenL), r.params = this.parseBindingList(b.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(r, !1, !0, !1), this.yieldPos = i, this.awaitPos = a, this.awaitIdentPos = o, this.finishNode(r, "FunctionExpression");
|
|
2232
|
+
}, K.parseArrowExpression = function(e, t, n, r) {
|
|
2233
|
+
var i = this.yieldPos, a = this.awaitPos, o = this.awaitIdentPos;
|
|
2234
|
+
return this.enterScope(Se(n, !1) | ve), this.initFunction(e), this.options.ecmaVersion >= 8 && (e.async = !!n), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, e.params = this.toAssignableList(t, !0), this.parseFunctionBody(e, !0, !1, r), this.yieldPos = i, this.awaitPos = a, this.awaitIdentPos = o, this.finishNode(e, "ArrowFunctionExpression");
|
|
2235
|
+
}, K.parseFunctionBody = function(e, t, n, r) {
|
|
2236
|
+
var i = t && this.type !== b.braceL, a = this.strict, o = !1;
|
|
2237
|
+
if (i) e.body = this.parseMaybeAssign(r), e.expression = !0, this.checkParams(e, !1);
|
|
2238
|
+
else {
|
|
2239
|
+
var s = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(e.params);
|
|
2240
|
+
(!a || s) && (o = this.strictDirective(this.end), o && s && this.raiseRecoverable(e.start, "Illegal 'use strict' directive in function with non-simple parameter list"));
|
|
2241
|
+
var c = this.labels;
|
|
2242
|
+
this.labels = [], o && (this.strict = !0), this.checkParams(e, !a && !o && !t && !n && this.isSimpleParamList(e.params)), this.strict && e.id && this.checkLValSimple(e.id, Ee), e.body = this.parseBlock(!1, void 0, o && !a), e.expression = !1, this.adaptDirectivePrologue(e.body.body), this.labels = c;
|
|
2243
|
+
}
|
|
2244
|
+
this.exitScope();
|
|
2245
|
+
}, K.isSimpleParamList = function(e) {
|
|
2246
|
+
for (var t = 0, n = e; t < n.length; t += 1) if (n[t].type !== "Identifier") return !1;
|
|
2247
|
+
return !0;
|
|
2248
|
+
}, K.checkParams = function(e, t) {
|
|
2249
|
+
for (var n = Object.create(null), r = 0, i = e.params; r < i.length; r += 1) {
|
|
2250
|
+
var a = i[r];
|
|
2251
|
+
this.checkLValInnerPattern(a, Ce, t ? null : n);
|
|
2252
|
+
}
|
|
2253
|
+
}, K.parseExprList = function(e, t, n, r) {
|
|
2254
|
+
for (var i = [], a = !0; !this.eat(e);) {
|
|
2255
|
+
if (a) a = !1;
|
|
2256
|
+
else if (this.expect(b.comma), t && this.afterTrailingComma(e)) break;
|
|
2257
|
+
var o = void 0;
|
|
2258
|
+
n && this.type === b.comma ? o = null : this.type === b.ellipsis ? (o = this.parseSpread(r), r && this.type === b.comma && r.trailingComma < 0 && (r.trailingComma = this.start)) : o = this.parseMaybeAssign(!1, r), i.push(o);
|
|
2259
|
+
}
|
|
2260
|
+
return i;
|
|
2261
|
+
}, K.checkUnreserved = function(e) {
|
|
2262
|
+
var t = e.start, n = e.end, r = e.name;
|
|
2263
|
+
this.inGenerator && r === "yield" && this.raiseRecoverable(t, "Cannot use 'yield' as identifier inside a generator"), this.inAsync && r === "await" && this.raiseRecoverable(t, "Cannot use 'await' as identifier inside an async function"), !(this.currentThisScope().flags & N) && r === "arguments" && this.raiseRecoverable(t, "Cannot use 'arguments' in class field initializer"), this.inClassStaticBlock && (r === "arguments" || r === "await") && this.raise(t, "Cannot use " + r + " in class static initialization block"), this.keywords.test(r) && this.raise(t, "Unexpected keyword '" + r + "'"), !(this.options.ecmaVersion < 6 && this.input.slice(t, n).indexOf("\\") !== -1) && (this.strict ? this.reservedWordsStrict : this.reservedWords).test(r) && (!this.inAsync && r === "await" && this.raiseRecoverable(t, "Cannot use keyword 'await' outside an async function"), this.raiseRecoverable(t, "The keyword '" + r + "' is reserved"));
|
|
2264
|
+
}, K.parseIdent = function(e) {
|
|
2265
|
+
var t = this.parseIdentNode();
|
|
2266
|
+
return this.next(!!e), this.finishNode(t, "Identifier"), e || (this.checkUnreserved(t), t.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = t.start)), t;
|
|
2267
|
+
}, K.parseIdentNode = function() {
|
|
2268
|
+
var e = this.startNode();
|
|
2269
|
+
return this.type === b.name ? e.name = this.value : this.type.keyword ? (e.name = this.type.keyword, (e.name === "class" || e.name === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46) && this.context.pop(), this.type = b.name) : this.unexpected(), e;
|
|
2270
|
+
}, K.parsePrivateIdent = function() {
|
|
2271
|
+
var e = this.startNode();
|
|
2272
|
+
return this.type === b.privateId ? e.name = this.value : this.unexpected(), this.next(), this.finishNode(e, "PrivateIdentifier"), this.options.checkPrivateFields && (this.privateNameStack.length === 0 ? this.raise(e.start, "Private field '#" + e.name + "' must be declared in an enclosing class") : this.privateNameStack[this.privateNameStack.length - 1].used.push(e)), e;
|
|
2273
|
+
}, K.parseYield = function(e) {
|
|
2274
|
+
this.yieldPos ||= this.start;
|
|
2275
|
+
var t = this.startNode();
|
|
2276
|
+
return this.next(), this.type === b.semi || this.canInsertSemicolon() || this.type !== b.star && !this.type.startsExpr ? (t.delegate = !1, t.argument = null) : (t.delegate = this.eat(b.star), t.argument = this.parseMaybeAssign(e)), this.finishNode(t, "YieldExpression");
|
|
2277
|
+
}, K.parseAwait = function(e) {
|
|
2278
|
+
this.awaitPos ||= this.start;
|
|
2279
|
+
var t = this.startNode();
|
|
2280
|
+
return this.next(), t.argument = this.parseMaybeUnary(null, !0, !1, e), this.finishNode(t, "AwaitExpression");
|
|
2281
|
+
};
|
|
2282
|
+
var Re = I.prototype;
|
|
2283
|
+
Re.raise = function(e, t) {
|
|
2284
|
+
var n = de(this.input, e);
|
|
2285
|
+
t += " (" + n.line + ":" + n.column + ")", this.sourceFile && (t += " in " + this.sourceFile);
|
|
2286
|
+
var r = SyntaxError(t);
|
|
2287
|
+
throw r.pos = e, r.loc = n, r.raisedAt = this.pos, r;
|
|
2288
|
+
}, Re.raiseRecoverable = Re.raise, Re.curPosition = function() {
|
|
2289
|
+
if (this.options.locations) return new D(this.curLine, this.pos - this.lineStart);
|
|
2290
|
+
};
|
|
2291
|
+
var q = I.prototype, ze = function(e) {
|
|
2292
|
+
this.flags = e, this.var = [], this.lexical = [], this.functions = [];
|
|
2293
|
+
};
|
|
2294
|
+
q.enterScope = function(e) {
|
|
2295
|
+
this.scopeStack.push(new ze(e));
|
|
2296
|
+
}, q.exitScope = function() {
|
|
2297
|
+
this.scopeStack.pop();
|
|
2298
|
+
}, q.treatFunctionsAsVarInScope = function(e) {
|
|
2299
|
+
return e.flags & k || !this.inModule && e.flags & O;
|
|
2300
|
+
}, q.declareName = function(e, t, n) {
|
|
2301
|
+
var r = !1;
|
|
2302
|
+
if (t === F) {
|
|
2303
|
+
var i = this.currentScope();
|
|
2304
|
+
r = i.lexical.indexOf(e) > -1 || i.functions.indexOf(e) > -1 || i.var.indexOf(e) > -1, i.lexical.push(e), this.inModule && i.flags & O && delete this.undefinedExports[e];
|
|
2305
|
+
} else if (t === Te) this.currentScope().lexical.push(e);
|
|
2306
|
+
else if (t === we) {
|
|
2307
|
+
var a = this.currentScope();
|
|
2308
|
+
r = this.treatFunctionsAsVar ? a.lexical.indexOf(e) > -1 : a.lexical.indexOf(e) > -1 || a.var.indexOf(e) > -1, a.functions.push(e);
|
|
2309
|
+
} else for (var o = this.scopeStack.length - 1; o >= 0; --o) {
|
|
2310
|
+
var s = this.scopeStack[o];
|
|
2311
|
+
if (s.lexical.indexOf(e) > -1 && !(s.flags & ye && s.lexical[0] === e) || !this.treatFunctionsAsVarInScope(s) && s.functions.indexOf(e) > -1) {
|
|
2312
|
+
r = !0;
|
|
2313
|
+
break;
|
|
2314
|
+
}
|
|
2315
|
+
if (s.var.push(e), this.inModule && s.flags & O && delete this.undefinedExports[e], s.flags & N) break;
|
|
2316
|
+
}
|
|
2317
|
+
r && this.raiseRecoverable(n, "Identifier '" + e + "' has already been declared");
|
|
2318
|
+
}, q.checkLocalExport = function(e) {
|
|
2319
|
+
this.scopeStack[0].lexical.indexOf(e.name) === -1 && this.scopeStack[0].var.indexOf(e.name) === -1 && (this.undefinedExports[e.name] = e);
|
|
2320
|
+
}, q.currentScope = function() {
|
|
2321
|
+
return this.scopeStack[this.scopeStack.length - 1];
|
|
2322
|
+
}, q.currentVarScope = function() {
|
|
2323
|
+
for (var e = this.scopeStack.length - 1;; e--) {
|
|
2324
|
+
var t = this.scopeStack[e];
|
|
2325
|
+
if (t.flags & (N | M | j)) return t;
|
|
2326
|
+
}
|
|
2327
|
+
}, q.currentThisScope = function() {
|
|
2328
|
+
for (var e = this.scopeStack.length - 1;; e--) {
|
|
2329
|
+
var t = this.scopeStack[e];
|
|
2330
|
+
if (t.flags & (N | M | j) && !(t.flags & ve)) return t;
|
|
2331
|
+
}
|
|
2332
|
+
};
|
|
2333
|
+
var Be = function(e, t, n) {
|
|
2334
|
+
this.type = "", this.start = t, this.end = 0, e.options.locations && (this.loc = new ue(e, n)), e.options.directSourceFile && (this.sourceFile = e.options.directSourceFile), e.options.ranges && (this.range = [t, 0]);
|
|
2335
|
+
}, J = I.prototype;
|
|
2336
|
+
J.startNode = function() {
|
|
2337
|
+
return new Be(this, this.start, this.startLoc);
|
|
2338
|
+
}, J.startNodeAt = function(e, t) {
|
|
2339
|
+
return new Be(this, e, t);
|
|
2340
|
+
};
|
|
2341
|
+
function Ve(e, t, n, r) {
|
|
2342
|
+
return e.type = t, e.end = n, this.options.locations && (e.loc.end = r), this.options.ranges && (e.range[1] = n), e;
|
|
2343
|
+
}
|
|
2344
|
+
J.finishNode = function(e, t) {
|
|
2345
|
+
return Ve.call(this, e, t, this.lastTokEnd, this.lastTokEndLoc);
|
|
2346
|
+
}, J.finishNodeAt = function(e, t, n, r) {
|
|
2347
|
+
return Ve.call(this, e, t, n, r);
|
|
2348
|
+
}, J.copyNode = function(e) {
|
|
2349
|
+
var t = new Be(this, e.start, this.startLoc);
|
|
2350
|
+
for (var n in e) t[n] = e[n];
|
|
2351
|
+
return t;
|
|
2352
|
+
};
|
|
2353
|
+
var He = "Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz", Ue = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS", We = Ue + " Extended_Pictographic", Ge = We, Ke = Ge + " EBase EComp EMod EPres ExtPict", qe = Ke, Je = {
|
|
2354
|
+
9: Ue,
|
|
2355
|
+
10: We,
|
|
2356
|
+
11: Ge,
|
|
2357
|
+
12: Ke,
|
|
2358
|
+
13: qe,
|
|
2359
|
+
14: qe
|
|
2360
|
+
}, Ye = {
|
|
2361
|
+
9: "",
|
|
2362
|
+
10: "",
|
|
2363
|
+
11: "",
|
|
2364
|
+
12: "",
|
|
2365
|
+
13: "",
|
|
2366
|
+
14: "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji"
|
|
2367
|
+
}, Xe = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu", Ze = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb", Qe = Ze + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd", $e = Qe + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho", et = $e + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi", tt = et + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith", nt = {
|
|
2368
|
+
9: Ze,
|
|
2369
|
+
10: Qe,
|
|
2370
|
+
11: $e,
|
|
2371
|
+
12: et,
|
|
2372
|
+
13: tt,
|
|
2373
|
+
14: tt + " " + He
|
|
2374
|
+
}, rt = {};
|
|
2375
|
+
function it(e) {
|
|
2376
|
+
var t = rt[e] = {
|
|
2377
|
+
binary: T(Je[e] + " " + Xe),
|
|
2378
|
+
binaryOfStrings: T(Ye[e]),
|
|
2379
|
+
nonBinary: {
|
|
2380
|
+
General_Category: T(Xe),
|
|
2381
|
+
Script: T(nt[e])
|
|
2382
|
+
}
|
|
2383
|
+
};
|
|
2384
|
+
t.nonBinary.Script_Extensions = t.nonBinary.Script, t.nonBinary.gc = t.nonBinary.General_Category, t.nonBinary.sc = t.nonBinary.Script, t.nonBinary.scx = t.nonBinary.Script_Extensions;
|
|
2385
|
+
}
|
|
2386
|
+
for (var at = 0, ot = [
|
|
2387
|
+
9,
|
|
2388
|
+
10,
|
|
2389
|
+
11,
|
|
2390
|
+
12,
|
|
2391
|
+
13,
|
|
2392
|
+
14
|
|
2393
|
+
]; at < ot.length; at += 1) {
|
|
2394
|
+
var st = ot[at];
|
|
2395
|
+
it(st);
|
|
2396
|
+
}
|
|
2397
|
+
var Y = I.prototype, ct = function(e, t) {
|
|
2398
|
+
this.parent = e, this.base = t || this;
|
|
2399
|
+
};
|
|
2400
|
+
ct.prototype.separatedFrom = function(e) {
|
|
2401
|
+
for (var t = this; t; t = t.parent) for (var n = e; n; n = n.parent) if (t.base === n.base && t !== n) return !0;
|
|
2402
|
+
return !1;
|
|
2403
|
+
}, ct.prototype.sibling = function() {
|
|
2404
|
+
return new ct(this.parent, this.base);
|
|
2405
|
+
};
|
|
2406
|
+
var X = function(e) {
|
|
2407
|
+
this.parser = e, this.validFlags = "gim" + (e.options.ecmaVersion >= 6 ? "uy" : "") + (e.options.ecmaVersion >= 9 ? "s" : "") + (e.options.ecmaVersion >= 13 ? "d" : "") + (e.options.ecmaVersion >= 15 ? "v" : ""), this.unicodeProperties = rt[e.options.ecmaVersion >= 14 ? 14 : e.options.ecmaVersion], this.source = "", this.flags = "", this.start = 0, this.switchU = !1, this.switchV = !1, this.switchN = !1, this.pos = 0, this.lastIntValue = 0, this.lastStringValue = "", this.lastAssertionIsQuantifiable = !1, this.numCapturingParens = 0, this.maxBackReference = 0, this.groupNames = Object.create(null), this.backReferenceNames = [], this.branchID = null;
|
|
2408
|
+
};
|
|
2409
|
+
X.prototype.reset = function(e, t, n) {
|
|
2410
|
+
var r = n.indexOf("v") !== -1, i = n.indexOf("u") !== -1;
|
|
2411
|
+
this.start = e | 0, this.source = t + "", this.flags = n, r && this.parser.options.ecmaVersion >= 15 ? (this.switchU = !0, this.switchV = !0, this.switchN = !0) : (this.switchU = i && this.parser.options.ecmaVersion >= 6, this.switchV = !1, this.switchN = i && this.parser.options.ecmaVersion >= 9);
|
|
2412
|
+
}, X.prototype.raise = function(e) {
|
|
2413
|
+
this.parser.raiseRecoverable(this.start, "Invalid regular expression: /" + this.source + "/: " + e);
|
|
2414
|
+
}, X.prototype.at = function(e, t) {
|
|
2415
|
+
t === void 0 && (t = !1);
|
|
2416
|
+
var n = this.source, r = n.length;
|
|
2417
|
+
if (e >= r) return -1;
|
|
2418
|
+
var i = n.charCodeAt(e);
|
|
2419
|
+
if (!(t || this.switchU) || i <= 55295 || i >= 57344 || e + 1 >= r) return i;
|
|
2420
|
+
var a = n.charCodeAt(e + 1);
|
|
2421
|
+
return a >= 56320 && a <= 57343 ? (i << 10) + a - 56613888 : i;
|
|
2422
|
+
}, X.prototype.nextIndex = function(e, t) {
|
|
2423
|
+
t === void 0 && (t = !1);
|
|
2424
|
+
var n = this.source, r = n.length;
|
|
2425
|
+
if (e >= r) return r;
|
|
2426
|
+
var i = n.charCodeAt(e), a;
|
|
2427
|
+
return !(t || this.switchU) || i <= 55295 || i >= 57344 || e + 1 >= r || (a = n.charCodeAt(e + 1)) < 56320 || a > 57343 ? e + 1 : e + 2;
|
|
2428
|
+
}, X.prototype.current = function(e) {
|
|
2429
|
+
return e === void 0 && (e = !1), this.at(this.pos, e);
|
|
2430
|
+
}, X.prototype.lookahead = function(e) {
|
|
2431
|
+
return e === void 0 && (e = !1), this.at(this.nextIndex(this.pos, e), e);
|
|
2432
|
+
}, X.prototype.advance = function(e) {
|
|
2433
|
+
e === void 0 && (e = !1), this.pos = this.nextIndex(this.pos, e);
|
|
2434
|
+
}, X.prototype.eat = function(e, t) {
|
|
2435
|
+
return t === void 0 && (t = !1), this.current(t) === e && (this.advance(t), !0);
|
|
2436
|
+
}, X.prototype.eatChars = function(e, t) {
|
|
2437
|
+
t === void 0 && (t = !1);
|
|
2438
|
+
for (var n = this.pos, r = 0, i = e; r < i.length; r += 1) {
|
|
2439
|
+
var a = i[r], o = this.at(n, t);
|
|
2440
|
+
if (o === -1 || o !== a) return !1;
|
|
2441
|
+
n = this.nextIndex(n, t);
|
|
2442
|
+
}
|
|
2443
|
+
return this.pos = n, !0;
|
|
2444
|
+
}, Y.validateRegExpFlags = function(e) {
|
|
2445
|
+
for (var t = e.validFlags, n = e.flags, r = !1, i = !1, a = 0; a < n.length; a++) {
|
|
2446
|
+
var o = n.charAt(a);
|
|
2447
|
+
t.indexOf(o) === -1 && this.raise(e.start, "Invalid regular expression flag"), n.indexOf(o, a + 1) > -1 && this.raise(e.start, "Duplicate regular expression flag"), o === "u" && (r = !0), o === "v" && (i = !0);
|
|
2448
|
+
}
|
|
2449
|
+
this.options.ecmaVersion >= 15 && r && i && this.raise(e.start, "Invalid regular expression flag");
|
|
2450
|
+
};
|
|
2451
|
+
function lt(e) {
|
|
2452
|
+
for (var t in e) return !0;
|
|
2453
|
+
return !1;
|
|
2454
|
+
}
|
|
2455
|
+
Y.validateRegExpPattern = function(e) {
|
|
2456
|
+
this.regexp_pattern(e), !e.switchN && this.options.ecmaVersion >= 9 && lt(e.groupNames) && (e.switchN = !0, this.regexp_pattern(e));
|
|
2457
|
+
}, Y.regexp_pattern = function(e) {
|
|
2458
|
+
e.pos = 0, e.lastIntValue = 0, e.lastStringValue = "", e.lastAssertionIsQuantifiable = !1, e.numCapturingParens = 0, e.maxBackReference = 0, e.groupNames = Object.create(null), e.backReferenceNames.length = 0, e.branchID = null, this.regexp_disjunction(e), e.pos !== e.source.length && (e.eat(41) && e.raise("Unmatched ')'"), (e.eat(93) || e.eat(125)) && e.raise("Lone quantifier brackets")), e.maxBackReference > e.numCapturingParens && e.raise("Invalid escape");
|
|
2459
|
+
for (var t = 0, n = e.backReferenceNames; t < n.length; t += 1) {
|
|
2460
|
+
var r = n[t];
|
|
2461
|
+
e.groupNames[r] || e.raise("Invalid named capture referenced");
|
|
2462
|
+
}
|
|
2463
|
+
}, Y.regexp_disjunction = function(e) {
|
|
2464
|
+
var t = this.options.ecmaVersion >= 16;
|
|
2465
|
+
for (t && (e.branchID = new ct(e.branchID, null)), this.regexp_alternative(e); e.eat(124);) t && (e.branchID = e.branchID.sibling()), this.regexp_alternative(e);
|
|
2466
|
+
t && (e.branchID = e.branchID.parent), this.regexp_eatQuantifier(e, !0) && e.raise("Nothing to repeat"), e.eat(123) && e.raise("Lone quantifier brackets");
|
|
2467
|
+
}, Y.regexp_alternative = function(e) {
|
|
2468
|
+
for (; e.pos < e.source.length && this.regexp_eatTerm(e););
|
|
2469
|
+
}, Y.regexp_eatTerm = function(e) {
|
|
2470
|
+
return this.regexp_eatAssertion(e) ? (e.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(e) && e.switchU && e.raise("Invalid quantifier"), !0) : (e.switchU ? this.regexp_eatAtom(e) : this.regexp_eatExtendedAtom(e)) ? (this.regexp_eatQuantifier(e), !0) : !1;
|
|
2471
|
+
}, Y.regexp_eatAssertion = function(e) {
|
|
2472
|
+
var t = e.pos;
|
|
2473
|
+
if (e.lastAssertionIsQuantifiable = !1, e.eat(94) || e.eat(36)) return !0;
|
|
2474
|
+
if (e.eat(92)) {
|
|
2475
|
+
if (e.eat(66) || e.eat(98)) return !0;
|
|
2476
|
+
e.pos = t;
|
|
2477
|
+
}
|
|
2478
|
+
if (e.eat(40) && e.eat(63)) {
|
|
2479
|
+
var n = !1;
|
|
2480
|
+
if (this.options.ecmaVersion >= 9 && (n = e.eat(60)), e.eat(61) || e.eat(33)) return this.regexp_disjunction(e), e.eat(41) || e.raise("Unterminated group"), e.lastAssertionIsQuantifiable = !n, !0;
|
|
2481
|
+
}
|
|
2482
|
+
return e.pos = t, !1;
|
|
2483
|
+
}, Y.regexp_eatQuantifier = function(e, t) {
|
|
2484
|
+
return t === void 0 && (t = !1), this.regexp_eatQuantifierPrefix(e, t) ? (e.eat(63), !0) : !1;
|
|
2485
|
+
}, Y.regexp_eatQuantifierPrefix = function(e, t) {
|
|
2486
|
+
return e.eat(42) || e.eat(43) || e.eat(63) || this.regexp_eatBracedQuantifier(e, t);
|
|
2487
|
+
}, Y.regexp_eatBracedQuantifier = function(e, t) {
|
|
2488
|
+
var n = e.pos;
|
|
2489
|
+
if (e.eat(123)) {
|
|
2490
|
+
var r = 0, i = -1;
|
|
2491
|
+
if (this.regexp_eatDecimalDigits(e) && (r = e.lastIntValue, e.eat(44) && this.regexp_eatDecimalDigits(e) && (i = e.lastIntValue), e.eat(125))) return i !== -1 && i < r && !t && e.raise("numbers out of order in {} quantifier"), !0;
|
|
2492
|
+
e.switchU && !t && e.raise("Incomplete quantifier"), e.pos = n;
|
|
2493
|
+
}
|
|
2494
|
+
return !1;
|
|
2495
|
+
}, Y.regexp_eatAtom = function(e) {
|
|
2496
|
+
return this.regexp_eatPatternCharacters(e) || e.eat(46) || this.regexp_eatReverseSolidusAtomEscape(e) || this.regexp_eatCharacterClass(e) || this.regexp_eatUncapturingGroup(e) || this.regexp_eatCapturingGroup(e);
|
|
2497
|
+
}, Y.regexp_eatReverseSolidusAtomEscape = function(e) {
|
|
2498
|
+
var t = e.pos;
|
|
2499
|
+
if (e.eat(92)) {
|
|
2500
|
+
if (this.regexp_eatAtomEscape(e)) return !0;
|
|
2501
|
+
e.pos = t;
|
|
2502
|
+
}
|
|
2503
|
+
return !1;
|
|
2504
|
+
}, Y.regexp_eatUncapturingGroup = function(e) {
|
|
2505
|
+
var t = e.pos;
|
|
2506
|
+
if (e.eat(40)) {
|
|
2507
|
+
if (e.eat(63)) {
|
|
2508
|
+
if (this.options.ecmaVersion >= 16) {
|
|
2509
|
+
var n = this.regexp_eatModifiers(e), r = e.eat(45);
|
|
2510
|
+
if (n || r) {
|
|
2511
|
+
for (var i = 0; i < n.length; i++) {
|
|
2512
|
+
var a = n.charAt(i);
|
|
2513
|
+
n.indexOf(a, i + 1) > -1 && e.raise("Duplicate regular expression modifiers");
|
|
2514
|
+
}
|
|
2515
|
+
if (r) {
|
|
2516
|
+
var o = this.regexp_eatModifiers(e);
|
|
2517
|
+
!n && !o && e.current() === 58 && e.raise("Invalid regular expression modifiers");
|
|
2518
|
+
for (var s = 0; s < o.length; s++) {
|
|
2519
|
+
var c = o.charAt(s);
|
|
2520
|
+
(o.indexOf(c, s + 1) > -1 || n.indexOf(c) > -1) && e.raise("Duplicate regular expression modifiers");
|
|
2521
|
+
}
|
|
2522
|
+
}
|
|
2523
|
+
}
|
|
2524
|
+
}
|
|
2525
|
+
if (e.eat(58)) {
|
|
2526
|
+
if (this.regexp_disjunction(e), e.eat(41)) return !0;
|
|
2527
|
+
e.raise("Unterminated group");
|
|
2528
|
+
}
|
|
2529
|
+
}
|
|
2530
|
+
e.pos = t;
|
|
2531
|
+
}
|
|
2532
|
+
return !1;
|
|
2533
|
+
}, Y.regexp_eatCapturingGroup = function(e) {
|
|
2534
|
+
if (e.eat(40)) {
|
|
2535
|
+
if (this.options.ecmaVersion >= 9 ? this.regexp_groupSpecifier(e) : e.current() === 63 && e.raise("Invalid group"), this.regexp_disjunction(e), e.eat(41)) return e.numCapturingParens += 1, !0;
|
|
2536
|
+
e.raise("Unterminated group");
|
|
2537
|
+
}
|
|
2538
|
+
return !1;
|
|
2539
|
+
}, Y.regexp_eatModifiers = function(e) {
|
|
2540
|
+
for (var t = "", n = 0; (n = e.current()) !== -1 && ut(n);) t += E(n), e.advance();
|
|
2541
|
+
return t;
|
|
2542
|
+
};
|
|
2543
|
+
function ut(e) {
|
|
2544
|
+
return e === 105 || e === 109 || e === 115;
|
|
2545
|
+
}
|
|
2546
|
+
Y.regexp_eatExtendedAtom = function(e) {
|
|
2547
|
+
return e.eat(46) || this.regexp_eatReverseSolidusAtomEscape(e) || this.regexp_eatCharacterClass(e) || this.regexp_eatUncapturingGroup(e) || this.regexp_eatCapturingGroup(e) || this.regexp_eatInvalidBracedQuantifier(e) || this.regexp_eatExtendedPatternCharacter(e);
|
|
2548
|
+
}, Y.regexp_eatInvalidBracedQuantifier = function(e) {
|
|
2549
|
+
return this.regexp_eatBracedQuantifier(e, !0) && e.raise("Nothing to repeat"), !1;
|
|
2550
|
+
}, Y.regexp_eatSyntaxCharacter = function(e) {
|
|
2551
|
+
var t = e.current();
|
|
2552
|
+
return dt(t) ? (e.lastIntValue = t, e.advance(), !0) : !1;
|
|
2553
|
+
};
|
|
2554
|
+
function dt(e) {
|
|
2555
|
+
return e === 36 || e >= 40 && e <= 43 || e === 46 || e === 63 || e >= 91 && e <= 94 || e >= 123 && e <= 125;
|
|
2556
|
+
}
|
|
2557
|
+
Y.regexp_eatPatternCharacters = function(e) {
|
|
2558
|
+
for (var t = e.pos, n = 0; (n = e.current()) !== -1 && !dt(n);) e.advance();
|
|
2559
|
+
return e.pos !== t;
|
|
2560
|
+
}, Y.regexp_eatExtendedPatternCharacter = function(e) {
|
|
2561
|
+
var t = e.current();
|
|
2562
|
+
return t !== -1 && t !== 36 && !(t >= 40 && t <= 43) && t !== 46 && t !== 63 && t !== 91 && t !== 94 && t !== 124 && (e.advance(), !0);
|
|
2563
|
+
}, Y.regexp_groupSpecifier = function(e) {
|
|
2564
|
+
if (e.eat(63)) {
|
|
2565
|
+
this.regexp_eatGroupName(e) || e.raise("Invalid group");
|
|
2566
|
+
var t = this.options.ecmaVersion >= 16, n = e.groupNames[e.lastStringValue];
|
|
2567
|
+
if (n) {
|
|
2568
|
+
if (t) for (var r = 0, i = n; r < i.length; r += 1) i[r].separatedFrom(e.branchID) || e.raise("Duplicate capture group name");
|
|
2569
|
+
else e.raise("Duplicate capture group name");
|
|
2570
|
+
}
|
|
2571
|
+
t ? (n || (e.groupNames[e.lastStringValue] = [])).push(e.branchID) : e.groupNames[e.lastStringValue] = !0;
|
|
2572
|
+
}
|
|
2573
|
+
}, Y.regexp_eatGroupName = function(e) {
|
|
2574
|
+
if (e.lastStringValue = "", e.eat(60)) {
|
|
2575
|
+
if (this.regexp_eatRegExpIdentifierName(e) && e.eat(62)) return !0;
|
|
2576
|
+
e.raise("Invalid capture group name");
|
|
2577
|
+
}
|
|
2578
|
+
return !1;
|
|
2579
|
+
}, Y.regexp_eatRegExpIdentifierName = function(e) {
|
|
2580
|
+
if (e.lastStringValue = "", this.regexp_eatRegExpIdentifierStart(e)) {
|
|
2581
|
+
for (e.lastStringValue += E(e.lastIntValue); this.regexp_eatRegExpIdentifierPart(e);) e.lastStringValue += E(e.lastIntValue);
|
|
2582
|
+
return !0;
|
|
2583
|
+
}
|
|
2584
|
+
return !1;
|
|
2585
|
+
}, Y.regexp_eatRegExpIdentifierStart = function(e) {
|
|
2586
|
+
var t = e.pos, n = this.options.ecmaVersion >= 11, r = e.current(n);
|
|
2587
|
+
return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue), ft(r) ? (e.lastIntValue = r, !0) : (e.pos = t, !1);
|
|
2588
|
+
};
|
|
2589
|
+
function ft(e) {
|
|
2590
|
+
return p(e, !0) || e === 36 || e === 95;
|
|
2591
|
+
}
|
|
2592
|
+
Y.regexp_eatRegExpIdentifierPart = function(e) {
|
|
2593
|
+
var t = e.pos, n = this.options.ecmaVersion >= 11, r = e.current(n);
|
|
2594
|
+
return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue), pt(r) ? (e.lastIntValue = r, !0) : (e.pos = t, !1);
|
|
2595
|
+
};
|
|
2596
|
+
function pt(e) {
|
|
2597
|
+
return m(e, !0) || e === 36 || e === 95 || e === 8204 || e === 8205;
|
|
2598
|
+
}
|
|
2599
|
+
Y.regexp_eatAtomEscape = function(e) {
|
|
2600
|
+
return this.regexp_eatBackReference(e) || this.regexp_eatCharacterClassEscape(e) || this.regexp_eatCharacterEscape(e) || e.switchN && this.regexp_eatKGroupName(e) ? !0 : (e.switchU && (e.current() === 99 && e.raise("Invalid unicode escape"), e.raise("Invalid escape")), !1);
|
|
2601
|
+
}, Y.regexp_eatBackReference = function(e) {
|
|
2602
|
+
var t = e.pos;
|
|
2603
|
+
if (this.regexp_eatDecimalEscape(e)) {
|
|
2604
|
+
var n = e.lastIntValue;
|
|
2605
|
+
if (e.switchU) return n > e.maxBackReference && (e.maxBackReference = n), !0;
|
|
2606
|
+
if (n <= e.numCapturingParens) return !0;
|
|
2607
|
+
e.pos = t;
|
|
2608
|
+
}
|
|
2609
|
+
return !1;
|
|
2610
|
+
}, Y.regexp_eatKGroupName = function(e) {
|
|
2611
|
+
if (e.eat(107)) {
|
|
2612
|
+
if (this.regexp_eatGroupName(e)) return e.backReferenceNames.push(e.lastStringValue), !0;
|
|
2613
|
+
e.raise("Invalid named reference");
|
|
2614
|
+
}
|
|
2615
|
+
return !1;
|
|
2616
|
+
}, Y.regexp_eatCharacterEscape = function(e) {
|
|
2617
|
+
return this.regexp_eatControlEscape(e) || this.regexp_eatCControlLetter(e) || this.regexp_eatZero(e) || this.regexp_eatHexEscapeSequence(e) || this.regexp_eatRegExpUnicodeEscapeSequence(e, !1) || !e.switchU && this.regexp_eatLegacyOctalEscapeSequence(e) || this.regexp_eatIdentityEscape(e);
|
|
2618
|
+
}, Y.regexp_eatCControlLetter = function(e) {
|
|
2619
|
+
var t = e.pos;
|
|
2620
|
+
if (e.eat(99)) {
|
|
2621
|
+
if (this.regexp_eatControlLetter(e)) return !0;
|
|
2622
|
+
e.pos = t;
|
|
2623
|
+
}
|
|
2624
|
+
return !1;
|
|
2625
|
+
}, Y.regexp_eatZero = function(e) {
|
|
2626
|
+
return e.current() === 48 && !Ct(e.lookahead()) && (e.lastIntValue = 0, e.advance(), !0);
|
|
2627
|
+
}, Y.regexp_eatControlEscape = function(e) {
|
|
2628
|
+
var t = e.current();
|
|
2629
|
+
return t === 116 ? (e.lastIntValue = 9, e.advance(), !0) : t === 110 ? (e.lastIntValue = 10, e.advance(), !0) : t === 118 ? (e.lastIntValue = 11, e.advance(), !0) : t === 102 ? (e.lastIntValue = 12, e.advance(), !0) : t === 114 && (e.lastIntValue = 13, e.advance(), !0);
|
|
2630
|
+
}, Y.regexp_eatControlLetter = function(e) {
|
|
2631
|
+
var t = e.current();
|
|
2632
|
+
return mt(t) ? (e.lastIntValue = t % 32, e.advance(), !0) : !1;
|
|
2633
|
+
};
|
|
2634
|
+
function mt(e) {
|
|
2635
|
+
return e >= 65 && e <= 90 || e >= 97 && e <= 122;
|
|
2636
|
+
}
|
|
2637
|
+
Y.regexp_eatRegExpUnicodeEscapeSequence = function(e, t) {
|
|
2638
|
+
t === void 0 && (t = !1);
|
|
2639
|
+
var n = e.pos, r = t || e.switchU;
|
|
2640
|
+
if (e.eat(117)) {
|
|
2641
|
+
if (this.regexp_eatFixedHexDigits(e, 4)) {
|
|
2642
|
+
var i = e.lastIntValue;
|
|
2643
|
+
if (r && i >= 55296 && i <= 56319) {
|
|
2644
|
+
var a = e.pos;
|
|
2645
|
+
if (e.eat(92) && e.eat(117) && this.regexp_eatFixedHexDigits(e, 4)) {
|
|
2646
|
+
var o = e.lastIntValue;
|
|
2647
|
+
if (o >= 56320 && o <= 57343) return e.lastIntValue = (i - 55296) * 1024 + (o - 56320) + 65536, !0;
|
|
2648
|
+
}
|
|
2649
|
+
e.pos = a, e.lastIntValue = i;
|
|
2650
|
+
}
|
|
2651
|
+
return !0;
|
|
2652
|
+
}
|
|
2653
|
+
if (r && e.eat(123) && this.regexp_eatHexDigits(e) && e.eat(125) && ht(e.lastIntValue)) return !0;
|
|
2654
|
+
r && e.raise("Invalid unicode escape"), e.pos = n;
|
|
2655
|
+
}
|
|
2656
|
+
return !1;
|
|
2657
|
+
};
|
|
2658
|
+
function ht(e) {
|
|
2659
|
+
return e >= 0 && e <= 1114111;
|
|
2660
|
+
}
|
|
2661
|
+
Y.regexp_eatIdentityEscape = function(e) {
|
|
2662
|
+
if (e.switchU) return this.regexp_eatSyntaxCharacter(e) ? !0 : e.eat(47) ? (e.lastIntValue = 47, !0) : !1;
|
|
2663
|
+
var t = e.current();
|
|
2664
|
+
return t !== 99 && (!e.switchN || t !== 107) && (e.lastIntValue = t, e.advance(), !0);
|
|
2665
|
+
}, Y.regexp_eatDecimalEscape = function(e) {
|
|
2666
|
+
e.lastIntValue = 0;
|
|
2667
|
+
var t = e.current();
|
|
2668
|
+
if (t >= 49 && t <= 57) {
|
|
2669
|
+
do
|
|
2670
|
+
e.lastIntValue = 10 * e.lastIntValue + (t - 48), e.advance();
|
|
2671
|
+
while ((t = e.current()) >= 48 && t <= 57);
|
|
2672
|
+
return !0;
|
|
2673
|
+
}
|
|
2674
|
+
return !1;
|
|
2675
|
+
};
|
|
2676
|
+
var gt = 0, Z = 1, Q = 2;
|
|
2677
|
+
Y.regexp_eatCharacterClassEscape = function(e) {
|
|
2678
|
+
var t = e.current();
|
|
2679
|
+
if (_t(t)) return e.lastIntValue = -1, e.advance(), Z;
|
|
2680
|
+
var n = !1;
|
|
2681
|
+
if (e.switchU && this.options.ecmaVersion >= 9 && ((n = t === 80) || t === 112)) {
|
|
2682
|
+
e.lastIntValue = -1, e.advance();
|
|
2683
|
+
var r;
|
|
2684
|
+
if (e.eat(123) && (r = this.regexp_eatUnicodePropertyValueExpression(e)) && e.eat(125)) return n && r === Q && e.raise("Invalid property name"), r;
|
|
2685
|
+
e.raise("Invalid property name");
|
|
2686
|
+
}
|
|
2687
|
+
return gt;
|
|
2688
|
+
};
|
|
2689
|
+
function _t(e) {
|
|
2690
|
+
return e === 100 || e === 68 || e === 115 || e === 83 || e === 119 || e === 87;
|
|
2691
|
+
}
|
|
2692
|
+
Y.regexp_eatUnicodePropertyValueExpression = function(e) {
|
|
2693
|
+
var t = e.pos;
|
|
2694
|
+
if (this.regexp_eatUnicodePropertyName(e) && e.eat(61)) {
|
|
2695
|
+
var n = e.lastStringValue;
|
|
2696
|
+
if (this.regexp_eatUnicodePropertyValue(e)) {
|
|
2697
|
+
var r = e.lastStringValue;
|
|
2698
|
+
return this.regexp_validateUnicodePropertyNameAndValue(e, n, r), Z;
|
|
2699
|
+
}
|
|
2700
|
+
}
|
|
2701
|
+
if (e.pos = t, this.regexp_eatLoneUnicodePropertyNameOrValue(e)) {
|
|
2702
|
+
var i = e.lastStringValue;
|
|
2703
|
+
return this.regexp_validateUnicodePropertyNameOrValue(e, i);
|
|
2704
|
+
}
|
|
2705
|
+
return gt;
|
|
2706
|
+
}, Y.regexp_validateUnicodePropertyNameAndValue = function(e, t, n) {
|
|
2707
|
+
w(e.unicodeProperties.nonBinary, t) || e.raise("Invalid property name"), e.unicodeProperties.nonBinary[t].test(n) || e.raise("Invalid property value");
|
|
2708
|
+
}, Y.regexp_validateUnicodePropertyNameOrValue = function(e, t) {
|
|
2709
|
+
if (e.unicodeProperties.binary.test(t)) return Z;
|
|
2710
|
+
if (e.switchV && e.unicodeProperties.binaryOfStrings.test(t)) return Q;
|
|
2711
|
+
e.raise("Invalid property name");
|
|
2712
|
+
}, Y.regexp_eatUnicodePropertyName = function(e) {
|
|
2713
|
+
var t = 0;
|
|
2714
|
+
for (e.lastStringValue = ""; vt(t = e.current());) e.lastStringValue += E(t), e.advance();
|
|
2715
|
+
return e.lastStringValue !== "";
|
|
2716
|
+
};
|
|
2717
|
+
function vt(e) {
|
|
2718
|
+
return mt(e) || e === 95;
|
|
2719
|
+
}
|
|
2720
|
+
Y.regexp_eatUnicodePropertyValue = function(e) {
|
|
2721
|
+
var t = 0;
|
|
2722
|
+
for (e.lastStringValue = ""; yt(t = e.current());) e.lastStringValue += E(t), e.advance();
|
|
2723
|
+
return e.lastStringValue !== "";
|
|
2724
|
+
};
|
|
2725
|
+
function yt(e) {
|
|
2726
|
+
return vt(e) || Ct(e);
|
|
2727
|
+
}
|
|
2728
|
+
Y.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
2729
|
+
return this.regexp_eatUnicodePropertyValue(e);
|
|
2730
|
+
}, Y.regexp_eatCharacterClass = function(e) {
|
|
2731
|
+
if (e.eat(91)) {
|
|
2732
|
+
var t = e.eat(94), n = this.regexp_classContents(e);
|
|
2733
|
+
return e.eat(93) || e.raise("Unterminated character class"), t && n === Q && e.raise("Negated character class may contain strings"), !0;
|
|
2734
|
+
}
|
|
2735
|
+
return !1;
|
|
2736
|
+
}, Y.regexp_classContents = function(e) {
|
|
2737
|
+
return e.current() === 93 ? Z : e.switchV ? this.regexp_classSetExpression(e) : (this.regexp_nonEmptyClassRanges(e), Z);
|
|
2738
|
+
}, Y.regexp_nonEmptyClassRanges = function(e) {
|
|
2739
|
+
for (; this.regexp_eatClassAtom(e);) {
|
|
2740
|
+
var t = e.lastIntValue;
|
|
2741
|
+
if (e.eat(45) && this.regexp_eatClassAtom(e)) {
|
|
2742
|
+
var n = e.lastIntValue;
|
|
2743
|
+
e.switchU && (t === -1 || n === -1) && e.raise("Invalid character class"), t !== -1 && n !== -1 && t > n && e.raise("Range out of order in character class");
|
|
2744
|
+
}
|
|
2745
|
+
}
|
|
2746
|
+
}, Y.regexp_eatClassAtom = function(e) {
|
|
2747
|
+
var t = e.pos;
|
|
2748
|
+
if (e.eat(92)) {
|
|
2749
|
+
if (this.regexp_eatClassEscape(e)) return !0;
|
|
2750
|
+
if (e.switchU) {
|
|
2751
|
+
var n = e.current();
|
|
2752
|
+
(n === 99 || Et(n)) && e.raise("Invalid class escape"), e.raise("Invalid escape");
|
|
2753
|
+
}
|
|
2754
|
+
e.pos = t;
|
|
2755
|
+
}
|
|
2756
|
+
var r = e.current();
|
|
2757
|
+
return r !== 93 && (e.lastIntValue = r, e.advance(), !0);
|
|
2758
|
+
}, Y.regexp_eatClassEscape = function(e) {
|
|
2759
|
+
var t = e.pos;
|
|
2760
|
+
if (e.eat(98)) return e.lastIntValue = 8, !0;
|
|
2761
|
+
if (e.switchU && e.eat(45)) return e.lastIntValue = 45, !0;
|
|
2762
|
+
if (!e.switchU && e.eat(99)) {
|
|
2763
|
+
if (this.regexp_eatClassControlLetter(e)) return !0;
|
|
2764
|
+
e.pos = t;
|
|
2765
|
+
}
|
|
2766
|
+
return this.regexp_eatCharacterClassEscape(e) || this.regexp_eatCharacterEscape(e);
|
|
2767
|
+
}, Y.regexp_classSetExpression = function(e) {
|
|
2768
|
+
var t = Z, n;
|
|
2769
|
+
if (!this.regexp_eatClassSetRange(e)) {
|
|
2770
|
+
if (n = this.regexp_eatClassSetOperand(e)) {
|
|
2771
|
+
n === Q && (t = Q);
|
|
2772
|
+
for (var r = e.pos; e.eatChars([38, 38]);) {
|
|
2773
|
+
if (e.current() !== 38 && (n = this.regexp_eatClassSetOperand(e))) {
|
|
2774
|
+
n !== Q && (t = Z);
|
|
2775
|
+
continue;
|
|
2776
|
+
}
|
|
2777
|
+
e.raise("Invalid character in character class");
|
|
2778
|
+
}
|
|
2779
|
+
if (r !== e.pos) return t;
|
|
2780
|
+
for (; e.eatChars([45, 45]);) this.regexp_eatClassSetOperand(e) || e.raise("Invalid character in character class");
|
|
2781
|
+
if (r !== e.pos) return t;
|
|
2782
|
+
} else e.raise("Invalid character in character class");
|
|
2783
|
+
}
|
|
2784
|
+
for (;;) if (!this.regexp_eatClassSetRange(e)) {
|
|
2785
|
+
if (n = this.regexp_eatClassSetOperand(e), !n) return t;
|
|
2786
|
+
n === Q && (t = Q);
|
|
2787
|
+
}
|
|
2788
|
+
}, Y.regexp_eatClassSetRange = function(e) {
|
|
2789
|
+
var t = e.pos;
|
|
2790
|
+
if (this.regexp_eatClassSetCharacter(e)) {
|
|
2791
|
+
var n = e.lastIntValue;
|
|
2792
|
+
if (e.eat(45) && this.regexp_eatClassSetCharacter(e)) {
|
|
2793
|
+
var r = e.lastIntValue;
|
|
2794
|
+
return n !== -1 && r !== -1 && n > r && e.raise("Range out of order in character class"), !0;
|
|
2795
|
+
}
|
|
2796
|
+
e.pos = t;
|
|
2797
|
+
}
|
|
2798
|
+
return !1;
|
|
2799
|
+
}, Y.regexp_eatClassSetOperand = function(e) {
|
|
2800
|
+
return this.regexp_eatClassSetCharacter(e) ? Z : this.regexp_eatClassStringDisjunction(e) || this.regexp_eatNestedClass(e);
|
|
2801
|
+
}, Y.regexp_eatNestedClass = function(e) {
|
|
2802
|
+
var t = e.pos;
|
|
2803
|
+
if (e.eat(91)) {
|
|
2804
|
+
var n = e.eat(94), r = this.regexp_classContents(e);
|
|
2805
|
+
if (e.eat(93)) return n && r === Q && e.raise("Negated character class may contain strings"), r;
|
|
2806
|
+
e.pos = t;
|
|
2807
|
+
}
|
|
2808
|
+
if (e.eat(92)) {
|
|
2809
|
+
var i = this.regexp_eatCharacterClassEscape(e);
|
|
2810
|
+
if (i) return i;
|
|
2811
|
+
e.pos = t;
|
|
2812
|
+
}
|
|
2813
|
+
return null;
|
|
2814
|
+
}, Y.regexp_eatClassStringDisjunction = function(e) {
|
|
2815
|
+
var t = e.pos;
|
|
2816
|
+
if (e.eatChars([92, 113])) {
|
|
2817
|
+
if (e.eat(123)) {
|
|
2818
|
+
var n = this.regexp_classStringDisjunctionContents(e);
|
|
2819
|
+
if (e.eat(125)) return n;
|
|
2820
|
+
} else e.raise("Invalid escape");
|
|
2821
|
+
e.pos = t;
|
|
2822
|
+
}
|
|
2823
|
+
return null;
|
|
2824
|
+
}, Y.regexp_classStringDisjunctionContents = function(e) {
|
|
2825
|
+
for (var t = this.regexp_classString(e); e.eat(124);) this.regexp_classString(e) === Q && (t = Q);
|
|
2826
|
+
return t;
|
|
2827
|
+
}, Y.regexp_classString = function(e) {
|
|
2828
|
+
for (var t = 0; this.regexp_eatClassSetCharacter(e);) t++;
|
|
2829
|
+
return t === 1 ? Z : Q;
|
|
2830
|
+
}, Y.regexp_eatClassSetCharacter = function(e) {
|
|
2831
|
+
var t = e.pos;
|
|
2832
|
+
if (e.eat(92)) return this.regexp_eatCharacterEscape(e) || this.regexp_eatClassSetReservedPunctuator(e) ? !0 : e.eat(98) ? (e.lastIntValue = 8, !0) : (e.pos = t, !1);
|
|
2833
|
+
var n = e.current();
|
|
2834
|
+
return n < 0 || n === e.lookahead() && bt(n) || xt(n) ? !1 : (e.advance(), e.lastIntValue = n, !0);
|
|
2835
|
+
};
|
|
2836
|
+
function bt(e) {
|
|
2837
|
+
return e === 33 || e >= 35 && e <= 38 || e >= 42 && e <= 44 || e === 46 || e >= 58 && e <= 64 || e === 94 || e === 96 || e === 126;
|
|
2838
|
+
}
|
|
2839
|
+
function xt(e) {
|
|
2840
|
+
return e === 40 || e === 41 || e === 45 || e === 47 || e >= 91 && e <= 93 || e >= 123 && e <= 125;
|
|
2841
|
+
}
|
|
2842
|
+
Y.regexp_eatClassSetReservedPunctuator = function(e) {
|
|
2843
|
+
var t = e.current();
|
|
2844
|
+
return St(t) ? (e.lastIntValue = t, e.advance(), !0) : !1;
|
|
2845
|
+
};
|
|
2846
|
+
function St(e) {
|
|
2847
|
+
return e === 33 || e === 35 || e === 37 || e === 38 || e === 44 || e === 45 || e >= 58 && e <= 62 || e === 64 || e === 96 || e === 126;
|
|
2848
|
+
}
|
|
2849
|
+
Y.regexp_eatClassControlLetter = function(e) {
|
|
2850
|
+
var t = e.current();
|
|
2851
|
+
return Ct(t) || t === 95 ? (e.lastIntValue = t % 32, e.advance(), !0) : !1;
|
|
2852
|
+
}, Y.regexp_eatHexEscapeSequence = function(e) {
|
|
2853
|
+
var t = e.pos;
|
|
2854
|
+
if (e.eat(120)) {
|
|
2855
|
+
if (this.regexp_eatFixedHexDigits(e, 2)) return !0;
|
|
2856
|
+
e.switchU && e.raise("Invalid escape"), e.pos = t;
|
|
2857
|
+
}
|
|
2858
|
+
return !1;
|
|
2859
|
+
}, Y.regexp_eatDecimalDigits = function(e) {
|
|
2860
|
+
var t = e.pos, n = 0;
|
|
2861
|
+
for (e.lastIntValue = 0; Ct(n = e.current());) e.lastIntValue = 10 * e.lastIntValue + (n - 48), e.advance();
|
|
2862
|
+
return e.pos !== t;
|
|
2863
|
+
};
|
|
2864
|
+
function Ct(e) {
|
|
2865
|
+
return e >= 48 && e <= 57;
|
|
2866
|
+
}
|
|
2867
|
+
Y.regexp_eatHexDigits = function(e) {
|
|
2868
|
+
var t = e.pos, n = 0;
|
|
2869
|
+
for (e.lastIntValue = 0; wt(n = e.current());) e.lastIntValue = 16 * e.lastIntValue + Tt(n), e.advance();
|
|
2870
|
+
return e.pos !== t;
|
|
2871
|
+
};
|
|
2872
|
+
function wt(e) {
|
|
2873
|
+
return e >= 48 && e <= 57 || e >= 65 && e <= 70 || e >= 97 && e <= 102;
|
|
2874
|
+
}
|
|
2875
|
+
function Tt(e) {
|
|
2876
|
+
return e >= 65 && e <= 70 ? 10 + (e - 65) : e >= 97 && e <= 102 ? 10 + (e - 97) : e - 48;
|
|
2877
|
+
}
|
|
2878
|
+
Y.regexp_eatLegacyOctalEscapeSequence = function(e) {
|
|
2879
|
+
if (this.regexp_eatOctalDigit(e)) {
|
|
2880
|
+
var t = e.lastIntValue;
|
|
2881
|
+
if (this.regexp_eatOctalDigit(e)) {
|
|
2882
|
+
var n = e.lastIntValue;
|
|
2883
|
+
e.lastIntValue = t <= 3 && this.regexp_eatOctalDigit(e) ? t * 64 + n * 8 + e.lastIntValue : t * 8 + n;
|
|
2884
|
+
} else e.lastIntValue = t;
|
|
2885
|
+
return !0;
|
|
2886
|
+
}
|
|
2887
|
+
return !1;
|
|
2888
|
+
}, Y.regexp_eatOctalDigit = function(e) {
|
|
2889
|
+
var t = e.current();
|
|
2890
|
+
return Et(t) ? (e.lastIntValue = t - 48, e.advance(), !0) : (e.lastIntValue = 0, !1);
|
|
2891
|
+
};
|
|
2892
|
+
function Et(e) {
|
|
2893
|
+
return e >= 48 && e <= 55;
|
|
2894
|
+
}
|
|
2895
|
+
Y.regexp_eatFixedHexDigits = function(e, t) {
|
|
2896
|
+
var n = e.pos;
|
|
2897
|
+
e.lastIntValue = 0;
|
|
2898
|
+
for (var r = 0; r < t; ++r) {
|
|
2899
|
+
var i = e.current();
|
|
2900
|
+
if (!wt(i)) return e.pos = n, !1;
|
|
2901
|
+
e.lastIntValue = 16 * e.lastIntValue + Tt(i), e.advance();
|
|
2902
|
+
}
|
|
2903
|
+
return !0;
|
|
2904
|
+
};
|
|
2905
|
+
var Dt = function(e) {
|
|
2906
|
+
this.type = e.type, this.value = e.value, this.start = e.start, this.end = e.end, e.options.locations && (this.loc = new ue(e, e.startLoc, e.endLoc)), e.options.ranges && (this.range = [e.start, e.end]);
|
|
2907
|
+
}, $ = I.prototype;
|
|
2908
|
+
$.next = function(e) {
|
|
2909
|
+
!e && this.type.keyword && this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword), this.options.onToken && this.options.onToken(new Dt(this)), this.lastTokEnd = this.end, this.lastTokStart = this.start, this.lastTokEndLoc = this.endLoc, this.lastTokStartLoc = this.startLoc, this.nextToken();
|
|
2910
|
+
}, $.getToken = function() {
|
|
2911
|
+
return this.next(), new Dt(this);
|
|
2912
|
+
}, typeof Symbol < "u" && ($[Symbol.iterator] = function() {
|
|
2913
|
+
var e = this;
|
|
2914
|
+
return { next: function() {
|
|
2915
|
+
var t = e.getToken();
|
|
2916
|
+
return {
|
|
2917
|
+
done: t.type === b.eof,
|
|
2918
|
+
value: t
|
|
2919
|
+
};
|
|
2920
|
+
} };
|
|
2921
|
+
}), $.nextToken = function() {
|
|
2922
|
+
var e = this.curContext();
|
|
2923
|
+
if ((!e || !e.preserveSpace) && this.skipSpace(), this.start = this.pos, this.options.locations && (this.startLoc = this.curPosition()), this.pos >= this.input.length) return this.finishToken(b.eof);
|
|
2924
|
+
if (e.override) return e.override(this);
|
|
2925
|
+
this.readToken(this.fullCharCodeAtPos());
|
|
2926
|
+
}, $.readToken = function(e) {
|
|
2927
|
+
return p(e, this.options.ecmaVersion >= 6) || e === 92 ? this.readWord() : this.getTokenFromCode(e);
|
|
2928
|
+
}, $.fullCharCodeAt = function(e) {
|
|
2929
|
+
var t = this.input.charCodeAt(e);
|
|
2930
|
+
if (t <= 55295 || t >= 56320) return t;
|
|
2931
|
+
var n = this.input.charCodeAt(e + 1);
|
|
2932
|
+
return n <= 56319 || n >= 57344 ? t : (t << 10) + n - 56613888;
|
|
2933
|
+
}, $.fullCharCodeAtPos = function() {
|
|
2934
|
+
return this.fullCharCodeAt(this.pos);
|
|
2935
|
+
}, $.skipBlockComment = function() {
|
|
2936
|
+
var e = this.options.onComment && this.curPosition(), t = this.pos, n = this.input.indexOf("*/", this.pos += 2);
|
|
2937
|
+
if (n === -1 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = n + 2, this.options.locations) for (var r = void 0, i = t; (r = ne(this.input, i, this.pos)) > -1;) ++this.curLine, i = this.lineStart = r;
|
|
2938
|
+
this.options.onComment && this.options.onComment(!0, this.input.slice(t + 2, n), t, this.pos, e, this.curPosition());
|
|
2939
|
+
}, $.skipLineComment = function(e) {
|
|
2940
|
+
for (var t = this.pos, n = this.options.onComment && this.curPosition(), r = this.input.charCodeAt(this.pos += e); this.pos < this.input.length && !S(r);) r = this.input.charCodeAt(++this.pos);
|
|
2941
|
+
this.options.onComment && this.options.onComment(!1, this.input.slice(t + e, this.pos), t, this.pos, n, this.curPosition());
|
|
2942
|
+
}, $.skipSpace = function() {
|
|
2943
|
+
loop: for (; this.pos < this.input.length;) {
|
|
2944
|
+
var e = this.input.charCodeAt(this.pos);
|
|
2945
|
+
switch (e) {
|
|
2946
|
+
case 32:
|
|
2947
|
+
case 160:
|
|
2948
|
+
++this.pos;
|
|
2949
|
+
break;
|
|
2950
|
+
case 13: this.input.charCodeAt(this.pos + 1) === 10 && ++this.pos;
|
|
2951
|
+
case 10:
|
|
2952
|
+
case 8232:
|
|
2953
|
+
case 8233:
|
|
2954
|
+
++this.pos, this.options.locations && (++this.curLine, this.lineStart = this.pos);
|
|
2955
|
+
break;
|
|
2956
|
+
case 47:
|
|
2957
|
+
switch (this.input.charCodeAt(this.pos + 1)) {
|
|
2958
|
+
case 42:
|
|
2959
|
+
this.skipBlockComment();
|
|
2960
|
+
break;
|
|
2961
|
+
case 47:
|
|
2962
|
+
this.skipLineComment(2);
|
|
2963
|
+
break;
|
|
2964
|
+
default: break loop;
|
|
2965
|
+
}
|
|
2966
|
+
break;
|
|
2967
|
+
default: if (e > 8 && e < 14 || e >= 5760 && re.test(String.fromCharCode(e))) ++this.pos;
|
|
2968
|
+
else break loop;
|
|
2969
|
+
}
|
|
2970
|
+
}
|
|
2971
|
+
}, $.finishToken = function(e, t) {
|
|
2972
|
+
this.end = this.pos, this.options.locations && (this.endLoc = this.curPosition());
|
|
2973
|
+
var n = this.type;
|
|
2974
|
+
this.type = e, this.value = t, this.updateContext(n);
|
|
2975
|
+
}, $.readToken_dot = function() {
|
|
2976
|
+
var e = this.input.charCodeAt(this.pos + 1);
|
|
2977
|
+
if (e >= 48 && e <= 57) return this.readNumber(!0);
|
|
2978
|
+
var t = this.input.charCodeAt(this.pos + 2);
|
|
2979
|
+
return this.options.ecmaVersion >= 6 && e === 46 && t === 46 ? (this.pos += 3, this.finishToken(b.ellipsis)) : (++this.pos, this.finishToken(b.dot));
|
|
2980
|
+
}, $.readToken_slash = function() {
|
|
2981
|
+
var e = this.input.charCodeAt(this.pos + 1);
|
|
2982
|
+
return this.exprAllowed ? (++this.pos, this.readRegexp()) : e === 61 ? this.finishOp(b.assign, 2) : this.finishOp(b.slash, 1);
|
|
2983
|
+
}, $.readToken_mult_modulo_exp = function(e) {
|
|
2984
|
+
var t = this.input.charCodeAt(this.pos + 1), n = 1, r = e === 42 ? b.star : b.modulo;
|
|
2985
|
+
return this.options.ecmaVersion >= 7 && e === 42 && t === 42 && (++n, r = b.starstar, t = this.input.charCodeAt(this.pos + 2)), t === 61 ? this.finishOp(b.assign, n + 1) : this.finishOp(r, n);
|
|
2986
|
+
}, $.readToken_pipe_amp = function(e) {
|
|
2987
|
+
var t = this.input.charCodeAt(this.pos + 1);
|
|
2988
|
+
return t === e ? this.options.ecmaVersion >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(b.assign, 3) : this.finishOp(e === 124 ? b.logicalOR : b.logicalAND, 2) : t === 61 ? this.finishOp(b.assign, 2) : this.finishOp(e === 124 ? b.bitwiseOR : b.bitwiseAND, 1);
|
|
2989
|
+
}, $.readToken_caret = function() {
|
|
2990
|
+
return this.input.charCodeAt(this.pos + 1) === 61 ? this.finishOp(b.assign, 2) : this.finishOp(b.bitwiseXOR, 1);
|
|
2991
|
+
}, $.readToken_plus_min = function(e) {
|
|
2992
|
+
var t = this.input.charCodeAt(this.pos + 1);
|
|
2993
|
+
return t === e ? t === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 || x.test(this.input.slice(this.lastTokEnd, this.pos))) ? (this.skipLineComment(3), this.skipSpace(), this.nextToken()) : this.finishOp(b.incDec, 2) : t === 61 ? this.finishOp(b.assign, 2) : this.finishOp(b.plusMin, 1);
|
|
2994
|
+
}, $.readToken_lt_gt = function(e) {
|
|
2995
|
+
var t = this.input.charCodeAt(this.pos + 1), n = 1;
|
|
2996
|
+
return t === e ? (n = e === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2, this.input.charCodeAt(this.pos + n) === 61 ? this.finishOp(b.assign, n + 1) : this.finishOp(b.bitShift, n)) : t === 33 && e === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && this.input.charCodeAt(this.pos + 3) === 45 ? (this.skipLineComment(4), this.skipSpace(), this.nextToken()) : (t === 61 && (n = 2), this.finishOp(b.relational, n));
|
|
2997
|
+
}, $.readToken_eq_excl = function(e) {
|
|
2998
|
+
var t = this.input.charCodeAt(this.pos + 1);
|
|
2999
|
+
return t === 61 ? this.finishOp(b.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) : e === 61 && t === 62 && this.options.ecmaVersion >= 6 ? (this.pos += 2, this.finishToken(b.arrow)) : this.finishOp(e === 61 ? b.eq : b.prefix, 1);
|
|
3000
|
+
}, $.readToken_question = function() {
|
|
3001
|
+
var e = this.options.ecmaVersion;
|
|
3002
|
+
if (e >= 11) {
|
|
3003
|
+
var t = this.input.charCodeAt(this.pos + 1);
|
|
3004
|
+
if (t === 46) {
|
|
3005
|
+
var n = this.input.charCodeAt(this.pos + 2);
|
|
3006
|
+
if (n < 48 || n > 57) return this.finishOp(b.questionDot, 2);
|
|
3007
|
+
}
|
|
3008
|
+
if (t === 63) return e >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(b.assign, 3) : this.finishOp(b.coalesce, 2);
|
|
3009
|
+
}
|
|
3010
|
+
return this.finishOp(b.question, 1);
|
|
3011
|
+
}, $.readToken_numberSign = function() {
|
|
3012
|
+
var e = this.options.ecmaVersion, t = 35;
|
|
3013
|
+
if (e >= 13 && (++this.pos, t = this.fullCharCodeAtPos(), p(t, !0) || t === 92)) return this.finishToken(b.privateId, this.readWord1());
|
|
3014
|
+
this.raise(this.pos, "Unexpected character '" + E(t) + "'");
|
|
3015
|
+
}, $.getTokenFromCode = function(e) {
|
|
3016
|
+
switch (e) {
|
|
3017
|
+
case 46: return this.readToken_dot();
|
|
3018
|
+
case 40: return ++this.pos, this.finishToken(b.parenL);
|
|
3019
|
+
case 41: return ++this.pos, this.finishToken(b.parenR);
|
|
3020
|
+
case 59: return ++this.pos, this.finishToken(b.semi);
|
|
3021
|
+
case 44: return ++this.pos, this.finishToken(b.comma);
|
|
3022
|
+
case 91: return ++this.pos, this.finishToken(b.bracketL);
|
|
3023
|
+
case 93: return ++this.pos, this.finishToken(b.bracketR);
|
|
3024
|
+
case 123: return ++this.pos, this.finishToken(b.braceL);
|
|
3025
|
+
case 125: return ++this.pos, this.finishToken(b.braceR);
|
|
3026
|
+
case 58: return ++this.pos, this.finishToken(b.colon);
|
|
3027
|
+
case 96:
|
|
3028
|
+
if (this.options.ecmaVersion < 6) break;
|
|
3029
|
+
return ++this.pos, this.finishToken(b.backQuote);
|
|
3030
|
+
case 48:
|
|
3031
|
+
var t = this.input.charCodeAt(this.pos + 1);
|
|
3032
|
+
if (t === 120 || t === 88) return this.readRadixNumber(16);
|
|
3033
|
+
if (this.options.ecmaVersion >= 6) {
|
|
3034
|
+
if (t === 111 || t === 79) return this.readRadixNumber(8);
|
|
3035
|
+
if (t === 98 || t === 66) return this.readRadixNumber(2);
|
|
3036
|
+
}
|
|
3037
|
+
case 49:
|
|
3038
|
+
case 50:
|
|
3039
|
+
case 51:
|
|
3040
|
+
case 52:
|
|
3041
|
+
case 53:
|
|
3042
|
+
case 54:
|
|
3043
|
+
case 55:
|
|
3044
|
+
case 56:
|
|
3045
|
+
case 57: return this.readNumber(!1);
|
|
3046
|
+
case 34:
|
|
3047
|
+
case 39: return this.readString(e);
|
|
3048
|
+
case 47: return this.readToken_slash();
|
|
3049
|
+
case 37:
|
|
3050
|
+
case 42: return this.readToken_mult_modulo_exp(e);
|
|
3051
|
+
case 124:
|
|
3052
|
+
case 38: return this.readToken_pipe_amp(e);
|
|
3053
|
+
case 94: return this.readToken_caret();
|
|
3054
|
+
case 43:
|
|
3055
|
+
case 45: return this.readToken_plus_min(e);
|
|
3056
|
+
case 60:
|
|
3057
|
+
case 62: return this.readToken_lt_gt(e);
|
|
3058
|
+
case 61:
|
|
3059
|
+
case 33: return this.readToken_eq_excl(e);
|
|
3060
|
+
case 63: return this.readToken_question();
|
|
3061
|
+
case 126: return this.finishOp(b.prefix, 1);
|
|
3062
|
+
case 35: return this.readToken_numberSign();
|
|
3063
|
+
}
|
|
3064
|
+
this.raise(this.pos, "Unexpected character '" + E(e) + "'");
|
|
3065
|
+
}, $.finishOp = function(e, t) {
|
|
3066
|
+
var n = this.input.slice(this.pos, this.pos + t);
|
|
3067
|
+
return this.pos += t, this.finishToken(e, n);
|
|
3068
|
+
}, $.readRegexp = function() {
|
|
3069
|
+
for (var e, t, n = this.pos;;) {
|
|
3070
|
+
this.pos >= this.input.length && this.raise(n, "Unterminated regular expression");
|
|
3071
|
+
var r = this.input.charAt(this.pos);
|
|
3072
|
+
if (x.test(r) && this.raise(n, "Unterminated regular expression"), e) e = !1;
|
|
3073
|
+
else {
|
|
3074
|
+
if (r === "[") t = !0;
|
|
3075
|
+
else if (r === "]" && t) t = !1;
|
|
3076
|
+
else if (r === "/" && !t) break;
|
|
3077
|
+
e = r === "\\";
|
|
3078
|
+
}
|
|
3079
|
+
++this.pos;
|
|
3080
|
+
}
|
|
3081
|
+
var i = this.input.slice(n, this.pos);
|
|
3082
|
+
++this.pos;
|
|
3083
|
+
var a = this.pos, o = this.readWord1();
|
|
3084
|
+
this.containsEsc && this.unexpected(a);
|
|
3085
|
+
var s = this.regexpState ||= new X(this);
|
|
3086
|
+
s.reset(n, i, o), this.validateRegExpFlags(s), this.validateRegExpPattern(s);
|
|
3087
|
+
var c = null;
|
|
3088
|
+
try {
|
|
3089
|
+
c = new RegExp(i, o);
|
|
3090
|
+
} catch {}
|
|
3091
|
+
return this.finishToken(b.regexp, {
|
|
3092
|
+
pattern: i,
|
|
3093
|
+
flags: o,
|
|
3094
|
+
value: c
|
|
3095
|
+
});
|
|
3096
|
+
}, $.readInt = function(e, t, n) {
|
|
3097
|
+
for (var r = this.options.ecmaVersion >= 12 && t === void 0, i = n && this.input.charCodeAt(this.pos) === 48, a = this.pos, o = 0, s = 0, c = 0, l = t ?? Infinity; c < l; ++c, ++this.pos) {
|
|
3098
|
+
var u = this.input.charCodeAt(this.pos), d = void 0;
|
|
3099
|
+
if (r && u === 95) {
|
|
3100
|
+
i && this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"), s === 95 && this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"), c === 0 && this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"), s = u;
|
|
3101
|
+
continue;
|
|
3102
|
+
}
|
|
3103
|
+
if (d = u >= 97 ? u - 97 + 10 : u >= 65 ? u - 65 + 10 : u >= 48 && u <= 57 ? u - 48 : Infinity, d >= e) break;
|
|
3104
|
+
s = u, o = o * e + d;
|
|
3105
|
+
}
|
|
3106
|
+
return r && s === 95 && this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"), this.pos === a || t != null && this.pos - a !== t ? null : o;
|
|
3107
|
+
};
|
|
3108
|
+
function Ot(e, t) {
|
|
3109
|
+
return t ? parseInt(e, 8) : parseFloat(e.replace(/_/g, ""));
|
|
3110
|
+
}
|
|
3111
|
+
function kt(e) {
|
|
3112
|
+
return typeof BigInt == "function" ? BigInt(e.replace(/_/g, "")) : null;
|
|
3113
|
+
}
|
|
3114
|
+
$.readRadixNumber = function(e) {
|
|
3115
|
+
var t = this.pos;
|
|
3116
|
+
this.pos += 2;
|
|
3117
|
+
var n = this.readInt(e);
|
|
3118
|
+
return n ?? this.raise(this.start + 2, "Expected number in radix " + e), this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110 ? (n = kt(this.input.slice(t, this.pos)), ++this.pos) : p(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(b.num, n);
|
|
3119
|
+
}, $.readNumber = function(e) {
|
|
3120
|
+
var t = this.pos;
|
|
3121
|
+
!e && this.readInt(10, void 0, !0) === null && this.raise(t, "Invalid number");
|
|
3122
|
+
var n = this.pos - t >= 2 && this.input.charCodeAt(t) === 48;
|
|
3123
|
+
n && this.strict && this.raise(t, "Invalid number");
|
|
3124
|
+
var r = this.input.charCodeAt(this.pos);
|
|
3125
|
+
if (!n && !e && this.options.ecmaVersion >= 11 && r === 110) {
|
|
3126
|
+
var i = kt(this.input.slice(t, this.pos));
|
|
3127
|
+
return ++this.pos, p(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(b.num, i);
|
|
3128
|
+
}
|
|
3129
|
+
n && /[89]/.test(this.input.slice(t, this.pos)) && (n = !1), r === 46 && !n && (++this.pos, this.readInt(10), r = this.input.charCodeAt(this.pos)), (r === 69 || r === 101) && !n && (r = this.input.charCodeAt(++this.pos), (r === 43 || r === 45) && ++this.pos, this.readInt(10) === null && this.raise(t, "Invalid number")), p(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number");
|
|
3130
|
+
var a = Ot(this.input.slice(t, this.pos), n);
|
|
3131
|
+
return this.finishToken(b.num, a);
|
|
3132
|
+
}, $.readCodePoint = function() {
|
|
3133
|
+
var e = this.input.charCodeAt(this.pos), t;
|
|
3134
|
+
if (e === 123) {
|
|
3135
|
+
this.options.ecmaVersion < 6 && this.unexpected();
|
|
3136
|
+
var n = ++this.pos;
|
|
3137
|
+
t = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos), ++this.pos, t > 1114111 && this.invalidStringToken(n, "Code point out of bounds");
|
|
3138
|
+
} else t = this.readHexChar(4);
|
|
3139
|
+
return t;
|
|
3140
|
+
}, $.readString = function(e) {
|
|
3141
|
+
for (var t = "", n = ++this.pos;;) {
|
|
3142
|
+
this.pos >= this.input.length && this.raise(this.start, "Unterminated string constant");
|
|
3143
|
+
var r = this.input.charCodeAt(this.pos);
|
|
3144
|
+
if (r === e) break;
|
|
3145
|
+
r === 92 ? (t += this.input.slice(n, this.pos), t += this.readEscapedChar(!1), n = this.pos) : r === 8232 || r === 8233 ? (this.options.ecmaVersion < 10 && this.raise(this.start, "Unterminated string constant"), ++this.pos, this.options.locations && (this.curLine++, this.lineStart = this.pos)) : (S(r) && this.raise(this.start, "Unterminated string constant"), ++this.pos);
|
|
3146
|
+
}
|
|
3147
|
+
return t += this.input.slice(n, this.pos++), this.finishToken(b.string, t);
|
|
3148
|
+
};
|
|
3149
|
+
var At = {};
|
|
3150
|
+
$.tryReadTemplateToken = function() {
|
|
3151
|
+
this.inTemplateElement = !0;
|
|
3152
|
+
try {
|
|
3153
|
+
this.readTmplToken();
|
|
3154
|
+
} catch (e) {
|
|
3155
|
+
if (e === At) this.readInvalidTemplateToken();
|
|
3156
|
+
else throw e;
|
|
3157
|
+
}
|
|
3158
|
+
this.inTemplateElement = !1;
|
|
3159
|
+
}, $.invalidStringToken = function(e, t) {
|
|
3160
|
+
if (this.inTemplateElement && this.options.ecmaVersion >= 9) throw At;
|
|
3161
|
+
this.raise(e, t);
|
|
3162
|
+
}, $.readTmplToken = function() {
|
|
3163
|
+
for (var e = "", t = this.pos;;) {
|
|
3164
|
+
this.pos >= this.input.length && this.raise(this.start, "Unterminated template");
|
|
3165
|
+
var n = this.input.charCodeAt(this.pos);
|
|
3166
|
+
if (n === 96 || n === 36 && this.input.charCodeAt(this.pos + 1) === 123) return this.pos === this.start && (this.type === b.template || this.type === b.invalidTemplate) ? n === 36 ? (this.pos += 2, this.finishToken(b.dollarBraceL)) : (++this.pos, this.finishToken(b.backQuote)) : (e += this.input.slice(t, this.pos), this.finishToken(b.template, e));
|
|
3167
|
+
if (n === 92) e += this.input.slice(t, this.pos), e += this.readEscapedChar(!0), t = this.pos;
|
|
3168
|
+
else if (S(n)) {
|
|
3169
|
+
switch (e += this.input.slice(t, this.pos), ++this.pos, n) {
|
|
3170
|
+
case 13: this.input.charCodeAt(this.pos) === 10 && ++this.pos;
|
|
3171
|
+
case 10:
|
|
3172
|
+
e += "\n";
|
|
3173
|
+
break;
|
|
3174
|
+
default: e += String.fromCharCode(n);
|
|
3175
|
+
}
|
|
3176
|
+
this.options.locations && (++this.curLine, this.lineStart = this.pos), t = this.pos;
|
|
3177
|
+
} else ++this.pos;
|
|
3178
|
+
}
|
|
3179
|
+
}, $.readInvalidTemplateToken = function() {
|
|
3180
|
+
for (; this.pos < this.input.length; this.pos++) switch (this.input[this.pos]) {
|
|
3181
|
+
case "\\":
|
|
3182
|
+
++this.pos;
|
|
3183
|
+
break;
|
|
3184
|
+
case "$": if (this.input[this.pos + 1] !== "{") break;
|
|
3185
|
+
case "`": return this.finishToken(b.invalidTemplate, this.input.slice(this.start, this.pos));
|
|
3186
|
+
case "\r": this.input[this.pos + 1] === "\n" && ++this.pos;
|
|
3187
|
+
case "\n":
|
|
3188
|
+
case "\u2028":
|
|
3189
|
+
case "\u2029": ++this.curLine, this.lineStart = this.pos + 1;
|
|
3190
|
+
}
|
|
3191
|
+
this.raise(this.start, "Unterminated template");
|
|
3192
|
+
}, $.readEscapedChar = function(e) {
|
|
3193
|
+
var t = this.input.charCodeAt(++this.pos);
|
|
3194
|
+
switch (++this.pos, t) {
|
|
3195
|
+
case 110: return "\n";
|
|
3196
|
+
case 114: return "\r";
|
|
3197
|
+
case 120: return String.fromCharCode(this.readHexChar(2));
|
|
3198
|
+
case 117: return E(this.readCodePoint());
|
|
3199
|
+
case 116: return " ";
|
|
3200
|
+
case 98: return "\b";
|
|
3201
|
+
case 118: return "\v";
|
|
3202
|
+
case 102: return "\f";
|
|
3203
|
+
case 13: this.input.charCodeAt(this.pos) === 10 && ++this.pos;
|
|
3204
|
+
case 10: return this.options.locations && (this.lineStart = this.pos, ++this.curLine), "";
|
|
3205
|
+
case 56:
|
|
3206
|
+
case 57: if (this.strict && this.invalidStringToken(this.pos - 1, "Invalid escape sequence"), e) {
|
|
3207
|
+
var n = this.pos - 1;
|
|
3208
|
+
this.invalidStringToken(n, "Invalid escape sequence in template string");
|
|
3209
|
+
}
|
|
3210
|
+
default:
|
|
3211
|
+
if (t >= 48 && t <= 55) {
|
|
3212
|
+
var r = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0], i = parseInt(r, 8);
|
|
3213
|
+
return i > 255 && (r = r.slice(0, -1), i = parseInt(r, 8)), this.pos += r.length - 1, t = this.input.charCodeAt(this.pos), (r !== "0" || t === 56 || t === 57) && (this.strict || e) && this.invalidStringToken(this.pos - 1 - r.length, e ? "Octal literal in template string" : "Octal literal in strict mode"), String.fromCharCode(i);
|
|
3214
|
+
}
|
|
3215
|
+
return S(t) ? (this.options.locations && (this.lineStart = this.pos, ++this.curLine), "") : String.fromCharCode(t);
|
|
3216
|
+
}
|
|
3217
|
+
}, $.readHexChar = function(e) {
|
|
3218
|
+
var t = this.pos, n = this.readInt(16, e);
|
|
3219
|
+
return n === null && this.invalidStringToken(t, "Bad character escape sequence"), n;
|
|
3220
|
+
}, $.readWord1 = function() {
|
|
3221
|
+
this.containsEsc = !1;
|
|
3222
|
+
for (var e = "", t = !0, n = this.pos, r = this.options.ecmaVersion >= 6; this.pos < this.input.length;) {
|
|
3223
|
+
var i = this.fullCharCodeAtPos();
|
|
3224
|
+
if (m(i, r)) this.pos += i <= 65535 ? 1 : 2;
|
|
3225
|
+
else if (i === 92) {
|
|
3226
|
+
this.containsEsc = !0, e += this.input.slice(n, this.pos);
|
|
3227
|
+
var a = this.pos;
|
|
3228
|
+
this.input.charCodeAt(++this.pos) !== 117 && this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"), ++this.pos;
|
|
3229
|
+
var o = this.readCodePoint();
|
|
3230
|
+
(t ? p : m)(o, r) || this.invalidStringToken(a, "Invalid Unicode escape"), e += E(o), n = this.pos;
|
|
3231
|
+
} else break;
|
|
3232
|
+
t = !1;
|
|
3233
|
+
}
|
|
3234
|
+
return e + this.input.slice(n, this.pos);
|
|
3235
|
+
}, $.readWord = function() {
|
|
3236
|
+
var e = this.readWord1(), t = b.name;
|
|
3237
|
+
return this.keywords.test(e) && (t = ee[e]), this.finishToken(t, e);
|
|
3238
|
+
}, I.acorn = {
|
|
3239
|
+
Parser: I,
|
|
3240
|
+
version: "8.18.0",
|
|
3241
|
+
defaultOptions: fe,
|
|
3242
|
+
Position: D,
|
|
3243
|
+
SourceLocation: ue,
|
|
3244
|
+
getLineInfo: de,
|
|
3245
|
+
Node: Be,
|
|
3246
|
+
TokenType: h,
|
|
3247
|
+
tokTypes: b,
|
|
3248
|
+
keywordTypes: ee,
|
|
3249
|
+
TokContext: U,
|
|
3250
|
+
tokContexts: W,
|
|
3251
|
+
isIdentifierChar: m,
|
|
3252
|
+
isIdentifierStart: p,
|
|
3253
|
+
Token: Dt,
|
|
3254
|
+
isNewLine: S,
|
|
3255
|
+
lineBreak: x,
|
|
3256
|
+
lineBreakG: te,
|
|
3257
|
+
nonASCIIwhitespace: re
|
|
3258
|
+
};
|
|
3259
|
+
function jt(e, t, n) {
|
|
3260
|
+
return I.parseExpressionAt(e, t, n);
|
|
3261
|
+
}
|
|
3262
|
+
//#endregion
|
|
3263
|
+
//#region src/debug.ts
|
|
3264
|
+
var Mt = !!process.env.DEBUG;
|
|
3265
|
+
function Nt(...e) {
|
|
3266
|
+
Mt && console.log(...e);
|
|
3267
|
+
}
|
|
3268
|
+
//#endregion
|
|
3269
|
+
//#region src/safe-eval.ts
|
|
3270
|
+
var Pt = {
|
|
3271
|
+
String: (e) => String(e ?? ""),
|
|
3272
|
+
Number: (e) => Number(e),
|
|
3273
|
+
Boolean: (e) => !!e,
|
|
3274
|
+
JSON: {
|
|
3275
|
+
parse: (e) => JSON.parse(e),
|
|
3276
|
+
stringify: (e) => JSON.stringify(e, null, 2)
|
|
3277
|
+
}
|
|
3278
|
+
};
|
|
3279
|
+
function Ft(n) {
|
|
3280
|
+
let r = t.resolve(n), i = (...e) => {
|
|
3281
|
+
let n = t.resolve(r, ...e);
|
|
3282
|
+
if (n !== r && !n.startsWith(`${r}${t.sep}`)) throw Error("Workspace file path escapes working directory");
|
|
3283
|
+
return n;
|
|
3284
|
+
};
|
|
3285
|
+
return {
|
|
3286
|
+
exists: (t) => e.existsSync(i(t)),
|
|
3287
|
+
readFile: (t) => e.readFileSync(i(t), "utf8"),
|
|
3288
|
+
join: (...e) => i(...e)
|
|
3289
|
+
};
|
|
3290
|
+
}
|
|
3291
|
+
var It = class {
|
|
3292
|
+
static async evaluateValue(e, t = {}) {
|
|
3293
|
+
if (typeof e != "string" || !e.includes("${")) return e;
|
|
3294
|
+
let n = `\`${e}\``;
|
|
3295
|
+
return this.evaluateExpression(n, t);
|
|
3296
|
+
}
|
|
3297
|
+
static async evaluateConditions(e, t = {}) {
|
|
3298
|
+
typeof e == "string" && (e = [e]);
|
|
3299
|
+
for (let n of e) {
|
|
3300
|
+
let e = await this.evaluateExpression(n, t);
|
|
3301
|
+
if (Nt("condition", e, n, t), e) return !0;
|
|
3302
|
+
}
|
|
3303
|
+
return !1;
|
|
3304
|
+
}
|
|
3305
|
+
static async evaluateExpression(e, t = {}) {
|
|
3306
|
+
if (!e || typeof e != "string") return e;
|
|
3307
|
+
let n = e.trim(), r;
|
|
3308
|
+
try {
|
|
3309
|
+
r = jt(n, 0, {
|
|
3310
|
+
ecmaVersion: 2020,
|
|
3311
|
+
allowAwaitOutsideFunction: !1
|
|
3312
|
+
});
|
|
3313
|
+
} catch (e) {
|
|
3314
|
+
throw Error(`Invalid expression syntax in '${n}': ${e.message}`);
|
|
3315
|
+
}
|
|
3316
|
+
return this.evalNodeAsync(r, t);
|
|
3317
|
+
}
|
|
3318
|
+
static async evalNodeAsync(e, t) {
|
|
3319
|
+
switch (e.type) {
|
|
3320
|
+
case "Literal": return e.value;
|
|
3321
|
+
case "Identifier": return e.name in t ? t[e.name] : e.name in Pt ? Pt[e.name] : void 0;
|
|
3322
|
+
case "MemberExpression": {
|
|
3323
|
+
let n = await this.evalNodeAsync(e.object, t);
|
|
3324
|
+
if (n == null) return;
|
|
3325
|
+
let r = e.computed ? await this.evalNodeAsync(e.property, t) : e.property.name;
|
|
3326
|
+
if ([
|
|
3327
|
+
"constructor",
|
|
3328
|
+
"__proto__",
|
|
3329
|
+
"prototype"
|
|
3330
|
+
].includes(r)) throw Error(`Security Guard Violation: Access to '${r}' is blocked.`);
|
|
3331
|
+
return n[r];
|
|
3332
|
+
}
|
|
3333
|
+
case "CallExpression": {
|
|
3334
|
+
let n, r = null;
|
|
3335
|
+
if (e.callee.type === "MemberExpression") {
|
|
3336
|
+
r = await this.evalNodeAsync(e.callee.object, t);
|
|
3337
|
+
let i = e.callee.computed ? await this.evalNodeAsync(e.callee.property, t) : e.callee.property.name;
|
|
3338
|
+
if ([
|
|
3339
|
+
"constructor",
|
|
3340
|
+
"__proto__",
|
|
3341
|
+
"prototype"
|
|
3342
|
+
].includes(i)) throw Error(`Security Guard Violation: Invoking method '${i}' is blocked.`);
|
|
3343
|
+
if (r != null && typeof r[i] == "function") n = r[i];
|
|
3344
|
+
else throw Error(`Property '${i}' is not a callable function on target object.`);
|
|
3345
|
+
} else if (e.callee.type === "Identifier") {
|
|
3346
|
+
let r = e.callee.name;
|
|
3347
|
+
if (n = t[r] ?? Pt[r], !n || typeof n != "function") throw Error(`Unknown function helper '${r}'.`);
|
|
3348
|
+
}
|
|
3349
|
+
if (!n) throw Error("Invalid function invocation target.");
|
|
3350
|
+
let i = await Promise.all(e.arguments.map((e) => this.evalNodeAsync(e, t)));
|
|
3351
|
+
return await n.apply(r, i);
|
|
3352
|
+
}
|
|
3353
|
+
case "BinaryExpression": {
|
|
3354
|
+
let n = await this.evalNodeAsync(e.left, t), r = await this.evalNodeAsync(e.right, t);
|
|
3355
|
+
switch (e.operator) {
|
|
3356
|
+
case "===":
|
|
3357
|
+
case "==": return n == r;
|
|
3358
|
+
case "!==":
|
|
3359
|
+
case "!=": return n != r;
|
|
3360
|
+
case ">": return n > r;
|
|
3361
|
+
case "<": return n < r;
|
|
3362
|
+
case ">=": return n >= r;
|
|
3363
|
+
case "<=": return n <= r;
|
|
3364
|
+
case "+": return n + r;
|
|
3365
|
+
case "-": return n - r;
|
|
3366
|
+
case "*": return n * r;
|
|
3367
|
+
case "/": return n / r;
|
|
3368
|
+
default: throw Error(`Unsupported binary operator: ${e.operator}`);
|
|
3369
|
+
}
|
|
3370
|
+
}
|
|
3371
|
+
case "LogicalExpression": {
|
|
3372
|
+
let n = await this.evalNodeAsync(e.left, t);
|
|
3373
|
+
if (e.operator === "&&") return n && await this.evalNodeAsync(e.right, t);
|
|
3374
|
+
if (e.operator === "||") return n || await this.evalNodeAsync(e.right, t);
|
|
3375
|
+
throw Error(`Unsupported logical operator: ${e.operator}`);
|
|
3376
|
+
}
|
|
3377
|
+
case "UnaryExpression": {
|
|
3378
|
+
let n = await this.evalNodeAsync(e.argument, t);
|
|
3379
|
+
if (e.operator === "!") return !n;
|
|
3380
|
+
if (e.operator === "-") return -n;
|
|
3381
|
+
if (e.operator === "+") return +n;
|
|
3382
|
+
throw Error(`Unsupported unary operator: ${e.operator}`);
|
|
3383
|
+
}
|
|
3384
|
+
case "TemplateLiteral": {
|
|
3385
|
+
let n = e.quasis.map((e) => e.value.cooked), r = await Promise.all(e.expressions.map((e) => this.evalNodeAsync(e, t))), i = "";
|
|
3386
|
+
for (let e = 0; e < n.length; e++) i += n[e], e < r.length && (i += r[e] ?? "");
|
|
3387
|
+
return i;
|
|
3388
|
+
}
|
|
3389
|
+
case "ArrayExpression": return Promise.all(e.elements.map((e) => this.evalNodeAsync(e, t)));
|
|
3390
|
+
case "ObjectExpression": {
|
|
3391
|
+
let n = {};
|
|
3392
|
+
for (let r of e.properties) if (r.type === "Property") {
|
|
3393
|
+
let e = r.key.type === "Identifier" ? r.key.name : await this.evalNodeAsync(r.key, t);
|
|
3394
|
+
n[e] = await this.evalNodeAsync(r.value, t);
|
|
3395
|
+
}
|
|
3396
|
+
return n;
|
|
3397
|
+
}
|
|
3398
|
+
case "ChainExpression": return this.evalNodeAsync(e.expression, t);
|
|
3399
|
+
case "ConditionalExpression": return await this.evalNodeAsync(e.test, t) ? await this.evalNodeAsync(e.consequent, t) : await this.evalNodeAsync(e.alternate, t);
|
|
3400
|
+
default: throw Error(`Security Guard Violation: AST Node type '${e.type}' is disallowed.`);
|
|
3401
|
+
}
|
|
3402
|
+
}
|
|
3403
|
+
};
|
|
3404
|
+
//#endregion
|
|
3405
|
+
//#region src/parser/matrix-expander.ts
|
|
3406
|
+
function Lt(e) {
|
|
3407
|
+
if (!e.matrix || Object.keys(e.matrix).length === 0) return [e];
|
|
3408
|
+
let t = e.matrix;
|
|
3409
|
+
return Object.keys(t).reduce((e, n) => {
|
|
3410
|
+
let r = Array.isArray(t[n]) ? t[n] : [t[n]];
|
|
3411
|
+
return e.flatMap((e) => r.map((t) => ({
|
|
3412
|
+
...e,
|
|
3413
|
+
[n]: t
|
|
3414
|
+
})));
|
|
3415
|
+
}, [{}]).map((t, n) => {
|
|
3416
|
+
let r = JSON.parse(JSON.stringify(e));
|
|
3417
|
+
delete r.matrix;
|
|
3418
|
+
let i = Object.entries(t).map(([e, t]) => `${e}=${t}`).join(", ");
|
|
3419
|
+
r.name = `${e.name} (${i})`, r.matrixContext = t;
|
|
3420
|
+
let a = {};
|
|
3421
|
+
for (let [e, n] of Object.entries(t)) {
|
|
3422
|
+
let t = `MATRIX_${e.toUpperCase().replace(/[^A-Z0-9_]/g, "_")}`;
|
|
3423
|
+
a[t] = String(n);
|
|
3424
|
+
}
|
|
3425
|
+
return r.env = {
|
|
3426
|
+
...r.env || {},
|
|
3427
|
+
...a
|
|
3428
|
+
}, r;
|
|
3429
|
+
});
|
|
3430
|
+
}
|
|
3431
|
+
async function Rt(e, t, n = {}) {
|
|
3432
|
+
let r = await Promise.all((e || []).map(async (e) => String(await It.evaluateValue(e, {
|
|
3433
|
+
inputs: n,
|
|
3434
|
+
matrix: t
|
|
3435
|
+
})).trim()));
|
|
3436
|
+
return [...new Set(r.filter(Boolean))];
|
|
3437
|
+
}
|
|
3438
|
+
//#endregion
|
|
3439
|
+
export { Nt as a, Ft as i, Rt as n, It as r, Lt as t };
|