update babylon fixtures to use File as the root node rather than Program
This commit is contained in:
172
test/fixtures/jsx/basic/1/expected.json
vendored
172
test/fixtures/jsx/basic/1/expected.json
vendored
@@ -1,53 +1,45 @@
|
||||
{
|
||||
"type": "Program",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "a",
|
||||
"range": [
|
||||
1,
|
||||
2
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"selfClosing": true,
|
||||
"attributes": [],
|
||||
"range": [
|
||||
0,
|
||||
5
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
}
|
||||
},
|
||||
"closingElement": null,
|
||||
"children": [],
|
||||
"range": [
|
||||
0,
|
||||
5
|
||||
],
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 5,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
5
|
||||
],
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 5,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
5
|
||||
],
|
||||
"sourceType": "script",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 5,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
@@ -57,22 +49,74 @@
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
5
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
"range": [
|
||||
0,
|
||||
5
|
||||
],
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"start": 0,
|
||||
"end": 5,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
5
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 0,
|
||||
"end": 5,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
5
|
||||
],
|
||||
"attributes": [],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 1,
|
||||
"end": 2,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 2
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
2
|
||||
],
|
||||
"name": "a"
|
||||
},
|
||||
"selfClosing": true
|
||||
},
|
||||
"closingElement": null,
|
||||
"children": []
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
364
test/fixtures/jsx/basic/10/expected.json
vendored
364
test/fixtures/jsx/basic/10/expected.json
vendored
@@ -1,122 +1,45 @@
|
||||
{
|
||||
"type": "Program",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "a",
|
||||
"range": [
|
||||
1,
|
||||
2
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"selfClosing": false,
|
||||
"attributes": [],
|
||||
"range": [
|
||||
0,
|
||||
3
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
}
|
||||
}
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "a",
|
||||
"range": [
|
||||
30,
|
||||
31
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 30
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 31
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
28,
|
||||
32
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 28
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 32
|
||||
}
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "JSXExpressionContainer",
|
||||
"expression": {
|
||||
"type": "JSXEmptyExpression",
|
||||
"range": [
|
||||
4,
|
||||
27
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 27
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
3,
|
||||
28
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 28
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"range": [
|
||||
0,
|
||||
32
|
||||
],
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 32
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
32
|
||||
],
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 32
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
32
|
||||
],
|
||||
"sourceType": "script",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
@@ -126,22 +49,197 @@
|
||||
"line": 1,
|
||||
"column": 32
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
32
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 32
|
||||
"range": [
|
||||
0,
|
||||
32
|
||||
],
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"start": 0,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 32
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
32
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 0,
|
||||
"end": 3,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
3
|
||||
],
|
||||
"attributes": [],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 1,
|
||||
"end": 2,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 2
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
2
|
||||
],
|
||||
"name": "a"
|
||||
},
|
||||
"selfClosing": false
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"start": 28,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 28
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 32
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
28,
|
||||
32
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 30,
|
||||
"end": 31,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 30
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 31
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
30,
|
||||
31
|
||||
],
|
||||
"name": "a",
|
||||
"leadingComments": null
|
||||
},
|
||||
"leadingComments": [
|
||||
{
|
||||
"type": "CommentBlock",
|
||||
"value": " this is a comment ",
|
||||
"start": 4,
|
||||
"end": 27,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 27
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
4,
|
||||
27
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "JSXExpressionContainer",
|
||||
"start": 3,
|
||||
"end": 28,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 28
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
3,
|
||||
28
|
||||
],
|
||||
"expression": {
|
||||
"type": "JSXEmptyExpression",
|
||||
"start": 4,
|
||||
"end": 27,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 27
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
4,
|
||||
27
|
||||
],
|
||||
"leadingComments": null,
|
||||
"innerComments": [
|
||||
{
|
||||
"type": "CommentBlock",
|
||||
"value": " this is a comment ",
|
||||
"start": 4,
|
||||
"end": 27,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 27
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
4,
|
||||
27
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
287
test/fixtures/jsx/basic/11/expected.json
vendored
287
test/fixtures/jsx/basic/11/expected.json
vendored
@@ -1,107 +1,45 @@
|
||||
{
|
||||
"type": "Program",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "div",
|
||||
"range": [
|
||||
1,
|
||||
4
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
}
|
||||
},
|
||||
"selfClosing": false,
|
||||
"attributes": [],
|
||||
"range": [
|
||||
0,
|
||||
5
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
}
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "div",
|
||||
"range": [
|
||||
20,
|
||||
23
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 23
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
18,
|
||||
24
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
}
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "Literal",
|
||||
"value": "@test content",
|
||||
"raw": "@test content",
|
||||
"range": [
|
||||
5,
|
||||
18
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"range": [
|
||||
0,
|
||||
24
|
||||
],
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 24,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
24
|
||||
],
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 24,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
24
|
||||
],
|
||||
"sourceType": "script",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 24,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
@@ -111,22 +49,135 @@
|
||||
"line": 1,
|
||||
"column": 24
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
24
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
"range": [
|
||||
0,
|
||||
24
|
||||
],
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"start": 0,
|
||||
"end": 24,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
24
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 0,
|
||||
"end": 5,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
5
|
||||
],
|
||||
"attributes": [],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 1,
|
||||
"end": 4,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
4
|
||||
],
|
||||
"name": "div"
|
||||
},
|
||||
"selfClosing": false
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"start": 18,
|
||||
"end": 24,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
18,
|
||||
24
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 20,
|
||||
"end": 23,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 23
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
20,
|
||||
23
|
||||
],
|
||||
"name": "div"
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "Literal",
|
||||
"start": 5,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
18
|
||||
],
|
||||
"value": "@test content",
|
||||
"rawValue": "@test content",
|
||||
"raw": "@test content"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
405
test/fixtures/jsx/basic/12/expected.json
vendored
405
test/fixtures/jsx/basic/12/expected.json
vendored
@@ -1,163 +1,45 @@
|
||||
{
|
||||
"type": "Program",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "div",
|
||||
"range": [
|
||||
1,
|
||||
4
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
}
|
||||
},
|
||||
"selfClosing": false,
|
||||
"attributes": [],
|
||||
"range": [
|
||||
0,
|
||||
5
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
}
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "div",
|
||||
"range": [
|
||||
37,
|
||||
40
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 37
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 40
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
35,
|
||||
41
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 35
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 41
|
||||
}
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "JSXElement",
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "br",
|
||||
"range": [
|
||||
6,
|
||||
8
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
}
|
||||
},
|
||||
"selfClosing": true,
|
||||
"attributes": [],
|
||||
"range": [
|
||||
5,
|
||||
11
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
}
|
||||
}
|
||||
},
|
||||
"closingElement": null,
|
||||
"children": [],
|
||||
"range": [
|
||||
5,
|
||||
11
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Literal",
|
||||
"value": "7x invalid-js-identifier",
|
||||
"raw": "7x invalid-js-identifier",
|
||||
"range": [
|
||||
11,
|
||||
35
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 35
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"range": [
|
||||
0,
|
||||
41
|
||||
],
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 41,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 41
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
41
|
||||
],
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 41,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 41
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
41
|
||||
],
|
||||
"sourceType": "script",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 41,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
@@ -167,22 +49,197 @@
|
||||
"line": 1,
|
||||
"column": 41
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
41
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 41
|
||||
"range": [
|
||||
0,
|
||||
41
|
||||
],
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"start": 0,
|
||||
"end": 41,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 41
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
41
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 0,
|
||||
"end": 5,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
5
|
||||
],
|
||||
"attributes": [],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 1,
|
||||
"end": 4,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
4
|
||||
],
|
||||
"name": "div"
|
||||
},
|
||||
"selfClosing": false
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"start": 35,
|
||||
"end": 41,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 35
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 41
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
35,
|
||||
41
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 37,
|
||||
"end": 40,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 37
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 40
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
37,
|
||||
40
|
||||
],
|
||||
"name": "div"
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "JSXElement",
|
||||
"start": 5,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
11
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 5,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
11
|
||||
],
|
||||
"attributes": [],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 6,
|
||||
"end": 8,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
6,
|
||||
8
|
||||
],
|
||||
"name": "br"
|
||||
},
|
||||
"selfClosing": true
|
||||
},
|
||||
"closingElement": null,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"type": "Literal",
|
||||
"start": 11,
|
||||
"end": 35,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 35
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
11,
|
||||
35
|
||||
],
|
||||
"value": "7x invalid-js-identifier",
|
||||
"rawValue": "7x invalid-js-identifier",
|
||||
"raw": "7x invalid-js-identifier"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
673
test/fixtures/jsx/basic/13/expected.json
vendored
673
test/fixtures/jsx/basic/13/expected.json
vendored
@@ -1,290 +1,45 @@
|
||||
{
|
||||
"type": "Program",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "LeftRight",
|
||||
"range": [
|
||||
1,
|
||||
10
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
}
|
||||
}
|
||||
},
|
||||
"selfClosing": true,
|
||||
"attributes": [
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "left",
|
||||
"range": [
|
||||
11,
|
||||
15
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
}
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"type": "JSXElement",
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "a",
|
||||
"range": [
|
||||
17,
|
||||
18
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
}
|
||||
},
|
||||
"selfClosing": true,
|
||||
"attributes": [],
|
||||
"range": [
|
||||
16,
|
||||
21
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
}
|
||||
}
|
||||
},
|
||||
"closingElement": null,
|
||||
"children": [],
|
||||
"range": [
|
||||
16,
|
||||
21
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
11,
|
||||
21
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "right",
|
||||
"range": [
|
||||
22,
|
||||
27
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 27
|
||||
}
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"type": "JSXElement",
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "b",
|
||||
"range": [
|
||||
29,
|
||||
30
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 29
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 30
|
||||
}
|
||||
}
|
||||
},
|
||||
"selfClosing": false,
|
||||
"attributes": [],
|
||||
"range": [
|
||||
28,
|
||||
31
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 28
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 31
|
||||
}
|
||||
}
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "b",
|
||||
"range": [
|
||||
52,
|
||||
53
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 52
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 53
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
50,
|
||||
54
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 50
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 54
|
||||
}
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "Literal",
|
||||
"value": "monkeys /> gorillas",
|
||||
"raw": "monkeys /> gorillas",
|
||||
"range": [
|
||||
31,
|
||||
50
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 31
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 50
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"range": [
|
||||
28,
|
||||
54
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 28
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 54
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
22,
|
||||
54
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 54
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"range": [
|
||||
0,
|
||||
57
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 57
|
||||
}
|
||||
}
|
||||
},
|
||||
"closingElement": null,
|
||||
"children": [],
|
||||
"range": [
|
||||
0,
|
||||
57
|
||||
],
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 57,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 57
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
57
|
||||
],
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 57,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 57
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
57
|
||||
],
|
||||
"sourceType": "script",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 57,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
@@ -294,22 +49,338 @@
|
||||
"line": 1,
|
||||
"column": 57
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
57
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 57
|
||||
"range": [
|
||||
0,
|
||||
57
|
||||
],
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"start": 0,
|
||||
"end": 57,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 57
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
57
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 0,
|
||||
"end": 57,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 57
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
57
|
||||
],
|
||||
"attributes": [
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"start": 11,
|
||||
"end": 21,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
11,
|
||||
21
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 11,
|
||||
"end": 15,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
11,
|
||||
15
|
||||
],
|
||||
"name": "left"
|
||||
},
|
||||
"value": {
|
||||
"type": "JSXElement",
|
||||
"start": 16,
|
||||
"end": 21,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
16,
|
||||
21
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 16,
|
||||
"end": 21,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
16,
|
||||
21
|
||||
],
|
||||
"attributes": [],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 17,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
17,
|
||||
18
|
||||
],
|
||||
"name": "a"
|
||||
},
|
||||
"selfClosing": true
|
||||
},
|
||||
"closingElement": null,
|
||||
"children": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"start": 22,
|
||||
"end": 54,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 54
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
22,
|
||||
54
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 22,
|
||||
"end": 27,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 27
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
22,
|
||||
27
|
||||
],
|
||||
"name": "right"
|
||||
},
|
||||
"value": {
|
||||
"type": "JSXElement",
|
||||
"start": 28,
|
||||
"end": 54,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 28
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 54
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
28,
|
||||
54
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 28,
|
||||
"end": 31,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 28
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 31
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
28,
|
||||
31
|
||||
],
|
||||
"attributes": [],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 29,
|
||||
"end": 30,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 29
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 30
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
29,
|
||||
30
|
||||
],
|
||||
"name": "b"
|
||||
},
|
||||
"selfClosing": false
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"start": 50,
|
||||
"end": 54,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 50
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 54
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
50,
|
||||
54
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 52,
|
||||
"end": 53,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 52
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 53
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
52,
|
||||
53
|
||||
],
|
||||
"name": "b"
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "Literal",
|
||||
"start": 31,
|
||||
"end": 50,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 31
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 50
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
31,
|
||||
50
|
||||
],
|
||||
"value": "monkeys /> gorillas",
|
||||
"rawValue": "monkeys /> gorillas",
|
||||
"raw": "monkeys /> gorillas"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 1,
|
||||
"end": 10,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
10
|
||||
],
|
||||
"name": "LeftRight"
|
||||
},
|
||||
"selfClosing": true
|
||||
},
|
||||
"closingElement": null,
|
||||
"children": []
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
392
test/fixtures/jsx/basic/14/expected.json
vendored
392
test/fixtures/jsx/basic/14/expected.json
vendored
@@ -1,157 +1,45 @@
|
||||
{
|
||||
"type": "Program",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"name": {
|
||||
"type": "JSXMemberExpression",
|
||||
"object": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "a",
|
||||
"range": [
|
||||
1,
|
||||
2
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"property": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "b",
|
||||
"range": [
|
||||
3,
|
||||
4
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
4
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
}
|
||||
},
|
||||
"selfClosing": false,
|
||||
"attributes": [],
|
||||
"range": [
|
||||
0,
|
||||
5
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
}
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"name": {
|
||||
"type": "JSXMemberExpression",
|
||||
"object": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "a",
|
||||
"range": [
|
||||
7,
|
||||
8
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
}
|
||||
},
|
||||
"property": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "b",
|
||||
"range": [
|
||||
9,
|
||||
10
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
7,
|
||||
10
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
11
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
}
|
||||
}
|
||||
},
|
||||
"children": [],
|
||||
"range": [
|
||||
0,
|
||||
11
|
||||
],
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
11
|
||||
],
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
11
|
||||
],
|
||||
"sourceType": "script",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
@@ -161,22 +49,190 @@
|
||||
"line": 1,
|
||||
"column": 11
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
11
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
"range": [
|
||||
0,
|
||||
11
|
||||
],
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"start": 0,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
11
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 0,
|
||||
"end": 5,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
5
|
||||
],
|
||||
"attributes": [],
|
||||
"name": {
|
||||
"type": "JSXMemberExpression",
|
||||
"start": 1,
|
||||
"end": 4,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
4
|
||||
],
|
||||
"object": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 1,
|
||||
"end": 2,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 2
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
2
|
||||
],
|
||||
"name": "a"
|
||||
},
|
||||
"property": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 3,
|
||||
"end": 4,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
3,
|
||||
4
|
||||
],
|
||||
"name": "b"
|
||||
}
|
||||
},
|
||||
"selfClosing": false
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"start": 5,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
11
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXMemberExpression",
|
||||
"start": 7,
|
||||
"end": 10,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
7,
|
||||
10
|
||||
],
|
||||
"object": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 7,
|
||||
"end": 8,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
7,
|
||||
8
|
||||
],
|
||||
"name": "a"
|
||||
},
|
||||
"property": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 9,
|
||||
"end": 10,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
9,
|
||||
10
|
||||
],
|
||||
"name": "b"
|
||||
}
|
||||
}
|
||||
},
|
||||
"children": []
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
540
test/fixtures/jsx/basic/15/expected.json
vendored
540
test/fixtures/jsx/basic/15/expected.json
vendored
@@ -1,227 +1,45 @@
|
||||
{
|
||||
"type": "Program",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"name": {
|
||||
"type": "JSXMemberExpression",
|
||||
"object": {
|
||||
"type": "JSXMemberExpression",
|
||||
"object": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "a",
|
||||
"range": [
|
||||
1,
|
||||
2
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"property": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "b",
|
||||
"range": [
|
||||
3,
|
||||
4
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
4
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
}
|
||||
},
|
||||
"property": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "c",
|
||||
"range": [
|
||||
5,
|
||||
6
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 6
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
6
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 6
|
||||
}
|
||||
}
|
||||
},
|
||||
"selfClosing": false,
|
||||
"attributes": [],
|
||||
"range": [
|
||||
0,
|
||||
7
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
}
|
||||
}
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"name": {
|
||||
"type": "JSXMemberExpression",
|
||||
"object": {
|
||||
"type": "JSXMemberExpression",
|
||||
"object": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "a",
|
||||
"range": [
|
||||
9,
|
||||
10
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
}
|
||||
}
|
||||
},
|
||||
"property": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "b",
|
||||
"range": [
|
||||
11,
|
||||
12
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
9,
|
||||
12
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
}
|
||||
}
|
||||
},
|
||||
"property": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "c",
|
||||
"range": [
|
||||
13,
|
||||
14
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 13
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
9,
|
||||
14
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
7,
|
||||
15
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
}
|
||||
}
|
||||
},
|
||||
"children": [],
|
||||
"range": [
|
||||
0,
|
||||
15
|
||||
],
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 15,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
15
|
||||
],
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 15,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
15
|
||||
],
|
||||
"sourceType": "script",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 15,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
@@ -231,22 +49,268 @@
|
||||
"line": 1,
|
||||
"column": 15
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
15
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
"range": [
|
||||
0,
|
||||
15
|
||||
],
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"start": 0,
|
||||
"end": 15,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
15
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 0,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
7
|
||||
],
|
||||
"attributes": [],
|
||||
"name": {
|
||||
"type": "JSXMemberExpression",
|
||||
"start": 1,
|
||||
"end": 6,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 6
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
6
|
||||
],
|
||||
"object": {
|
||||
"type": "JSXMemberExpression",
|
||||
"start": 1,
|
||||
"end": 4,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
4
|
||||
],
|
||||
"object": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 1,
|
||||
"end": 2,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 2
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
2
|
||||
],
|
||||
"name": "a"
|
||||
},
|
||||
"property": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 3,
|
||||
"end": 4,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
3,
|
||||
4
|
||||
],
|
||||
"name": "b"
|
||||
}
|
||||
},
|
||||
"property": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 5,
|
||||
"end": 6,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 6
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
6
|
||||
],
|
||||
"name": "c"
|
||||
}
|
||||
},
|
||||
"selfClosing": false
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"start": 7,
|
||||
"end": 15,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
7,
|
||||
15
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXMemberExpression",
|
||||
"start": 9,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
9,
|
||||
14
|
||||
],
|
||||
"object": {
|
||||
"type": "JSXMemberExpression",
|
||||
"start": 9,
|
||||
"end": 12,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
9,
|
||||
12
|
||||
],
|
||||
"object": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 9,
|
||||
"end": 10,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
9,
|
||||
10
|
||||
],
|
||||
"name": "a"
|
||||
},
|
||||
"property": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 11,
|
||||
"end": 12,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
11,
|
||||
12
|
||||
],
|
||||
"name": "b"
|
||||
}
|
||||
},
|
||||
"property": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 13,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 13
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
13,
|
||||
14
|
||||
],
|
||||
"name": "c"
|
||||
}
|
||||
}
|
||||
},
|
||||
"children": []
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
241
test/fixtures/jsx/basic/16/expected.json
vendored
241
test/fixtures/jsx/basic/16/expected.json
vendored
@@ -1,39 +1,81 @@
|
||||
{
|
||||
"type": "Program",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": {
|
||||
"type": "BinaryExpression",
|
||||
"operator": "<",
|
||||
"left": {
|
||||
"type": "JSXElement",
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "div",
|
||||
"range": [
|
||||
2,
|
||||
5
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 2
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
}
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
14
|
||||
],
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
14
|
||||
],
|
||||
"sourceType": "script",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
14
|
||||
],
|
||||
"expression": {
|
||||
"type": "BinaryExpression",
|
||||
"start": 0,
|
||||
"end": 13,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"selfClosing": true,
|
||||
"attributes": [],
|
||||
"range": [
|
||||
1,
|
||||
8
|
||||
],
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 13
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
13
|
||||
],
|
||||
"left": {
|
||||
"type": "JSXElement",
|
||||
"start": 1,
|
||||
"end": 8,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
@@ -43,72 +85,79 @@
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
}
|
||||
},
|
||||
"closingElement": null,
|
||||
"children": [],
|
||||
"range": [
|
||||
1,
|
||||
8
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
}
|
||||
},
|
||||
"right": {
|
||||
"type": "Identifier",
|
||||
"name": "x",
|
||||
"range": [
|
||||
12,
|
||||
13
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
"range": [
|
||||
1,
|
||||
8
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 1,
|
||||
"end": 8,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
8
|
||||
],
|
||||
"attributes": [],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 2,
|
||||
"end": 5,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 2
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
2,
|
||||
5
|
||||
],
|
||||
"name": "div"
|
||||
},
|
||||
"selfClosing": true
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 13
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
13
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
"closingElement": null,
|
||||
"children": [],
|
||||
"parenthesizedExpression": true
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 13
|
||||
"operator": "<",
|
||||
"right": {
|
||||
"type": "Identifier",
|
||||
"start": 12,
|
||||
"end": 13,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 13
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
12,
|
||||
13
|
||||
],
|
||||
"name": "x"
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
14
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
248
test/fixtures/jsx/basic/17/expected.json
vendored
248
test/fixtures/jsx/basic/17/expected.json
vendored
@@ -1,89 +1,45 @@
|
||||
{
|
||||
"type": "Program",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "div",
|
||||
"range": [
|
||||
1,
|
||||
4
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
}
|
||||
},
|
||||
"selfClosing": true,
|
||||
"attributes": [
|
||||
{
|
||||
"type": "JSXSpreadAttribute",
|
||||
"argument": {
|
||||
"type": "Identifier",
|
||||
"name": "props",
|
||||
"range": [
|
||||
9,
|
||||
14
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
15
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"range": [
|
||||
0,
|
||||
18
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
}
|
||||
},
|
||||
"closingElement": null,
|
||||
"children": [],
|
||||
"range": [
|
||||
0,
|
||||
18
|
||||
],
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
18
|
||||
],
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
18
|
||||
],
|
||||
"sourceType": "script",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
@@ -93,22 +49,114 @@
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
18
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
"range": [
|
||||
0,
|
||||
18
|
||||
],
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"start": 0,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
18
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 0,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
18
|
||||
],
|
||||
"attributes": [
|
||||
{
|
||||
"type": "JSXSpreadAttribute",
|
||||
"start": 5,
|
||||
"end": 15,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
15
|
||||
],
|
||||
"argument": {
|
||||
"type": "Identifier",
|
||||
"start": 9,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
9,
|
||||
14
|
||||
],
|
||||
"name": "props"
|
||||
}
|
||||
}
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 1,
|
||||
"end": 4,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
4
|
||||
],
|
||||
"name": "div"
|
||||
},
|
||||
"selfClosing": true
|
||||
},
|
||||
"closingElement": null,
|
||||
"children": []
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
363
test/fixtures/jsx/basic/18/expected.json
vendored
363
test/fixtures/jsx/basic/18/expected.json
vendored
@@ -1,143 +1,45 @@
|
||||
{
|
||||
"type": "Program",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "div",
|
||||
"range": [
|
||||
1,
|
||||
4
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
}
|
||||
},
|
||||
"selfClosing": true,
|
||||
"attributes": [
|
||||
{
|
||||
"type": "JSXSpreadAttribute",
|
||||
"argument": {
|
||||
"type": "Identifier",
|
||||
"name": "props",
|
||||
"range": [
|
||||
9,
|
||||
14
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
15
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "post",
|
||||
"range": [
|
||||
16,
|
||||
20
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
}
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"value": "attribute",
|
||||
"raw": "\"attribute\"",
|
||||
"range": [
|
||||
21,
|
||||
32
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 32
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
16,
|
||||
32
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 32
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"range": [
|
||||
0,
|
||||
35
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 35
|
||||
}
|
||||
}
|
||||
},
|
||||
"closingElement": null,
|
||||
"children": [],
|
||||
"range": [
|
||||
0,
|
||||
35
|
||||
],
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 35,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 35
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
35
|
||||
],
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 35,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 35
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
35
|
||||
],
|
||||
"sourceType": "script",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 35,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
@@ -147,22 +49,175 @@
|
||||
"line": 1,
|
||||
"column": 35
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
35
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 35
|
||||
"range": [
|
||||
0,
|
||||
35
|
||||
],
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"start": 0,
|
||||
"end": 35,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 35
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
35
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 0,
|
||||
"end": 35,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 35
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
35
|
||||
],
|
||||
"attributes": [
|
||||
{
|
||||
"type": "JSXSpreadAttribute",
|
||||
"start": 5,
|
||||
"end": 15,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
15
|
||||
],
|
||||
"argument": {
|
||||
"type": "Identifier",
|
||||
"start": 9,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
9,
|
||||
14
|
||||
],
|
||||
"name": "props"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"start": 16,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 32
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
16,
|
||||
32
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 16,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
16,
|
||||
20
|
||||
],
|
||||
"name": "post"
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"start": 21,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 32
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
21,
|
||||
32
|
||||
],
|
||||
"value": "attribute",
|
||||
"rawValue": "attribute",
|
||||
"raw": "\"attribute\""
|
||||
}
|
||||
}
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 1,
|
||||
"end": 4,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
4
|
||||
],
|
||||
"name": "div"
|
||||
},
|
||||
"selfClosing": true
|
||||
},
|
||||
"closingElement": null,
|
||||
"children": []
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
550
test/fixtures/jsx/basic/19/expected.json
vendored
550
test/fixtures/jsx/basic/19/expected.json
vendored
@@ -1,231 +1,45 @@
|
||||
{
|
||||
"type": "Program",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "div",
|
||||
"range": [
|
||||
1,
|
||||
4
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
}
|
||||
},
|
||||
"selfClosing": false,
|
||||
"attributes": [
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "pre",
|
||||
"range": [
|
||||
5,
|
||||
8
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"value": "leading",
|
||||
"raw": "\"leading\"",
|
||||
"range": [
|
||||
9,
|
||||
18
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
18
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "pre2",
|
||||
"range": [
|
||||
19,
|
||||
23
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 23
|
||||
}
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"value": "attribute",
|
||||
"raw": "\"attribute\"",
|
||||
"range": [
|
||||
24,
|
||||
35
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 35
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
19,
|
||||
35
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 35
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "JSXSpreadAttribute",
|
||||
"argument": {
|
||||
"type": "Identifier",
|
||||
"name": "props",
|
||||
"range": [
|
||||
40,
|
||||
45
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 40
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 45
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
36,
|
||||
46
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 36
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 46
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"range": [
|
||||
0,
|
||||
47
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 47
|
||||
}
|
||||
}
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "div",
|
||||
"range": [
|
||||
49,
|
||||
52
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 49
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 52
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
47,
|
||||
53
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 47
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 53
|
||||
}
|
||||
}
|
||||
},
|
||||
"children": [],
|
||||
"range": [
|
||||
0,
|
||||
53
|
||||
],
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 53,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 53
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
53
|
||||
],
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 53,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 53
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
53
|
||||
],
|
||||
"sourceType": "script",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 53,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
@@ -235,22 +49,274 @@
|
||||
"line": 1,
|
||||
"column": 53
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
53
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 53
|
||||
"range": [
|
||||
0,
|
||||
53
|
||||
],
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"start": 0,
|
||||
"end": 53,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 53
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
53
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 0,
|
||||
"end": 47,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 47
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
47
|
||||
],
|
||||
"attributes": [
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"start": 5,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
18
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 5,
|
||||
"end": 8,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
8
|
||||
],
|
||||
"name": "pre"
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"start": 9,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
9,
|
||||
18
|
||||
],
|
||||
"value": "leading",
|
||||
"rawValue": "leading",
|
||||
"raw": "\"leading\""
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"start": 19,
|
||||
"end": 35,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 35
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
19,
|
||||
35
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 19,
|
||||
"end": 23,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 23
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
19,
|
||||
23
|
||||
],
|
||||
"name": "pre2"
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"start": 24,
|
||||
"end": 35,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 35
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
24,
|
||||
35
|
||||
],
|
||||
"value": "attribute",
|
||||
"rawValue": "attribute",
|
||||
"raw": "\"attribute\""
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "JSXSpreadAttribute",
|
||||
"start": 36,
|
||||
"end": 46,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 36
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 46
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
36,
|
||||
46
|
||||
],
|
||||
"argument": {
|
||||
"type": "Identifier",
|
||||
"start": 40,
|
||||
"end": 45,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 40
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 45
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
40,
|
||||
45
|
||||
],
|
||||
"name": "props"
|
||||
}
|
||||
}
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 1,
|
||||
"end": 4,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
4
|
||||
],
|
||||
"name": "div"
|
||||
},
|
||||
"selfClosing": false
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"start": 47,
|
||||
"end": 53,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 47
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 53
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
47,
|
||||
53
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 49,
|
||||
"end": 52,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 49
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 52
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
49,
|
||||
52
|
||||
],
|
||||
"name": "div"
|
||||
}
|
||||
},
|
||||
"children": []
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
398
test/fixtures/jsx/basic/2/expected.json
vendored
398
test/fixtures/jsx/basic/2/expected.json
vendored
@@ -1,160 +1,45 @@
|
||||
{
|
||||
"type": "Program",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"name": {
|
||||
"type": "JSXNamespacedName",
|
||||
"namespace": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "n",
|
||||
"range": [
|
||||
1,
|
||||
2
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "a",
|
||||
"range": [
|
||||
3,
|
||||
4
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
4
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
}
|
||||
},
|
||||
"selfClosing": true,
|
||||
"attributes": [
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"name": {
|
||||
"type": "JSXNamespacedName",
|
||||
"namespace": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "n",
|
||||
"range": [
|
||||
5,
|
||||
6
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 6
|
||||
}
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "v",
|
||||
"range": [
|
||||
7,
|
||||
8
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
8
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"range": [
|
||||
5,
|
||||
8
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"range": [
|
||||
0,
|
||||
11
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
}
|
||||
}
|
||||
},
|
||||
"closingElement": null,
|
||||
"children": [],
|
||||
"range": [
|
||||
0,
|
||||
11
|
||||
],
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
11
|
||||
],
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
11
|
||||
],
|
||||
"sourceType": "script",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
@@ -164,22 +49,193 @@
|
||||
"line": 1,
|
||||
"column": 11
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
11
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
"range": [
|
||||
0,
|
||||
11
|
||||
],
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"start": 0,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
11
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 0,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
11
|
||||
],
|
||||
"attributes": [
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"start": 5,
|
||||
"end": 8,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
8
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXNamespacedName",
|
||||
"start": 5,
|
||||
"end": 8,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
8
|
||||
],
|
||||
"namespace": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 5,
|
||||
"end": 6,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 6
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
6
|
||||
],
|
||||
"name": "n"
|
||||
},
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 7,
|
||||
"end": 8,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
7,
|
||||
8
|
||||
],
|
||||
"name": "v"
|
||||
}
|
||||
},
|
||||
"value": null
|
||||
}
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXNamespacedName",
|
||||
"start": 1,
|
||||
"end": 4,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
4
|
||||
],
|
||||
"namespace": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 1,
|
||||
"end": 2,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 2
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
2
|
||||
],
|
||||
"name": "n"
|
||||
},
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 3,
|
||||
"end": 4,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
3,
|
||||
4
|
||||
],
|
||||
"name": "a"
|
||||
}
|
||||
},
|
||||
"selfClosing": true
|
||||
},
|
||||
"closingElement": null,
|
||||
"children": []
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
862
test/fixtures/jsx/basic/20/expected.json
vendored
862
test/fixtures/jsx/basic/20/expected.json
vendored
File diff suppressed because it is too large
Load Diff
903
test/fixtures/jsx/basic/3/expected.json
vendored
903
test/fixtures/jsx/basic/3/expected.json
vendored
@@ -1,398 +1,45 @@
|
||||
{
|
||||
"type": "Program",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "a",
|
||||
"range": [
|
||||
1,
|
||||
2
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"selfClosing": false,
|
||||
"attributes": [
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"name": {
|
||||
"type": "JSXNamespacedName",
|
||||
"namespace": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "n",
|
||||
"range": [
|
||||
3,
|
||||
4
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "foo",
|
||||
"range": [
|
||||
5,
|
||||
8
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
3,
|
||||
8
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"value": "bar",
|
||||
"raw": "\"bar\"",
|
||||
"range": [
|
||||
9,
|
||||
14
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
3,
|
||||
14
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"range": [
|
||||
0,
|
||||
15
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
}
|
||||
}
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "a",
|
||||
"range": [
|
||||
38,
|
||||
39
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 38
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 39
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
36,
|
||||
40
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 36
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 40
|
||||
}
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "Literal",
|
||||
"value": " ",
|
||||
"raw": " ",
|
||||
"range": [
|
||||
15,
|
||||
16
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "JSXExpressionContainer",
|
||||
"expression": {
|
||||
"type": "Identifier",
|
||||
"name": "value",
|
||||
"range": [
|
||||
17,
|
||||
22
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
16,
|
||||
23
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 23
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Literal",
|
||||
"value": " ",
|
||||
"raw": " ",
|
||||
"range": [
|
||||
23,
|
||||
24
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 23
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "JSXElement",
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "b",
|
||||
"range": [
|
||||
25,
|
||||
26
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 25
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 26
|
||||
}
|
||||
}
|
||||
},
|
||||
"selfClosing": false,
|
||||
"attributes": [],
|
||||
"range": [
|
||||
24,
|
||||
27
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 27
|
||||
}
|
||||
}
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "b",
|
||||
"range": [
|
||||
34,
|
||||
35
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 34
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 35
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
32,
|
||||
36
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 32
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 36
|
||||
}
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "JSXElement",
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "c",
|
||||
"range": [
|
||||
28,
|
||||
29
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 28
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 29
|
||||
}
|
||||
}
|
||||
},
|
||||
"selfClosing": true,
|
||||
"attributes": [],
|
||||
"range": [
|
||||
27,
|
||||
32
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 27
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 32
|
||||
}
|
||||
}
|
||||
},
|
||||
"closingElement": null,
|
||||
"children": [],
|
||||
"range": [
|
||||
27,
|
||||
32
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 27
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 32
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"range": [
|
||||
24,
|
||||
36
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 36
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"range": [
|
||||
0,
|
||||
40
|
||||
],
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 40,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 40
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
40
|
||||
],
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 40,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 40
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
40
|
||||
],
|
||||
"sourceType": "script",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 40,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
@@ -402,22 +49,460 @@
|
||||
"line": 1,
|
||||
"column": 40
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
40
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 40
|
||||
"range": [
|
||||
0,
|
||||
40
|
||||
],
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"start": 0,
|
||||
"end": 40,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 40
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
40
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 0,
|
||||
"end": 15,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
15
|
||||
],
|
||||
"attributes": [
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"start": 3,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
3,
|
||||
14
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXNamespacedName",
|
||||
"start": 3,
|
||||
"end": 8,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
3,
|
||||
8
|
||||
],
|
||||
"namespace": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 3,
|
||||
"end": 4,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
3,
|
||||
4
|
||||
],
|
||||
"name": "n"
|
||||
},
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 5,
|
||||
"end": 8,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
8
|
||||
],
|
||||
"name": "foo"
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"start": 9,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
9,
|
||||
14
|
||||
],
|
||||
"value": "bar",
|
||||
"rawValue": "bar",
|
||||
"raw": "\"bar\""
|
||||
}
|
||||
}
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 1,
|
||||
"end": 2,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 2
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
2
|
||||
],
|
||||
"name": "a"
|
||||
},
|
||||
"selfClosing": false
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"start": 36,
|
||||
"end": 40,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 36
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 40
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
36,
|
||||
40
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 38,
|
||||
"end": 39,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 38
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 39
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
38,
|
||||
39
|
||||
],
|
||||
"name": "a"
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "Literal",
|
||||
"start": 15,
|
||||
"end": 16,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
15,
|
||||
16
|
||||
],
|
||||
"value": " ",
|
||||
"rawValue": " ",
|
||||
"raw": " "
|
||||
},
|
||||
{
|
||||
"type": "JSXExpressionContainer",
|
||||
"start": 16,
|
||||
"end": 23,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 23
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
16,
|
||||
23
|
||||
],
|
||||
"expression": {
|
||||
"type": "Identifier",
|
||||
"start": 17,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
17,
|
||||
22
|
||||
],
|
||||
"name": "value"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Literal",
|
||||
"start": 23,
|
||||
"end": 24,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 23
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
23,
|
||||
24
|
||||
],
|
||||
"value": " ",
|
||||
"rawValue": " ",
|
||||
"raw": " "
|
||||
},
|
||||
{
|
||||
"type": "JSXElement",
|
||||
"start": 24,
|
||||
"end": 36,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 36
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
24,
|
||||
36
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 24,
|
||||
"end": 27,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 27
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
24,
|
||||
27
|
||||
],
|
||||
"attributes": [],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 25,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 25
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 26
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
25,
|
||||
26
|
||||
],
|
||||
"name": "b"
|
||||
},
|
||||
"selfClosing": false
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"start": 32,
|
||||
"end": 36,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 32
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 36
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
32,
|
||||
36
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 34,
|
||||
"end": 35,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 34
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 35
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
34,
|
||||
35
|
||||
],
|
||||
"name": "b"
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "JSXElement",
|
||||
"start": 27,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 27
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 32
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
27,
|
||||
32
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 27,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 27
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 32
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
27,
|
||||
32
|
||||
],
|
||||
"attributes": [],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 28,
|
||||
"end": 29,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 28
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 29
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
28,
|
||||
29
|
||||
],
|
||||
"name": "c"
|
||||
},
|
||||
"selfClosing": true
|
||||
},
|
||||
"closingElement": null,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
514
test/fixtures/jsx/basic/4/expected.json
vendored
514
test/fixtures/jsx/basic/4/expected.json
vendored
@@ -1,142 +1,386 @@
|
||||
{
|
||||
"type": "Program",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "a",
|
||||
"range": [
|
||||
1,
|
||||
2
|
||||
]
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 40,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 40
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
40
|
||||
],
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 40,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 40
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
40
|
||||
],
|
||||
"sourceType": "script",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 40,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"selfClosing": true,
|
||||
"attributes": [
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "b",
|
||||
"range": [
|
||||
3,
|
||||
4
|
||||
]
|
||||
},
|
||||
"value": {
|
||||
"type": "JSXExpressionContainer",
|
||||
"expression": {
|
||||
"type": "Literal",
|
||||
"value": " ",
|
||||
"raw": "\" \"",
|
||||
"range": [
|
||||
6,
|
||||
9
|
||||
]
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
10
|
||||
]
|
||||
},
|
||||
"range": [
|
||||
3,
|
||||
10
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "c",
|
||||
"range": [
|
||||
11,
|
||||
12
|
||||
]
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"value": " ",
|
||||
"raw": "\" \"",
|
||||
"range": [
|
||||
13,
|
||||
16
|
||||
]
|
||||
},
|
||||
"range": [
|
||||
11,
|
||||
16
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "d",
|
||||
"range": [
|
||||
17,
|
||||
18
|
||||
]
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"value": "&",
|
||||
"raw": "\"&\"",
|
||||
"range": [
|
||||
19,
|
||||
26
|
||||
]
|
||||
},
|
||||
"range": [
|
||||
17,
|
||||
26
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "e",
|
||||
"range": [
|
||||
27,
|
||||
28
|
||||
]
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"value": "&r;",
|
||||
"raw": "\"&r;\"",
|
||||
"range": [
|
||||
29,
|
||||
37
|
||||
]
|
||||
},
|
||||
"range": [
|
||||
27,
|
||||
37
|
||||
]
|
||||
}
|
||||
],
|
||||
"range": [
|
||||
0,
|
||||
40
|
||||
]
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 40
|
||||
}
|
||||
},
|
||||
"closingElement": null,
|
||||
"children": [],
|
||||
"range": [
|
||||
0,
|
||||
40
|
||||
]
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
40
|
||||
]
|
||||
}
|
||||
]
|
||||
],
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"start": 0,
|
||||
"end": 40,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 40
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
40
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 0,
|
||||
"end": 40,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 40
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
40
|
||||
],
|
||||
"attributes": [
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"start": 3,
|
||||
"end": 10,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
3,
|
||||
10
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 3,
|
||||
"end": 4,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
3,
|
||||
4
|
||||
],
|
||||
"name": "b"
|
||||
},
|
||||
"value": {
|
||||
"type": "JSXExpressionContainer",
|
||||
"start": 5,
|
||||
"end": 10,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
10
|
||||
],
|
||||
"expression": {
|
||||
"type": "Literal",
|
||||
"start": 6,
|
||||
"end": 9,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
6,
|
||||
9
|
||||
],
|
||||
"value": " ",
|
||||
"rawValue": " ",
|
||||
"raw": "\" \""
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"start": 11,
|
||||
"end": 16,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
11,
|
||||
16
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 11,
|
||||
"end": 12,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
11,
|
||||
12
|
||||
],
|
||||
"name": "c"
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"start": 13,
|
||||
"end": 16,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 13
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
13,
|
||||
16
|
||||
],
|
||||
"value": " ",
|
||||
"rawValue": " ",
|
||||
"raw": "\" \""
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"start": 17,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 26
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
17,
|
||||
26
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 17,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
17,
|
||||
18
|
||||
],
|
||||
"name": "d"
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"start": 19,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 26
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
19,
|
||||
26
|
||||
],
|
||||
"value": "&",
|
||||
"rawValue": "&",
|
||||
"raw": "\"&\""
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"start": 27,
|
||||
"end": 37,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 27
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 37
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
27,
|
||||
37
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 27,
|
||||
"end": 28,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 27
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 28
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
27,
|
||||
28
|
||||
],
|
||||
"name": "e"
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"start": 29,
|
||||
"end": 37,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 29
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 37
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
29,
|
||||
37
|
||||
],
|
||||
"value": "&r;",
|
||||
"rawValue": "&r;",
|
||||
"raw": "\"&r;\""
|
||||
}
|
||||
}
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 1,
|
||||
"end": 2,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 2
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
2
|
||||
],
|
||||
"name": "a"
|
||||
},
|
||||
"selfClosing": true
|
||||
},
|
||||
"closingElement": null,
|
||||
"children": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
172
test/fixtures/jsx/basic/5/expected.json
vendored
172
test/fixtures/jsx/basic/5/expected.json
vendored
@@ -1,53 +1,45 @@
|
||||
{
|
||||
"type": "Program",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "a",
|
||||
"range": [
|
||||
1,
|
||||
2
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"selfClosing": true,
|
||||
"attributes": [],
|
||||
"range": [
|
||||
0,
|
||||
5
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"closingElement": null,
|
||||
"children": [],
|
||||
"range": [
|
||||
0,
|
||||
5
|
||||
],
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 5,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 2
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
5
|
||||
],
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 5,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 2
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
5
|
||||
],
|
||||
"sourceType": "script",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 5,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
@@ -57,22 +49,74 @@
|
||||
"line": 2,
|
||||
"column": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
5
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 2
|
||||
"range": [
|
||||
0,
|
||||
5
|
||||
],
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"start": 0,
|
||||
"end": 5,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 2
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
5
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 0,
|
||||
"end": 5,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 2
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
5
|
||||
],
|
||||
"attributes": [],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 1,
|
||||
"end": 2,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 2
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
2
|
||||
],
|
||||
"name": "a"
|
||||
},
|
||||
"selfClosing": true
|
||||
},
|
||||
"closingElement": null,
|
||||
"children": []
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
244
test/fixtures/jsx/basic/6/expected.json
vendored
244
test/fixtures/jsx/basic/6/expected.json
vendored
@@ -1,87 +1,45 @@
|
||||
{
|
||||
"type": "Program",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "日本語",
|
||||
"range": [
|
||||
1,
|
||||
4
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
}
|
||||
},
|
||||
"selfClosing": false,
|
||||
"attributes": [],
|
||||
"range": [
|
||||
0,
|
||||
5
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
}
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "日本語",
|
||||
"range": [
|
||||
7,
|
||||
10
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
11
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
}
|
||||
}
|
||||
},
|
||||
"children": [],
|
||||
"range": [
|
||||
0,
|
||||
11
|
||||
],
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
11
|
||||
],
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
11
|
||||
],
|
||||
"sourceType": "script",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
@@ -91,22 +49,112 @@
|
||||
"line": 1,
|
||||
"column": 11
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
11
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
"range": [
|
||||
0,
|
||||
11
|
||||
],
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"start": 0,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
11
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 0,
|
||||
"end": 5,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
5
|
||||
],
|
||||
"attributes": [],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 1,
|
||||
"end": 4,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
4
|
||||
],
|
||||
"name": "日本語"
|
||||
},
|
||||
"selfClosing": false
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"start": 5,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
11
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 7,
|
||||
"end": 10,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
7,
|
||||
10
|
||||
],
|
||||
"name": "日本語"
|
||||
}
|
||||
},
|
||||
"children": []
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
404
test/fixtures/jsx/basic/7/expected.json
vendored
404
test/fixtures/jsx/basic/7/expected.json
vendored
@@ -1,162 +1,45 @@
|
||||
{
|
||||
"type": "Program",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "AbC-def",
|
||||
"range": [
|
||||
1,
|
||||
8
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
}
|
||||
},
|
||||
"selfClosing": false,
|
||||
"attributes": [
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "test",
|
||||
"range": [
|
||||
11,
|
||||
15
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 2
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 6
|
||||
}
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"value": "&&",
|
||||
"raw": "\"&&\"",
|
||||
"range": [
|
||||
16,
|
||||
31
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 22
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
11,
|
||||
31
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 2
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 22
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"range": [
|
||||
0,
|
||||
32
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 23
|
||||
}
|
||||
}
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "AbC-def",
|
||||
"range": [
|
||||
43,
|
||||
50
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 5,
|
||||
"column": 2
|
||||
},
|
||||
"end": {
|
||||
"line": 5,
|
||||
"column": 9
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
41,
|
||||
51
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 5,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 5,
|
||||
"column": 10
|
||||
}
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "Literal",
|
||||
"value": "\nbar\nbaz\n",
|
||||
"raw": "\nbar\nbaz\n",
|
||||
"range": [
|
||||
32,
|
||||
41
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 23
|
||||
},
|
||||
"end": {
|
||||
"line": 5,
|
||||
"column": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"range": [
|
||||
0,
|
||||
51
|
||||
],
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 51,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 5,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
51
|
||||
],
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 51,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 5,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
51
|
||||
],
|
||||
"sourceType": "script",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 51,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
@@ -166,22 +49,197 @@
|
||||
"line": 5,
|
||||
"column": 10
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
51
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 5,
|
||||
"column": 10
|
||||
"range": [
|
||||
0,
|
||||
51
|
||||
],
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"start": 0,
|
||||
"end": 51,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 5,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
51
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 0,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 23
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
32
|
||||
],
|
||||
"attributes": [
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"start": 11,
|
||||
"end": 31,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 2
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 22
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
11,
|
||||
31
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 11,
|
||||
"end": 15,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 2
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 6
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
11,
|
||||
15
|
||||
],
|
||||
"name": "test"
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"start": 16,
|
||||
"end": 31,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 22
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
16,
|
||||
31
|
||||
],
|
||||
"value": "&&",
|
||||
"rawValue": "&&",
|
||||
"raw": "\"&&\""
|
||||
}
|
||||
}
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 1,
|
||||
"end": 8,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
8
|
||||
],
|
||||
"name": "AbC-def"
|
||||
},
|
||||
"selfClosing": false
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"start": 41,
|
||||
"end": 51,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 5,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 5,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
41,
|
||||
51
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 43,
|
||||
"end": 50,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 5,
|
||||
"column": 2
|
||||
},
|
||||
"end": {
|
||||
"line": 5,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
43,
|
||||
50
|
||||
],
|
||||
"name": "AbC-def"
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "Literal",
|
||||
"start": 32,
|
||||
"end": 41,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 23
|
||||
},
|
||||
"end": {
|
||||
"line": 5,
|
||||
"column": 0
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
32,
|
||||
41
|
||||
],
|
||||
"value": "\nbar\nbaz\n",
|
||||
"rawValue": "\nbar\nbaz\n",
|
||||
"raw": "\nbar\nbaz\n"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
594
test/fixtures/jsx/basic/8/expected.json
vendored
594
test/fixtures/jsx/basic/8/expected.json
vendored
@@ -1,253 +1,45 @@
|
||||
{
|
||||
"type": "Program",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "a",
|
||||
"range": [
|
||||
1,
|
||||
2
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"selfClosing": true,
|
||||
"attributes": [
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "b",
|
||||
"range": [
|
||||
3,
|
||||
4
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"type": "JSXExpressionContainer",
|
||||
"expression": {
|
||||
"type": "ConditionalExpression",
|
||||
"test": {
|
||||
"type": "Identifier",
|
||||
"name": "x",
|
||||
"range": [
|
||||
6,
|
||||
7
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
}
|
||||
}
|
||||
},
|
||||
"consequent": {
|
||||
"type": "JSXElement",
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "c",
|
||||
"range": [
|
||||
11,
|
||||
12
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
}
|
||||
}
|
||||
},
|
||||
"selfClosing": true,
|
||||
"attributes": [],
|
||||
"range": [
|
||||
10,
|
||||
15
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
}
|
||||
}
|
||||
},
|
||||
"closingElement": null,
|
||||
"children": [],
|
||||
"range": [
|
||||
10,
|
||||
15
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
}
|
||||
}
|
||||
},
|
||||
"alternate": {
|
||||
"type": "JSXElement",
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "d",
|
||||
"range": [
|
||||
19,
|
||||
20
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
}
|
||||
}
|
||||
},
|
||||
"selfClosing": true,
|
||||
"attributes": [],
|
||||
"range": [
|
||||
18,
|
||||
23
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 23
|
||||
}
|
||||
}
|
||||
},
|
||||
"closingElement": null,
|
||||
"children": [],
|
||||
"range": [
|
||||
18,
|
||||
23
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 23
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
6,
|
||||
23
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 23
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
24
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
3,
|
||||
24
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"range": [
|
||||
0,
|
||||
27
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 27
|
||||
}
|
||||
}
|
||||
},
|
||||
"closingElement": null,
|
||||
"children": [],
|
||||
"range": [
|
||||
0,
|
||||
27
|
||||
],
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 27,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 27
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
27
|
||||
],
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 27,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 27
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
27
|
||||
],
|
||||
"sourceType": "script",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 27,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
@@ -257,22 +49,296 @@
|
||||
"line": 1,
|
||||
"column": 27
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
27
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 27
|
||||
"range": [
|
||||
0,
|
||||
27
|
||||
],
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"start": 0,
|
||||
"end": 27,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 27
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
27
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 0,
|
||||
"end": 27,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 27
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
27
|
||||
],
|
||||
"attributes": [
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"start": 3,
|
||||
"end": 24,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
3,
|
||||
24
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 3,
|
||||
"end": 4,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
3,
|
||||
4
|
||||
],
|
||||
"name": "b"
|
||||
},
|
||||
"value": {
|
||||
"type": "JSXExpressionContainer",
|
||||
"start": 5,
|
||||
"end": 24,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
24
|
||||
],
|
||||
"expression": {
|
||||
"type": "ConditionalExpression",
|
||||
"start": 6,
|
||||
"end": 23,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 23
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
6,
|
||||
23
|
||||
],
|
||||
"test": {
|
||||
"type": "Identifier",
|
||||
"start": 6,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
6,
|
||||
7
|
||||
],
|
||||
"name": "x"
|
||||
},
|
||||
"consequent": {
|
||||
"type": "JSXElement",
|
||||
"start": 10,
|
||||
"end": 15,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
10,
|
||||
15
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 10,
|
||||
"end": 15,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
10,
|
||||
15
|
||||
],
|
||||
"attributes": [],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 11,
|
||||
"end": 12,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
11,
|
||||
12
|
||||
],
|
||||
"name": "c"
|
||||
},
|
||||
"selfClosing": true
|
||||
},
|
||||
"closingElement": null,
|
||||
"children": []
|
||||
},
|
||||
"alternate": {
|
||||
"type": "JSXElement",
|
||||
"start": 18,
|
||||
"end": 23,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 23
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
18,
|
||||
23
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 18,
|
||||
"end": 23,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 23
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
18,
|
||||
23
|
||||
],
|
||||
"attributes": [],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 19,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
19,
|
||||
20
|
||||
],
|
||||
"name": "d"
|
||||
},
|
||||
"selfClosing": true
|
||||
},
|
||||
"closingElement": null,
|
||||
"children": []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 1,
|
||||
"end": 2,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 2
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
2
|
||||
],
|
||||
"name": "a"
|
||||
},
|
||||
"selfClosing": true
|
||||
},
|
||||
"closingElement": null,
|
||||
"children": []
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
318
test/fixtures/jsx/basic/9/expected.json
vendored
318
test/fixtures/jsx/basic/9/expected.json
vendored
@@ -1,122 +1,45 @@
|
||||
{
|
||||
"type": "Program",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "a",
|
||||
"range": [
|
||||
1,
|
||||
2
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"selfClosing": false,
|
||||
"attributes": [],
|
||||
"range": [
|
||||
0,
|
||||
3
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
}
|
||||
}
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"name": "a",
|
||||
"range": [
|
||||
7,
|
||||
8
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
9
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
}
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "JSXExpressionContainer",
|
||||
"expression": {
|
||||
"type": "JSXEmptyExpression",
|
||||
"range": [
|
||||
4,
|
||||
4
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
3,
|
||||
5
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"range": [
|
||||
0,
|
||||
9
|
||||
],
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 9,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
9
|
||||
],
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 9,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
9
|
||||
],
|
||||
"sourceType": "script",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 9,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
@@ -126,22 +49,151 @@
|
||||
"line": 1,
|
||||
"column": 9
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
9
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
"range": [
|
||||
0,
|
||||
9
|
||||
],
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"start": 0,
|
||||
"end": 9,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
9
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 0,
|
||||
"end": 3,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
3
|
||||
],
|
||||
"attributes": [],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 1,
|
||||
"end": 2,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 2
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
2
|
||||
],
|
||||
"name": "a"
|
||||
},
|
||||
"selfClosing": false
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"start": 5,
|
||||
"end": 9,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
9
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 7,
|
||||
"end": 8,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
7,
|
||||
8
|
||||
],
|
||||
"name": "a"
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "JSXExpressionContainer",
|
||||
"start": 3,
|
||||
"end": 5,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
3,
|
||||
5
|
||||
],
|
||||
"expression": {
|
||||
"type": "JSXEmptyExpression",
|
||||
"start": 4,
|
||||
"end": 4,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
4,
|
||||
4
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
496
test/fixtures/jsx/regression/1/expected.json
vendored
496
test/fixtures/jsx/regression/1/expected.json
vendored
@@ -1,112 +1,390 @@
|
||||
{
|
||||
"type": "Program",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 40,
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"start": 0,
|
||||
"end": 38,
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 0,
|
||||
"end": 3,
|
||||
"attributes": [],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 1,
|
||||
"end": 2,
|
||||
"name": "p"
|
||||
},
|
||||
"selfClosing": false
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"start": 34,
|
||||
"end": 38,
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 36,
|
||||
"end": 37,
|
||||
"name": "p"
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "Literal",
|
||||
"start": 3,
|
||||
"end": 7,
|
||||
"value": "foo ",
|
||||
"raw": "foo "
|
||||
},
|
||||
{
|
||||
"type": "JSXElement",
|
||||
"start": 7,
|
||||
"end": 30,
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 7,
|
||||
"end": 22,
|
||||
"attributes": [
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"start": 10,
|
||||
"end": 21,
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 10,
|
||||
"end": 14,
|
||||
"name": "href"
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"start": 15,
|
||||
"end": 21,
|
||||
"value": "test",
|
||||
"raw": "\"test\""
|
||||
}
|
||||
}
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 8,
|
||||
"end": 9,
|
||||
"name": "a"
|
||||
},
|
||||
"selfClosing": false
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"start": 26,
|
||||
"end": 30,
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 28,
|
||||
"end": 29,
|
||||
"name": "a"
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "Literal",
|
||||
"start": 22,
|
||||
"end": 26,
|
||||
"value": " bar",
|
||||
"raw": " bar"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Literal",
|
||||
"start": 30,
|
||||
"end": 34,
|
||||
"value": " baz",
|
||||
"raw": " baz"
|
||||
}
|
||||
]
|
||||
}
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 40,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 40
|
||||
}
|
||||
]
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
40
|
||||
],
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 40,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 40
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
40
|
||||
],
|
||||
"sourceType": "script",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 40,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 40
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
40
|
||||
],
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"start": 0,
|
||||
"end": 38,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 38
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
38
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 0,
|
||||
"end": 3,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
3
|
||||
],
|
||||
"attributes": [],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 1,
|
||||
"end": 2,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 2
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
2
|
||||
],
|
||||
"name": "p"
|
||||
},
|
||||
"selfClosing": false
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"start": 34,
|
||||
"end": 38,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 34
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 38
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
34,
|
||||
38
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 36,
|
||||
"end": 37,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 36
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 37
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
36,
|
||||
37
|
||||
],
|
||||
"name": "p"
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "Literal",
|
||||
"start": 3,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 3
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
3,
|
||||
7
|
||||
],
|
||||
"value": "foo ",
|
||||
"rawValue": "foo ",
|
||||
"raw": "foo "
|
||||
},
|
||||
{
|
||||
"type": "JSXElement",
|
||||
"start": 7,
|
||||
"end": 30,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 30
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
7,
|
||||
30
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 7,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
7,
|
||||
22
|
||||
],
|
||||
"attributes": [
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"start": 10,
|
||||
"end": 21,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
10,
|
||||
21
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 10,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
10,
|
||||
14
|
||||
],
|
||||
"name": "href"
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"start": 15,
|
||||
"end": 21,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
15,
|
||||
21
|
||||
],
|
||||
"value": "test",
|
||||
"rawValue": "test",
|
||||
"raw": "\"test\""
|
||||
}
|
||||
}
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 8,
|
||||
"end": 9,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
8,
|
||||
9
|
||||
],
|
||||
"name": "a"
|
||||
},
|
||||
"selfClosing": false
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"start": 26,
|
||||
"end": 30,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 26
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 30
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
26,
|
||||
30
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 28,
|
||||
"end": 29,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 28
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 29
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
28,
|
||||
29
|
||||
],
|
||||
"name": "a"
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "Literal",
|
||||
"start": 22,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 26
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
22,
|
||||
26
|
||||
],
|
||||
"value": " bar",
|
||||
"rawValue": " bar",
|
||||
"raw": " bar"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Literal",
|
||||
"start": 30,
|
||||
"end": 34,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 30
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 34
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
30,
|
||||
34
|
||||
],
|
||||
"value": " baz",
|
||||
"rawValue": " baz",
|
||||
"raw": " baz"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
334
test/fixtures/jsx/regression/2/expected.json
vendored
334
test/fixtures/jsx/regression/2/expected.json
vendored
@@ -1,78 +1,282 @@
|
||||
{
|
||||
"type": "Program",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 30,
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 30,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 30
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
30
|
||||
],
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 30,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 30
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
30
|
||||
],
|
||||
"sourceType": "script",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 30,
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 0,
|
||||
"end": 5,
|
||||
"attributes": [],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 1,
|
||||
"end": 4,
|
||||
"name": "div"
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"selfClosing": false
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"start": 24,
|
||||
"end": 30,
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 26,
|
||||
"end": 29,
|
||||
"name": "div"
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 30
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "JSXExpressionContainer",
|
||||
"start": 5,
|
||||
"end": 24,
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"start": 6,
|
||||
"end": 23,
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"range": [
|
||||
0,
|
||||
30
|
||||
],
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"start": 0,
|
||||
"end": 30,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 30
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
30
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 0,
|
||||
"end": 5,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
5
|
||||
],
|
||||
"attributes": [],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 1,
|
||||
"end": 4,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
4
|
||||
],
|
||||
"name": "div"
|
||||
},
|
||||
"selfClosing": false
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"start": 24,
|
||||
"end": 30,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 30
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
24,
|
||||
30
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 26,
|
||||
"end": 29,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 26
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 29
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
26,
|
||||
29
|
||||
],
|
||||
"name": "div"
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "JSXExpressionContainer",
|
||||
"start": 5,
|
||||
"end": 24,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
24
|
||||
],
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"start": 6,
|
||||
"end": 23,
|
||||
"attributes": [
|
||||
{
|
||||
"type": "JSXSpreadAttribute",
|
||||
"start": 11,
|
||||
"end": 20,
|
||||
"argument": {
|
||||
"type": "Identifier",
|
||||
"start": 15,
|
||||
"end": 19,
|
||||
"name": "test"
|
||||
}
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 23
|
||||
}
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 7,
|
||||
"end": 10,
|
||||
"name": "div"
|
||||
},
|
||||
"selfClosing": true
|
||||
},
|
||||
"closingElement": null,
|
||||
"children": []
|
||||
"range": [
|
||||
6,
|
||||
23
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 6,
|
||||
"end": 23,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 23
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
6,
|
||||
23
|
||||
],
|
||||
"attributes": [
|
||||
{
|
||||
"type": "JSXSpreadAttribute",
|
||||
"start": 11,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
11,
|
||||
20
|
||||
],
|
||||
"argument": {
|
||||
"type": "Identifier",
|
||||
"start": 15,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
15,
|
||||
19
|
||||
],
|
||||
"name": "test"
|
||||
}
|
||||
}
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 7,
|
||||
"end": 10,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
7,
|
||||
10
|
||||
],
|
||||
"name": "div"
|
||||
},
|
||||
"selfClosing": true
|
||||
},
|
||||
"closingElement": null,
|
||||
"children": []
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
320
test/fixtures/jsx/regression/3/expected.json
vendored
320
test/fixtures/jsx/regression/3/expected.json
vendored
@@ -1,74 +1,264 @@
|
||||
{
|
||||
"type": "Program",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 18,
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
18
|
||||
],
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
18
|
||||
],
|
||||
"sourceType": "script",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 18,
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 0,
|
||||
"end": 5,
|
||||
"attributes": [],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 1,
|
||||
"end": 4,
|
||||
"name": "div"
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"selfClosing": false
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"start": 12,
|
||||
"range": [
|
||||
0,
|
||||
18
|
||||
],
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"start": 0,
|
||||
"end": 18,
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 14,
|
||||
"end": 17,
|
||||
"name": "div"
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "JSXExpressionContainer",
|
||||
"start": 5,
|
||||
"end": 12,
|
||||
"expression": {
|
||||
"type": "ObjectExpression",
|
||||
"start": 7,
|
||||
"end": 10,
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"start": 8,
|
||||
"end": 9,
|
||||
"method": false,
|
||||
"shorthand": true,
|
||||
"computed": false,
|
||||
"key": {
|
||||
"type": "Identifier",
|
||||
"start": 8,
|
||||
"end": 9,
|
||||
"name": "a"
|
||||
},
|
||||
"kind": "init",
|
||||
"value": {
|
||||
"type": "Identifier",
|
||||
"start": 8,
|
||||
"end": 9,
|
||||
"name": "a"
|
||||
}
|
||||
}
|
||||
]
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
18
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 0,
|
||||
"end": 5,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
5
|
||||
],
|
||||
"attributes": [],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 1,
|
||||
"end": 4,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
4
|
||||
],
|
||||
"name": "div"
|
||||
},
|
||||
"selfClosing": false
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"start": 12,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
12,
|
||||
18
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 14,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
14,
|
||||
17
|
||||
],
|
||||
"name": "div"
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "JSXExpressionContainer",
|
||||
"start": 5,
|
||||
"end": 12,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
12
|
||||
],
|
||||
"expression": {
|
||||
"type": "ObjectExpression",
|
||||
"start": 7,
|
||||
"end": 10,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
7,
|
||||
10
|
||||
],
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"start": 8,
|
||||
"end": 9,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
8,
|
||||
9
|
||||
],
|
||||
"method": false,
|
||||
"shorthand": true,
|
||||
"computed": false,
|
||||
"key": {
|
||||
"type": "Identifier",
|
||||
"start": 8,
|
||||
"end": 9,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
8,
|
||||
9
|
||||
],
|
||||
"name": "a"
|
||||
},
|
||||
"kind": "init",
|
||||
"value": {
|
||||
"type": "Identifier",
|
||||
"start": 8,
|
||||
"end": 9,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
8,
|
||||
9
|
||||
],
|
||||
"name": "a"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
215
test/fixtures/jsx/regression/4/expected.json
vendored
215
test/fixtures/jsx/regression/4/expected.json
vendored
@@ -1,48 +1,183 @@
|
||||
{
|
||||
"type": "Program",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 16,
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 16,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
16
|
||||
],
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 16,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
16
|
||||
],
|
||||
"sourceType": "script",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 16,
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 0,
|
||||
"end": 5,
|
||||
"attributes": [],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 1,
|
||||
"end": 4,
|
||||
"name": "div"
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"selfClosing": false
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
}
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"start": 10,
|
||||
"range": [
|
||||
0,
|
||||
16
|
||||
],
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"start": 0,
|
||||
"end": 16,
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 12,
|
||||
"end": 15,
|
||||
"name": "div"
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "Literal",
|
||||
"start": 5,
|
||||
"end": 10,
|
||||
"value": "/text",
|
||||
"raw": "/text"
|
||||
}
|
||||
]
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
16
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 0,
|
||||
"end": 5,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
5
|
||||
],
|
||||
"attributes": [],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 1,
|
||||
"end": 4,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
4
|
||||
],
|
||||
"name": "div"
|
||||
},
|
||||
"selfClosing": false
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"start": 10,
|
||||
"end": 16,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
10,
|
||||
16
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 12,
|
||||
"end": 15,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 15
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
12,
|
||||
15
|
||||
],
|
||||
"name": "div"
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "Literal",
|
||||
"start": 5,
|
||||
"end": 10,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
10
|
||||
],
|
||||
"value": "/text",
|
||||
"rawValue": "/text",
|
||||
"raw": "/text"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
300
test/fixtures/jsx/regression/5/expected.json
vendored
300
test/fixtures/jsx/regression/5/expected.json
vendored
@@ -1,111 +1,239 @@
|
||||
{
|
||||
"type": "Program",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 17,
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
17
|
||||
],
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
17
|
||||
],
|
||||
"sourceType": "script",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 17,
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 0,
|
||||
"end": 5,
|
||||
"attributes": [],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 1,
|
||||
"end": 4,
|
||||
"name": "div"
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"selfClosing": false
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"start": 11,
|
||||
"end": 17,
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 13,
|
||||
"end": 16,
|
||||
"name": "div"
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "JSXExpressionContainer",
|
||||
"expression": {
|
||||
"type": "Identifier",
|
||||
"name": "a",
|
||||
"range": [
|
||||
6,
|
||||
7
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
}
|
||||
}
|
||||
"range": [
|
||||
0,
|
||||
17
|
||||
],
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"start": 0,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
8
|
||||
],
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
17
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 0,
|
||||
"end": 5,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "JSXExpressionContainer",
|
||||
"expression": {
|
||||
"type": "Identifier",
|
||||
"name": "b",
|
||||
"range": [
|
||||
9,
|
||||
10
|
||||
],
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
8,
|
||||
11
|
||||
0,
|
||||
5
|
||||
],
|
||||
"attributes": [],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 1,
|
||||
"end": 4,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
4
|
||||
],
|
||||
"name": "div"
|
||||
},
|
||||
"selfClosing": false
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"start": 11,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
"column": 11
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
"column": 17
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
11,
|
||||
17
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 13,
|
||||
"end": 16,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 13
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
13,
|
||||
16
|
||||
],
|
||||
"name": "div"
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "JSXExpressionContainer",
|
||||
"start": 5,
|
||||
"end": 8,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
8
|
||||
],
|
||||
"expression": {
|
||||
"type": "Identifier",
|
||||
"start": 6,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
6,
|
||||
7
|
||||
],
|
||||
"name": "a"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "JSXExpressionContainer",
|
||||
"start": 8,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
8,
|
||||
11
|
||||
],
|
||||
"expression": {
|
||||
"type": "Identifier",
|
||||
"start": 9,
|
||||
"end": 10,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
9,
|
||||
10
|
||||
],
|
||||
"name": "b"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
266
test/fixtures/jsx/regression/6/expected.json
vendored
266
test/fixtures/jsx/regression/6/expected.json
vendored
@@ -1,77 +1,223 @@
|
||||
{
|
||||
"type": "Program",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"range": [
|
||||
0,
|
||||
32
|
||||
],
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 32
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
32
|
||||
],
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 32
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
32
|
||||
],
|
||||
"sourceType": "script",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 32
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
32
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"start": 0,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 32
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
32
|
||||
],
|
||||
"attributes": [
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"range": [
|
||||
5,
|
||||
18
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"range": [
|
||||
5,
|
||||
8
|
||||
],
|
||||
"name": "pre"
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 0,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"range": [
|
||||
9,
|
||||
18
|
||||
],
|
||||
"value": "leading"
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 32
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "JSXSpreadAttribute",
|
||||
"range": [
|
||||
19,
|
||||
29
|
||||
],
|
||||
"argument": {
|
||||
"type": "Identifier",
|
||||
"range": [
|
||||
23,
|
||||
28
|
||||
],
|
||||
"name": "props"
|
||||
}
|
||||
}
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"range": [
|
||||
1,
|
||||
4
|
||||
0,
|
||||
32
|
||||
],
|
||||
"name": "div"
|
||||
"attributes": [
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"start": 5,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
18
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 5,
|
||||
"end": 8,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
5,
|
||||
8
|
||||
],
|
||||
"name": "pre"
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"start": 9,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
9,
|
||||
18
|
||||
],
|
||||
"value": "leading",
|
||||
"rawValue": "leading",
|
||||
"raw": "\"leading\""
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "JSXSpreadAttribute",
|
||||
"start": 19,
|
||||
"end": 29,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 29
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
19,
|
||||
29
|
||||
],
|
||||
"argument": {
|
||||
"type": "Identifier",
|
||||
"start": 23,
|
||||
"end": 28,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 23
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 28
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
23,
|
||||
28
|
||||
],
|
||||
"name": "props"
|
||||
}
|
||||
}
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 1,
|
||||
"end": 4,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
4
|
||||
],
|
||||
"name": "div"
|
||||
},
|
||||
"selfClosing": true
|
||||
},
|
||||
"selfClosing": true
|
||||
},
|
||||
"closingElement": null,
|
||||
"children": []
|
||||
"closingElement": null,
|
||||
"children": []
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
209
test/fixtures/jsx/regression/7/expected.json
vendored
209
test/fixtures/jsx/regression/7/expected.json
vendored
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"type": "Program",
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 62,
|
||||
"loc": {
|
||||
@@ -16,28 +16,28 @@
|
||||
0,
|
||||
62
|
||||
],
|
||||
"sourceType": "script",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 62,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 17
|
||||
}
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 62,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
62
|
||||
],
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 17
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
62
|
||||
],
|
||||
"sourceType": "script",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 62,
|
||||
"loc": {
|
||||
@@ -54,8 +54,8 @@
|
||||
0,
|
||||
62
|
||||
],
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"expression": {
|
||||
"type": "JSXElement",
|
||||
"start": 0,
|
||||
"end": 62,
|
||||
"loc": {
|
||||
@@ -72,53 +72,33 @@
|
||||
0,
|
||||
62
|
||||
],
|
||||
"attributes": [
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"start": 6,
|
||||
"end": 60,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 15
|
||||
}
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 0,
|
||||
"end": 62,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"range": [
|
||||
6,
|
||||
60
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 17
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
0,
|
||||
62
|
||||
],
|
||||
"attributes": [
|
||||
{
|
||||
"type": "JSXAttribute",
|
||||
"start": 6,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
6,
|
||||
7
|
||||
],
|
||||
"name": "d"
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"start": 8,
|
||||
"end": 60,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
"column": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
@@ -126,40 +106,79 @@
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
8,
|
||||
6,
|
||||
60
|
||||
],
|
||||
"value": "M230 80\n\t\tA 45 45, 0, 1, 0, 275 125\n L 275 80 Z",
|
||||
"rawValue": "M230 80\n\t\tA 45 45, 0, 1, 0, 275 125\n L 275 80 Z",
|
||||
"raw": "\"M230 80\n\t\tA 45 45, 0, 1, 0, 275 125\n L 275 80 Z\""
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 6,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
6,
|
||||
7
|
||||
],
|
||||
"name": "d"
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"start": 8,
|
||||
"end": 60,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 15
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
8,
|
||||
60
|
||||
],
|
||||
"value": "M230 80\n\t\tA 45 45, 0, 1, 0, 275 125\n L 275 80 Z",
|
||||
"rawValue": "M230 80\n\t\tA 45 45, 0, 1, 0, 275 125\n L 275 80 Z",
|
||||
"raw": "\"M230 80\n\t\tA 45 45, 0, 1, 0, 275 125\n L 275 80 Z\""
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 1,
|
||||
"end": 5,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
5
|
||||
],
|
||||
"name": "path"
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 1,
|
||||
"end": 5,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"range": [
|
||||
1,
|
||||
5
|
||||
],
|
||||
"name": "path"
|
||||
},
|
||||
"selfClosing": true
|
||||
},
|
||||
"selfClosing": true
|
||||
},
|
||||
"closingElement": null,
|
||||
"children": []
|
||||
"closingElement": null,
|
||||
"children": []
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user