@@ -333,11 +333,12 @@ function mdxExpression(node, context) {
333
333
/** @type {EstreeProgram } */
334
334
// @ts -expect-error Assume program.
335
335
const estree = node . data && node . data . estree
336
+ const comments = ( estree && estree . comments ) || [ ]
336
337
/** @type {EstreeExpression|undefined } */
337
338
let expression
338
339
339
340
if ( estree ) {
340
- context . comments . push ( ...( estree . comments || [ ] ) )
341
+ context . comments . push ( ...comments )
341
342
attachComments ( estree , estree . comments )
342
343
expression =
343
344
( estree . body [ 0 ] &&
@@ -393,12 +394,15 @@ function mdxJsxElement(node, context) {
393
394
/** @type {EstreeProgram } */
394
395
// @ts -expect-error Assume program.
395
396
const estree = value . data && value . data . estree
397
+ const comments = ( estree && estree . comments ) || [ ]
396
398
/** @type {EstreeExpression|undefined } */
397
399
let expression
398
400
399
401
if ( estree ) {
400
- context . comments . push ( ...( estree . comments || [ ] ) )
402
+ context . comments . push ( ...comments )
401
403
attachComments ( estree , estree . comments )
404
+ // Should exist.
405
+ /* c8 ignore next 5 */
402
406
expression =
403
407
( estree . body [ 0 ] &&
404
408
estree . body [ 0 ] . type === 'ExpressionStatement' &&
@@ -429,12 +433,15 @@ function mdxJsxElement(node, context) {
429
433
/** @type {EstreeProgram } */
430
434
// @ts -expect-error Assume program.
431
435
const estree = attr . data && attr . data . estree
436
+ const comments = ( estree && estree . comments ) || [ ]
432
437
/** @type {EstreeJsxSpreadAttribute['argument']|undefined } */
433
438
let argumentValue
434
439
435
440
if ( estree ) {
436
- context . comments . push ( ...( estree . comments || [ ] ) )
441
+ context . comments . push ( ...comments )
437
442
attachComments ( estree , estree . comments )
443
+ // Should exist.
444
+ /* c8 ignore next 10 */
438
445
argumentValue =
439
446
( estree . body [ 0 ] &&
440
447
estree . body [ 0 ] . type === 'ExpressionStatement' &&
0 commit comments