swc/ecmascript/parser/tests/jsx/basic/3/input.js.json
강동윤 b44da9dbe4
Fix #369, #370 (#373)
swc_common:
 - don't emit `loc` for dummy spans

swc_ecma_transforms:
 - prevent hygiene from changing key in object pattern (#369)
 - fix module tests (iteration order of FxHashSet is changed)

swc_ecma_parser:
 - fix parsing of arrow function (#370)
2019-04-27 16:28:34 +09:00

420 lines
9.7 KiB
JSON

{
"type": "Module",
"span": {
"start": 0,
"end": 40,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 40
}
}
},
"body": [
{
"type": "JSXElement",
"span": {
"start": 0,
"end": 40,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 40
}
}
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 1,
"end": 2,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 1
},
"end": {
"line": 1,
"column": 2
}
}
},
"value": "a",
"optional": false
},
"span": {
"start": 1,
"end": 15,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 1
},
"end": {
"line": 1,
"column": 15
}
}
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 3,
"end": 14,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 3
},
"end": {
"line": 1,
"column": 14
}
}
},
"name": {
"type": "JSXNamespacedName",
"namespace": {
"type": "Identifier",
"span": {
"start": 3,
"end": 4,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 3
},
"end": {
"line": 1,
"column": 4
}
}
},
"value": "n",
"optional": false
},
"name": {
"type": "Identifier",
"span": {
"start": 5,
"end": 8,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 5
},
"end": {
"line": 1,
"column": 8
}
}
},
"value": "foo",
"optional": false
}
},
"value": {
"type": "StringLiteral",
"span": {
"start": 9,
"end": 14,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 14
}
}
},
"value": "bar",
"hasEscape": false
}
}
],
"selfClosing": false
},
"children": [
{
"type": "JSXText",
"span": {
"start": 15,
"end": 16,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 16
}
}
},
"value": " ",
"raw": " "
},
{
"type": "JSXExpressionContainer",
"expression": {
"type": "Identifier",
"span": {
"start": 17,
"end": 22,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 17
},
"end": {
"line": 1,
"column": 22
}
}
},
"value": "value",
"optional": false
}
},
{
"type": "JSXText",
"span": {
"start": 23,
"end": 24,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 23
},
"end": {
"line": 1,
"column": 24
}
}
},
"value": " ",
"raw": " "
},
{
"type": "JSXElement",
"span": {
"start": 24,
"end": 36,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 24
},
"end": {
"line": 1,
"column": 36
}
}
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 25,
"end": 26,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 25
},
"end": {
"line": 1,
"column": 26
}
}
},
"value": "b",
"optional": false
},
"span": {
"start": 25,
"end": 27,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 25
},
"end": {
"line": 1,
"column": 27
}
}
},
"selfClosing": false
},
"children": [
{
"type": "JSXElement",
"span": {
"start": 27,
"end": 32,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 27
},
"end": {
"line": 1,
"column": 32
}
}
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 28,
"end": 29,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 28
},
"end": {
"line": 1,
"column": 29
}
}
},
"value": "c",
"optional": false
},
"span": {
"start": 28,
"end": 32,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 28
},
"end": {
"line": 1,
"column": 32
}
}
},
"selfClosing": true
},
"children": [],
"closing": null
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 34,
"end": 36,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 34
},
"end": {
"line": 1,
"column": 36
}
}
},
"name": {
"type": "Identifier",
"span": {
"start": 34,
"end": 35,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 34
},
"end": {
"line": 1,
"column": 35
}
}
},
"value": "b",
"optional": false
}
}
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 38,
"end": 40,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 38
},
"end": {
"line": 1,
"column": 40
}
}
},
"name": {
"type": "Identifier",
"span": {
"start": 38,
"end": 39,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 38
},
"end": {
"line": 1,
"column": 39
}
}
},
"value": "a",
"optional": false
}
}
}
]
}