swc/crates/swc_ecma_parser/tests/tsc/jsDeclarationsCommonjsRelativePath.json
2022-03-22 07:54:08 +00:00

288 lines
6.2 KiB
JSON

{
"type": "Script",
"span": {
"start": 114,
"end": 276,
"ctxt": 0
},
"body": [
{
"type": "ExpressionStatement",
"span": {
"start": 114,
"end": 127,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 114,
"end": 126,
"ctxt": 0
},
"value": "use strict",
"raw": "'use strict'"
}
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 134,
"end": 139,
"ctxt": 0
},
"value": "Thing",
"optional": false
},
"declare": false,
"span": {
"start": 128,
"end": 142,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ExpressionStatement",
"span": {
"start": 143,
"end": 169,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 143,
"end": 169,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 143,
"end": 157,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 143,
"end": 149,
"ctxt": 0
},
"value": "module",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 150,
"end": 157,
"ctxt": 0
},
"value": "exports",
"optional": false
}
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 160,
"end": 169,
"ctxt": 0
},
"properties": [
{
"type": "Identifier",
"span": {
"start": 162,
"end": 167,
"ctxt": 0
},
"value": "Thing",
"optional": false
}
]
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 197,
"end": 210,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 197,
"end": 209,
"ctxt": 0
},
"value": "use strict",
"raw": "'use strict'"
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 211,
"end": 249,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 217,
"end": 249,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 217,
"end": 222,
"ctxt": 0
},
"value": "Thing",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 225,
"end": 249,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 225,
"end": 243,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 225,
"end": 232,
"ctxt": 0
},
"value": "require",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 233,
"end": 242,
"ctxt": 0
},
"value": "./thing",
"raw": "'./thing'"
}
}
],
"typeArguments": null
},
"property": {
"type": "Identifier",
"span": {
"start": 244,
"end": 249,
"ctxt": 0
},
"value": "Thing",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 250,
"end": 276,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 250,
"end": 276,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 250,
"end": 264,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 250,
"end": 256,
"ctxt": 0
},
"value": "module",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 257,
"end": 264,
"ctxt": 0
},
"value": "exports",
"optional": false
}
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 267,
"end": 276,
"ctxt": 0
},
"properties": [
{
"type": "Identifier",
"span": {
"start": 269,
"end": 274,
"ctxt": 0
},
"value": "Thing",
"optional": false
}
]
}
}
}
],
"interpreter": null
}