swc/ecmascript/parser/tests/jsx/basic/20/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

551 lines
14 KiB
JSON

{
"type": "Module",
"span": {
"start": 0,
"end": 52,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 52
}
}
},
"body": [
{
"type": "JSXElement",
"span": {
"start": 0,
"end": 52,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 52
}
}
},
"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": 31,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 1
},
"end": {
"line": 1,
"column": 31
}
}
},
"attributes": [
{
"type": "JSXAttribute",
"span": {
"start": 3,
"end": 16,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 3
},
"end": {
"line": 1,
"column": 16
}
}
},
"name": {
"type": "Identifier",
"span": {
"start": 3,
"end": 5,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 3
},
"end": {
"line": 1,
"column": 5
}
}
},
"value": "aa",
"optional": false
},
"value": {
"type": "MemberExpression",
"span": {
"start": 12,
"end": 15,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 12
},
"end": {
"line": 1,
"column": 15
}
}
},
"object": {
"type": "MemberExpression",
"span": {
"start": 9,
"end": 12,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 12
}
}
},
"object": {
"type": "Identifier",
"span": {
"start": 7,
"end": 9,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 9
}
}
},
"value": "aa",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 10,
"end": 12,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 1,
"column": 12
}
}
},
"value": "bb",
"optional": false
},
"computed": false
},
"property": {
"type": "Identifier",
"span": {
"start": 13,
"end": 15,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 1,
"column": 15
}
}
},
"value": "cc",
"optional": false
},
"computed": false
}
},
{
"type": "JSXAttribute",
"span": {
"start": 17,
"end": 30,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 17
},
"end": {
"line": 1,
"column": 30
}
}
},
"name": {
"type": "Identifier",
"span": {
"start": 17,
"end": 19,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 17
},
"end": {
"line": 1,
"column": 19
}
}
},
"value": "bb",
"optional": false
},
"value": {
"type": "MemberExpression",
"span": {
"start": 26,
"end": 29,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 26
},
"end": {
"line": 1,
"column": 29
}
}
},
"object": {
"type": "MemberExpression",
"span": {
"start": 23,
"end": 26,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 23
},
"end": {
"line": 1,
"column": 26
}
}
},
"object": {
"type": "Identifier",
"span": {
"start": 21,
"end": 23,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 21
},
"end": {
"line": 1,
"column": 23
}
}
},
"value": "bb",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 24,
"end": 26,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 24
},
"end": {
"line": 1,
"column": 26
}
}
},
"value": "cc",
"optional": false
},
"computed": false
},
"property": {
"type": "Identifier",
"span": {
"start": 27,
"end": 29,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 27
},
"end": {
"line": 1,
"column": 29
}
}
},
"value": "dd",
"optional": false
},
"computed": false
}
}
],
"selfClosing": false
},
"children": [
{
"type": "JSXElement",
"span": {
"start": 31,
"end": 48,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 31
},
"end": {
"line": 1,
"column": 48
}
}
},
"opening": {
"type": "JSXOpeningElement",
"name": {
"type": "Identifier",
"span": {
"start": 32,
"end": 35,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 32
},
"end": {
"line": 1,
"column": 35
}
}
},
"value": "div",
"optional": false
},
"span": {
"start": 32,
"end": 36,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 32
},
"end": {
"line": 1,
"column": 36
}
}
},
"selfClosing": false
},
"children": [
{
"type": "JSXExpressionContainer",
"expression": {
"type": "MemberExpression",
"span": {
"start": 39,
"end": 41,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 39
},
"end": {
"line": 1,
"column": 41
}
}
},
"object": {
"type": "Identifier",
"span": {
"start": 37,
"end": 39,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 37
},
"end": {
"line": 1,
"column": 39
}
}
},
"value": "aa",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 40,
"end": 41,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 40
},
"end": {
"line": 1,
"column": 41
}
}
},
"value": "b",
"optional": false
},
"computed": false
}
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 44,
"end": 48,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 44
},
"end": {
"line": 1,
"column": 48
}
}
},
"name": {
"type": "Identifier",
"span": {
"start": 44,
"end": 47,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 44
},
"end": {
"line": 1,
"column": 47
}
}
},
"value": "div",
"optional": false
}
}
}
],
"closing": {
"type": "JSXClosingElement",
"span": {
"start": 50,
"end": 52,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 50
},
"end": {
"line": 1,
"column": 52
}
}
},
"name": {
"type": "Identifier",
"span": {
"start": 50,
"end": 51,
"ctxt": 0,
"loc": {
"start": {
"line": 1,
"column": 50
},
"end": {
"line": 1,
"column": 51
}
}
},
"value": "A",
"optional": false
}
}
}
]
}