update babylon fixtures to use File as the root node rather than Program
This commit is contained in:
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