@@ -337,11 +337,7 @@ TestCoverage(
337
337
[ { "start" :0 , "end" :849 , "count" :1 } ,
338
338
{ "start" :1 , "end" :801 , "count" :1 } ,
339
339
{ "start" :67 , "end" :87 , "count" :0 } ,
340
- { "start" :221 , "end" :222 , "count" :0 } ,
341
- { "start" :254 , "end" :274 , "count" :0 } ,
342
- { "start" :371 , "end" :372 , "count" :0 } ,
343
- { "start" :403 , "end" :404 , "count" :0 } ,
344
- { "start" :553 , "end" :554 , "count" :0 } ]
340
+ { "start" :254 , "end" :274 , "count" :0 } ]
345
341
) ;
346
342
347
343
TestCoverage ( "try/catch/finally statements with early return" ,
@@ -358,10 +354,8 @@ TestCoverage("try/catch/finally statements with early return",
358
354
` ,
359
355
[ { "start" :0 , "end" :449 , "count" :1 } ,
360
356
{ "start" :1 , "end" :151 , "count" :1 } ,
361
- { "start" :69 , "end" :70 , "count" :0 } ,
362
357
{ "start" :91 , "end" :150 , "count" :0 } ,
363
358
{ "start" :201 , "end" :401 , "count" :1 } ,
364
- { "start" :269 , "end" :270 , "count" :0 } ,
365
359
{ "start" :321 , "end" :400 , "count" :0 } ]
366
360
) ;
367
361
@@ -393,15 +387,13 @@ TestCoverage(
393
387
` ,
394
388
[ { "start" :0 , "end" :1099 , "count" :1 } ,
395
389
{ "start" :1 , "end" :151 , "count" :1 } ,
396
- { "start" :69 , "end" :70 , "count" :0 } ,
397
390
{ "start" :91 , "end" :150 , "count" :0 } ,
398
391
{ "start" :201 , "end" :351 , "count" :1 } ,
399
392
{ "start" :286 , "end" :350 , "count" :0 } ,
400
393
{ "start" :401 , "end" :701 , "count" :1 } ,
401
394
{ "start" :603 , "end" :700 , "count" :0 } ,
402
395
{ "start" :561 , "end" :568 , "count" :0 } ,
403
396
{ "start" :751 , "end" :1051 , "count" :1 } ,
404
- { "start" :819 , "end" :820 , "count" :0 } ,
405
397
{ "start" :861 , "end" :1050 , "count" :0 } ]
406
398
) ;
407
399
@@ -561,7 +553,6 @@ try { // 0200
561
553
} catch (e) {} // 0450
562
554
` ,
563
555
[ { "start" :0 , "end" :499 , "count" :1 } ,
564
- { "start" :451 , "end" :452 , "count" :0 } ,
565
556
{ "start" :12 , "end" :101 , "count" :1 } ,
566
557
{ "start" :60 , "end" :100 , "count" :0 } ,
567
558
{ "start" :264 , "end" :353 , "count" :1 } ,
@@ -636,7 +627,6 @@ try { // 0200
636
627
} catch (e) {} // 0450
637
628
` ,
638
629
[ { "start" :0 , "end" :499 , "count" :1 } ,
639
- { "start" :451 , "end" :452 , "count" :0 } ,
640
630
{ "start" :12 , "end" :101 , "count" :1 } ,
641
631
{ "start" :65 , "end" :100 , "count" :0 } ,
642
632
{ "start" :264 , "end" :353 , "count" :1 } ,
@@ -1017,7 +1007,6 @@ try { // 0500
1017
1007
} catch (err) {} // 0600
1018
1008
` ,
1019
1009
[ { "start" :0 , "end" :649 , "count" :1 } ,
1020
- { "start" :351 , "end" :352 , "count" :0 } ,
1021
1010
{ "start" :602 , "end" :616 , "count" :0 } ,
1022
1011
{ "start" :0 , "end" :201 , "count" :2 } ,
1023
1012
{ "start" :69 , "end" :153 , "count" :1 } ]
@@ -1093,7 +1082,8 @@ function test(foo = "foodef") { // 0000
1093
1082
console.log("test"); // 0200
1094
1083
} // 0250
1095
1084
} // 0300
1096
- test().bar(); // 0350` ,
1085
+ test().bar(); // 0350
1086
+ ` ,
1097
1087
[ { "start" :0 , "end" :399 , "count" :1 } ,
1098
1088
{ "start" :0 , "end" :301 , "count" :1 } ,
1099
1089
{ "start" :152 , "end" :253 , "count" :1 } ] ) ;
@@ -1105,11 +1095,86 @@ function test(foo = (()=>{})) { // 0000
1105
1095
return {foo}; // 0050
1106
1096
} // 0100
1107
1097
// 0150
1108
- test(()=>{}).foo(); // 0200` ,
1098
+ test(()=>{}).foo(); // 0200
1099
+ ` ,
1109
1100
[ { "start" :0 , "end" :249 , "count" :1 } ,
1110
1101
{ "start" :0 , "end" :101 , "count" :1 } ,
1111
1102
{ "start" :21 , "end" :27 , "count" :0 } ,
1112
1103
{ "start" :205 , "end" :211 , "count" :1 } ]
1113
1104
) ;
1114
1105
1106
+ TestCoverage (
1107
+ "https://crbug.com/v8/10030 - original" ,
1108
+ `
1109
+ function a (shouldThrow) { // 0000
1110
+ try { // 0050
1111
+ if (shouldThrow) // 0100
1112
+ throw Error('I threw!'); // 0150
1113
+ return 'I ran'; // 0200
1114
+ } catch(e) { // 0250
1115
+ console.info('caught'); // 0300
1116
+ } // 0350
1117
+ } // 0400
1118
+ a(false); // 0450
1119
+ a(true); // 0500
1120
+ ` ,
1121
+ [ { "start" :0 , "end" :549 , "count" :1 } ,
1122
+ { "start" :0 , "end" :401 , "count" :2 } ,
1123
+ { "start" :156 , "end" :353 , "count" :1 } ]
1124
+ ) ;
1125
+
1126
+ TestCoverage (
1127
+ "https://crbug.com/v8/10030 - only throw" ,
1128
+ `
1129
+ function a (shouldThrow) { // 0000
1130
+ try { // 0050
1131
+ if (shouldThrow) // 0100
1132
+ throw Error('I threw!'); // 0150
1133
+ return 'I ran'; // 0200
1134
+ } catch(e) { // 0250
1135
+ console.info('caught'); // 0300
1136
+ } // 0350
1137
+ } // 0400
1138
+ a(true); // 0450
1139
+ ` ,
1140
+ [ { "start" :0 , "end" :499 , "count" :1 } ,
1141
+ { "start" :0 , "end" :401 , "count" :1 } ,
1142
+ { "start" :180 , "end" :254 , "count" :0 } ]
1143
+ ) ;
1144
+
1145
+ TestCoverage (
1146
+ "https://crbug.com/v8/10030 - finally" ,
1147
+ `
1148
+ function a (shouldThrow) { // 0000
1149
+ try { // 0050
1150
+ return 'I ran'; // 0100
1151
+ } finally { // 0150
1152
+ console.info('finally'); // 0200
1153
+ } // 0250
1154
+ } // 0300
1155
+ a(false); // 0350
1156
+ a(true); // 0400
1157
+ ` ,
1158
+ [ { "start" :0 , "end" :449 , "count" :1 } ,
1159
+ { "start" :0 , "end" :301 , "count" :2 } ] ) ;
1160
+
1161
+ TestCoverage (
1162
+ "https://crbug.com/v8/10030 - catch & finally" ,
1163
+ `
1164
+ function a (shouldThrow) { // 0000
1165
+ try { // 0050
1166
+ return 'I ran'; // 0100
1167
+ } catch (e) { // 0150
1168
+ console.info('caught'); // 0200
1169
+ } finally { // 0250
1170
+ console.info('finally'); // 0300
1171
+ } // 0350
1172
+ } // 0400
1173
+ a(false); // 0450
1174
+ a(true); // 0500
1175
+ ` ,
1176
+ [ { "start" :0 , "end" :549 , "count" :1 } ,
1177
+ { "start" :0 , "end" :401 , "count" :2 } ,
1178
+ { "start" :154 , "end" :254 , "count" :0 } ] ) ;
1179
+
1115
1180
% DebugToggleBlockCoverage ( false ) ;
0 commit comments