@@ -294,17 +294,54 @@ test('markdown -> mdast', function (t) {
294
294
value : '...b' ,
295
295
data : {
296
296
estree : {
297
- type : 'SpreadElement' ,
298
- start : 3 ,
299
- end : 7 ,
300
- loc : { start : { line : 1 , column : 3 } , end : { line : 1 , column : 7 } } ,
301
- argument : {
302
- type : 'Identifier' ,
303
- start : 6 ,
304
- end : 7 ,
305
- loc : { start : { line : 1 , column : 6 } , end : { line : 1 , column : 7 } } ,
306
- name : 'b'
307
- }
297
+ type : 'Program' ,
298
+ start : 4 ,
299
+ end : 8 ,
300
+ body : [
301
+ {
302
+ type : 'ExpressionStatement' ,
303
+ expression : {
304
+ type : 'ObjectExpression' ,
305
+ start : 4 ,
306
+ end : 8 ,
307
+ loc : {
308
+ start : { line : 1 , column : 4 } ,
309
+ end : { line : 1 , column : 8 }
310
+ } ,
311
+ properties : [
312
+ {
313
+ type : 'SpreadElement' ,
314
+ start : 4 ,
315
+ end : 8 ,
316
+ loc : {
317
+ start : { line : 1 , column : 4 } ,
318
+ end : { line : 1 , column : 8 }
319
+ } ,
320
+ argument : {
321
+ type : 'Identifier' ,
322
+ start : 7 ,
323
+ end : 8 ,
324
+ loc : {
325
+ start : { line : 1 , column : 7 } ,
326
+ end : { line : 1 , column : 8 }
327
+ } ,
328
+ name : 'b' ,
329
+ range : [ 7 , 8 ]
330
+ } ,
331
+ range : [ 4 , 8 ]
332
+ }
333
+ ] ,
334
+ range : [ 4 , 8 ]
335
+ } ,
336
+ start : 4 ,
337
+ end : 8 ,
338
+ loc : { start : { line : 1 , column : 4 } , end : { line : 1 , column : 8 } } ,
339
+ range : [ 4 , 8 ]
340
+ }
341
+ ] ,
342
+ sourceType : 'module' ,
343
+ loc : { start : { line : 1 , column : 4 } , end : { line : 1 , column : 8 } } ,
344
+ range : [ 4 , 8 ]
308
345
}
309
346
}
310
347
}
@@ -338,12 +375,36 @@ test('markdown -> mdast', function (t) {
338
375
value : '1' ,
339
376
data : {
340
377
estree : {
341
- type : 'Literal' ,
342
- start : 0 ,
343
- end : 1 ,
344
- loc : { start : { line : 1 , column : 0 } , end : { line : 1 , column : 1 } } ,
345
- value : 1 ,
346
- raw : '1'
378
+ type : 'Program' ,
379
+ start : 6 ,
380
+ end : 7 ,
381
+ body : [
382
+ {
383
+ type : 'ExpressionStatement' ,
384
+ expression : {
385
+ type : 'Literal' ,
386
+ start : 6 ,
387
+ end : 7 ,
388
+ loc : {
389
+ start : { line : 1 , column : 6 } ,
390
+ end : { line : 1 , column : 7 }
391
+ } ,
392
+ value : 1 ,
393
+ raw : '1' ,
394
+ range : [ 6 , 7 ]
395
+ } ,
396
+ start : 6 ,
397
+ end : 7 ,
398
+ loc : {
399
+ start : { line : 1 , column : 6 } ,
400
+ end : { line : 1 , column : 7 }
401
+ } ,
402
+ range : [ 6 , 7 ]
403
+ }
404
+ ] ,
405
+ sourceType : 'module' ,
406
+ loc : { start : { line : 1 , column : 6 } , end : { line : 1 , column : 7 } } ,
407
+ range : [ 6 , 7 ]
347
408
}
348
409
}
349
410
}
@@ -361,7 +422,7 @@ test('markdown -> mdast', function (t) {
361
422
mdastExtensions : [ mdxJsx . fromMarkdown ]
362
423
} )
363
424
} ,
364
- / C o u l d n o t p a r s e e x p r e s s i o n w i t h a c o r n : S y n t a x E r r o r : U n e x p e c t e d t o k e n / ,
425
+ / C o u l d n o t p a r s e e x p r e s s i o n w i t h a c o r n : U n e x p e c t e d t o k e n / ,
365
426
'should crash on a non-spread attribute expression'
366
427
)
367
428
@@ -372,7 +433,7 @@ test('markdown -> mdast', function (t) {
372
433
mdastExtensions : [ mdxJsx . fromMarkdown ]
373
434
} )
374
435
} ,
375
- / C o u l d n o t p a r s e e x p r e s s i o n w i t h a c o r n : S y n t a x E r r o r : U n e x p e c t e d t o k e n / ,
436
+ / C o u l d n o t p a r s e e x p r e s s i o n w i t h a c o r n : U n e x p e c t e d t o k e n / ,
376
437
'should crash on invalid JS in an attribute expression'
377
438
)
378
439
0 commit comments