swc/babel/compat/tests/fixtures/comments-line/output.json
강동윤 82ef06afb8
feat(babel/compat): Improve performance of babelify (#1626)
swc_babel_compat:
 - Optimize.

swc:
 - Improve performance of comment storage.
2021-05-06 14:56:54 +09:00

226 lines
7.8 KiB
JSON

{
"type": "File",
"start": 0,
"end": 75,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 5,
"column": 0
}
},
"errors": [],
"program": {
"type": "Program",
"start": 0,
"end": 75,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 5,
"column": 0
}
},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "FunctionDeclaration",
"start": 0,
"end": 74,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 4,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 9,
"end": 10,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 10
},
"identifierName": "x"
},
"name": "x"
},
"generator": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 13,
"end": 74,
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 4,
"column": 1
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 39,
"end": 52,
"loc": {
"start": {
"line": 3,
"column": 4
},
"end": {
"line": 3,
"column": 17
}
},
"leadingComments": [
{
"type": "CommentLine",
"value": " some comment",
"start": 19,
"end": 34,
"loc": {
"start": {
"line": 2,
"column": 4
},
"end": {
"line": 2,
"column": 19
}
}
}
],
"trailingComments": [
{
"type": "CommentLine",
"value": " trailing comment",
"start": 53,
"end": 72,
"loc": {
"start": {
"line": 3,
"column": 18
},
"end": {
"line": 3,
"column": 37
}
}
}
],
"declarations": [
{
"type": "VariableDeclarator",
"start": 43,
"end": 51,
"loc": {
"start": {
"line": 3,
"column": 8
},
"end": {
"line": 3,
"column": 16
}
},
"id": {
"type": "Identifier",
"start": 43,
"end": 44,
"loc": {
"start": {
"line": 3,
"column": 8
},
"end": {
"line": 3,
"column": 9
},
"identifierName": "a"
},
"name": "a"
},
"init": {
"type": "BooleanLiteral",
"start": 47,
"end": 51,
"loc": {
"start": {
"line": 3,
"column": 12
},
"end": {
"line": 3,
"column": 16
}
},
"value": true
}
}
],
"kind": "let"
}
],
"directives": []
}
}
],
"directives": []
},
"comments": [
{
"type": "CommentLine",
"value": " some comment",
"start": 19,
"end": 34,
"loc": {
"start": {
"line": 2,
"column": 4
},
"end": {
"line": 2,
"column": 19
}
}
},
{
"type": "CommentLine",
"value": " trailing comment",
"start": 53,
"end": 72,
"loc": {
"start": {
"line": 3,
"column": 18
},
"end": {
"line": 3,
"column": 37
}
}
}
]
}