@@ -19,7 +19,9 @@ async function test() {
19
19
await Promise.resolve("value");
20
20
Promise.resolve("value").then(() => {}, () => {});
21
21
Promise.resolve("value").then(() => {}).catch(() => {});
22
+ Promise.resolve("value").then(() => {}).catch(() => {}).finally(() => {});
22
23
Promise.resolve("value").catch(() => {});
24
+ Promise.resolve("value").finally(() => {});
23
25
return Promise.resolve("value");
24
26
}
25
27
` ,
@@ -36,7 +38,9 @@ async function test() {
36
38
await Promise.reject(new Error("message"));
37
39
Promise.reject(new Error("message")).then(() => {}, () => {});
38
40
Promise.reject(new Error("message")).then(() => {}).catch(() => {});
41
+ Promise.reject(new Error("message")).then(() => {}).catch(() => {}).finally(() => {});
39
42
Promise.reject(new Error("message")).catch(() => {});
43
+ Promise.reject(new Error("message")).finally(() => {});
40
44
return Promise.reject(new Error("message"));
41
45
}
42
46
` ,
@@ -45,7 +49,9 @@ async function test() {
45
49
await (async () => true)();
46
50
(async () => true)().then(() => {}, () => {});
47
51
(async () => true)().then(() => {}).catch(() => {});
52
+ (async () => true)().then(() => {}).catch(() => {}).finally(() => {});
48
53
(async () => true)().catch(() => {});
54
+ (async () => true)().finally(() => {});
49
55
return (async () => true)();
50
56
}
51
57
` ,
@@ -55,7 +61,9 @@ async function test() {
55
61
await returnsPromise();
56
62
returnsPromise().then(() => {}, () => {});
57
63
returnsPromise().then(() => {}).catch(() => {});
64
+ returnsPromise().then(() => {}).catch(() => {}).finally(() => {});
58
65
returnsPromise().catch(() => {});
66
+ returnsPromise().finally(() => {});
59
67
return returnsPromise();
60
68
}
61
69
` ,
@@ -64,6 +72,7 @@ async function test() {
64
72
const x = Promise.resolve();
65
73
const y = x.then(() => {});
66
74
y.catch(() => {});
75
+ y.finally(() => {});
67
76
}
68
77
` ,
69
78
`
@@ -74,6 +83,7 @@ async function test() {
74
83
`
75
84
async function test() {
76
85
Promise.resolve().catch(() => {}), 123;
86
+ Promise.resolve().finally(() => {}), 123;
77
87
123, Promise.resolve().then(() => {}, () => {});
78
88
123, Promise.resolve().then(() => {}, () => {}), 123;
79
89
}
@@ -95,7 +105,9 @@ async function test() {
95
105
await promiseValue;
96
106
promiseValue.then(() => {}, () => {});
97
107
promiseValue.then(() => {}).catch(() => {});
108
+ promiseValue.then(() => {}).catch(() => {}).finally(() => {});
98
109
promiseValue.catch(() => {});
110
+ promiseValue.finally(() => {});
99
111
return promiseValue;
100
112
}
101
113
` ,
@@ -106,7 +118,9 @@ async function test() {
106
118
await promiseUnion;
107
119
promiseUnion.then(() => {}, () => {});
108
120
promiseUnion.then(() => {}).catch(() => {});
121
+ promiseUnion.then(() => {}).catch(() => {}).finally(() => {});
109
122
promiseUnion.catch(() => {});
123
+ promiseValue.finally(() => {});
110
124
return promiseUnion;
111
125
}
112
126
` ,
@@ -117,7 +131,9 @@ async function test() {
117
131
await promiseIntersection;
118
132
promiseIntersection.then(() => {}, () => {});
119
133
promiseIntersection.then(() => {}).catch(() => {});
134
+ promiseIntersection.then(() => {}).catch(() => {}).finally(() => {});
120
135
promiseIntersection.catch(() => {});
136
+ promiseIntersection.finally(() => {});
121
137
return promiseIntersection;
122
138
}
123
139
` ,
@@ -129,7 +145,9 @@ async function test() {
129
145
await canThen;
130
146
canThen.then(() => {}, () => {});
131
147
canThen.then(() => {}).catch(() => {});
148
+ canThen.then(() => {}).catch(() => {}).finally(() => {});
132
149
canThen.catch(() => {});
150
+ canThen.finally(() => {});
133
151
return canThen;
134
152
}
135
153
` ,
@@ -214,7 +232,9 @@ async function test() {
214
232
await promise;
215
233
promise.then(() => {}, () => {});
216
234
promise.then(() => {}).catch(() => {});
235
+ promise.then(() => {}).catch(() => {}).finally(() => {});
217
236
promise.catch(() => {});
237
+ promise.finally(() => {});
218
238
return promise;
219
239
}
220
240
` ,
@@ -227,6 +247,7 @@ async function test() {
227
247
returnsPromise()?.then(() => {}, () => {});
228
248
returnsPromise()?.then(() => {})?.catch(() => {});
229
249
returnsPromise()?.catch(() => {});
250
+ returnsPromise()?.finally(() => {});
230
251
return returnsPromise();
231
252
}
232
253
` ,
@@ -239,6 +260,7 @@ async function test() {
239
260
Promise.resolve("value");
240
261
Promise.resolve("value").then(() => {});
241
262
Promise.resolve("value").catch();
263
+ Promise.resolve("value").finally();
242
264
}
243
265
` ,
244
266
errors : [
@@ -254,6 +276,10 @@ async function test() {
254
276
line : 5 ,
255
277
messageId : 'floating' ,
256
278
} ,
279
+ {
280
+ line : 6 ,
281
+ messageId : 'floating' ,
282
+ } ,
257
283
] ,
258
284
} ,
259
285
{
@@ -286,6 +312,7 @@ async function test() {
286
312
Promise.reject(new Error("message"));
287
313
Promise.reject(new Error("message")).then(() => {});
288
314
Promise.reject(new Error("message")).catch();
315
+ Promise.reject(new Error("message")).finally();
289
316
}
290
317
` ,
291
318
errors : [
@@ -301,6 +328,10 @@ async function test() {
301
328
line : 5 ,
302
329
messageId : 'floating' ,
303
330
} ,
331
+ {
332
+ line : 6 ,
333
+ messageId : 'floating' ,
334
+ } ,
304
335
] ,
305
336
} ,
306
337
{
@@ -309,6 +340,7 @@ async function test() {
309
340
(async () => true)();
310
341
(async () => true)().then(() => {});
311
342
(async () => true)().catch();
343
+ (async () => true)().finally();
312
344
}
313
345
` ,
314
346
errors : [
@@ -324,6 +356,10 @@ async function test() {
324
356
line : 5 ,
325
357
messageId : 'floating' ,
326
358
} ,
359
+ {
360
+ line : 6 ,
361
+ messageId : 'floating' ,
362
+ } ,
327
363
] ,
328
364
} ,
329
365
{
@@ -334,6 +370,7 @@ async function test() {
334
370
returnsPromise();
335
371
returnsPromise().then(() => {});
336
372
returnsPromise().catch();
373
+ returnsPromise().finally();
337
374
}
338
375
` ,
339
376
errors : [
@@ -349,6 +386,10 @@ async function test() {
349
386
line : 7 ,
350
387
messageId : 'floating' ,
351
388
} ,
389
+ {
390
+ line : 8 ,
391
+ messageId : 'floating' ,
392
+ } ,
352
393
] ,
353
394
} ,
354
395
{
@@ -440,6 +481,7 @@ async function test() {
440
481
promiseValue;
441
482
promiseValue.then(() => {});
442
10000
td>483
promiseValue.catch();
484
+ promiseValue.finally();
443
485
}
444
486
` ,
445
487
errors : [
@@ -455,6 +497,10 @@ async function test() {
455
497
line : 7 ,
456
498
messageId : 'floating' ,
457
499
} ,
500
+ {
501
+ line : 8 ,
502
+ messageId : 'floating' ,
503
+ } ,
458
504
] ,
459
505
} ,
460
506
{
@@ -480,6 +526,7 @@ async function test() {
480
526
promiseIntersection;
481
527
promiseIntersection.then(() => {})
482
528
promiseIntersection.catch();
529
+ promiseIntersection.finally();
483
530
}
484
531
` ,
485
532
errors : [
@@ -495,6 +542,10 @@ async function test() {
495
542
line : 7 ,
496
543
messageId : 'floating' ,
497
544
} ,
545
+ {
546
+ line : 8 ,
547
+ messageId : 'floating' ,
548
+ } ,
498
549
] ,
499
550
} ,
500
551
{
@@ -506,6 +557,7 @@ async function test() {
506
557
canThen;
507
558
canThen.then(() => {});
508
559
canThen.catch();
560
+ canThen.finally();
509
561
}
510
562
` ,
511
563
errors : [
@@ -521,6 +573,10 @@ async function test() {
521
573
line : 8 ,
522
574
messageId : 'floating' ,
523
575
} ,
576
+ {
577
+ line : 9 ,
578
+ messageId : 'floating' ,
579
+ } ,
524
580
] ,
525
581
} ,
526
582
{
0 commit comments