File tree 2 files changed +72
-1
lines changed
2 files changed +72
-1
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ function getJsxTokens(acorn) {
27
27
const tokTypes = {
28
28
jsxName : new TokenType ( 'jsxName' ) ,
29
29
jsxText : new TokenType ( 'jsxText' , { beforeExpr : true } ) ,
30
- jsxTagStart : new TokenType ( 'jsxTagStart' ) ,
30
+ jsxTagStart : new TokenType ( 'jsxTagStart' , { startsExpr : true } ) ,
31
31
jsxTagEnd : new TokenType ( 'jsxTagEnd' )
32
32
} ;
33
33
Original file line number Diff line number Diff line change @@ -4634,3 +4634,74 @@ test('<A>foo></A>', {
4634
4634
}
4635
4635
]
4636
4636
} ) ;
4637
+ test ( 'function*it(){yield <a></a>}' , {
4638
+ "type" : "Program" ,
4639
+ "start" : 0 ,
4640
+ "end" : 28 ,
4641
+ "body" : [
4642
+ {
4643
+ "type" : "FunctionDeclaration" ,
4644
+ "start" : 0 ,
4645
+ "end" : 28 ,
4646
+ "id" : {
4647
+ "type" : "Identifier" ,
4648
+ "start" : 9 ,
4649
+ "end" : 11 ,
4650
+ "name" : "it"
4651
+ } ,
4652
+ "expression" : false ,
4653
+ "generator" : true ,
4654
+ "async" : false ,
4655
+ "params" : [ ] ,
4656
+ "body" : {
4657
+ "type" : "BlockStatement" ,
4658
+ "start" : 13 ,
4659
+ "end" : 28 ,
4660
+ "body" : [
4661
+ {
4662
+ "type" : "ExpressionStatement" ,
4663
+ "start" : 14 ,
4664
+ "end" : 27 ,
4665
+ "expression" : {
4666
+ "type" : "YieldExpression" ,
4667
+ "start" : 14 ,
4668
+ "end" : 27 ,
4669
+ "delegate" : false ,
4670
+ "argument" : {
4671
+ "type" : "JSXElement" ,
4672
+ "start" : 20 ,
4673
+ "end" : 27 ,
4674
+ "openingElement" : {
4675
+ "type" : "JSXOpeningElement" ,
4676
+ "start" : 20 ,
4677
+ "end" : 23 ,
4678
+ "attributes" : [ ] ,
4679
+ "name" : {
4680
+ "type" : "JSXIdentifier" ,
4681
+ "start" : 21 ,
4682
+ "end" : 22 ,
4683
+ "name" : "a"
4684
+ } ,
4685
+ "selfClosing" : false
4686
+ } ,
4687
+ "closingElement" : {
4688
+ "type" : "JSXClosingElement" ,
4689
+ "start" : 23 ,
4690
+ "end" : 27 ,
4691
+ "name" : {
4692
+ "type" : "JSXIdentifier" ,
4693
+ "start" : 25 ,
4694
+ "end" : 26 ,
4695
+ "name" : "a"
4696
+ }
4697
+ } ,
4698
+ "children" : [ ]
4699
+ }
4700
+ }
4701
+ }
4702
+ ]
4703
+ }
4704
+ }
4705
+ ] ,
4706
+ "sourceType" : "script"
4707
+ } ) ;
You can’t perform that action at this time.
0 commit comments