@@ -1177,7 +1177,7 @@ a(true); // 0500
1177
1177
{ "start" :0 , "end" :401 , "count" :2 } ,
1178
1178
{ "start" :154 , "end" :254 , "count" :0 } ] ) ;
1179
1179
1180
- TestCoverage (
1180
+ TestCoverage (
1181
1181
"https://crbug.com/v8/11231 - nullish coalescing" ,
1182
1182
`
1183
1183
const a = true // 0000
@@ -1195,4 +1195,41 @@ const i = c ?? b ?? 'hello' // 0400
1195
1195
{ "start" :262 , "end" :274 , "count" :0 } ,
1196
1196
{ "start" :417 , "end" :427 , "count" :0 } ] ) ;
1197
1197
1198
+ TestCoverage (
1199
+ "Optional Chaining" ,
1200
+ `
1201
+ const a = undefined || null // 0000
1202
+ const b = a?.b // 0050
1203
+ const c = a?.['b'] // 0100
1204
+ const d = { // 0150
1205
+ e: {f: 99, g: () => {return undefined}} // 0200
1206
+ } // 0250
1207
+ const e = d?.e?.f // 0300
1208
+ const f = d?.e?.['f'] // 0350
1209
+ const g = d?.e?.f?.g // 0400
1210
+ const h = d?.e?.f?.g?.h // 0450
1211
+ const i = d?.['d']?.['e']?.['h'] // 0500
1212
+ const k = a?.('b') // 0550
1213
+ const l = d?.e?.g?.() // 0600
1214
+ const m = d?.e?.g?.()?.a?.b // 0650
1215
+ delete a?.b // 0700
1216
+ const n = d?.[d?.x?.f] // 0750
1217
+ if (a?.[d?.x?.f]) { const p = 99 } else {}// 0800
1218
+ const p = d?.[d?.x?.f]?.x // 0850
1219
+ ` ,
1220
+ [ { "start" :0 , "end" :899 , "count" :1 } ,
1221
+ { "start" :61 , "end" :64 , "count" :0 } ,
1222
+ { "start" :111 , "end" :118 , "count" :0 } ,
1223
+ { "start" :470 , "end" :473 , "count" :0 } ,
1224
+ { "start" :518 , "end" :532 , "count" :0 } ,
1225
+ { "start" :561 , "end" :568 , "count" :0 } ,
1226
+ { "start" :671 , "end" :677 , "count" :0 } ,
1227
+ { "start" :708 , "end" :711 , "count" :0 } ,
1228
+ { "start" :768 , "end" :771 , "count" :0 } ,
1229
+ { "start" :805 , "end" :816 , "count" :0 } ,
1230
+ { "start" :818 , "end" :834 , "count" :0 } ,
1231
+ { "start" :868 , "end" :871 , "count" :0 } ,
1232
+ { "start" :872 , "end" :875 , "count" :0 } ,
1233
+ { "start" :216 , "end" :240 , "count" :2 } ] ) ;
1234
+
1198
1235
% DebugToggleBlockCoverage ( false ) ;
0 commit comments