swc/crates/swc_ecma_parser/tests/tsc/moduleExportsElementAccessAssignment2.json

355 lines
9.1 KiB
JSON

{
"type": "Script",
"span": {
"start": 133,
"end": 390,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 133,
"end": 161,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 137,
"end": 160,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 137,
"end": 148,
"ctxt": 0
},
"value": "GlobalThing",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 151,
"end": 160,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 153,
"end": 154,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 156,
"end": 158,
"ctxt": 0
},
"value": 12.0
}
}
]
},
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 241,
"end": 242,
"ctxt": 0
},
"value": "f",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 243,
"end": 247,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 243,
"end": 247,
"ctxt": 0
},
"value": "type",
"optional": false,
"typeAnnotation": null
}
},
{
"type": "Parameter",
"span": {
"start": 249,
"end": 253,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 249,
"end": 253,
"ctxt": 0
},
"value": "ctor",
"optional": false,
"typeAnnotation": null
}
},
{
"type": "Parameter",
"span": {
"start": 255,
"end": 262,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 255,
"end": 262,
"ctxt": 0
},
"value": "exports",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 232,
"end": 354,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 264,
"end": 354,
"ctxt": 0
},
"stmts": [
{
"type": "IfStatement",
"span": {
"start": 270,
"end": 352,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 274,
"end": 304,
"ctxt": 0
},
"operator": "!==",
"left": {
"type": "UnaryExpression",
"span": {
"start": 274,
"end": 288,
"ctxt": 0
},
"operator": "typeof",
"argument": {
"type": "Identifier",
"span": {
"start": 281,
"end": 288,
"ctxt": 0
},
"value": "exports",
"optional": false
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 293,
"end": 304,
"ctxt": 0
},
"value": "undefined",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 306,
"end": 352,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 316,
"end": 346,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 316,
"end": 345,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 316,
"end": 338,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 316,
"end": 323,
"ctxt": 0
},
"value": "exports",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 323,
"end": 338,
"ctxt": 0
},
"expression": {
"type": "BinaryExpression",
"span": {
"start": 324,
"end": 337,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "StringLiteral",
"span": {
"start": 324,
"end": 330,
"ctxt": 0
},
"value": "AST_",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"right": {
"type": "Identifier",
"span": {
"start": 333,
"end": 337,
"ctxt": 0
},
"value": "type",
"optional": false
}
}
}
},
"right": {
"type": "Identifier",
"span": {
"start": 341,
"end": 345,
"ctxt": 0
},
"value": "ctor",
"optional": false
}
}
}
]
},
"alternate": null
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 377,
"end": 390,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 377,
"end": 390,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 377,
"end": 388,
"ctxt": 0
},
"value": "GlobalThing",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 389,
"end": 390,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
],
"interpreter": null
}