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

348 lines
7.6 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 243,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 0,
"end": 44,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 12,
"end": 43,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 12,
"end": 15,
"ctxt": 0
},
"value": "win",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 15,
"end": 43,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIntersectionType",
"span": {
"start": 17,
"end": 43,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 17,
"end": 23,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 17,
"end": 23,
"ctxt": 0
},
"value": "Window",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeQuery",
"span": {
"start": 26,
"end": 43,
"ctxt": 0
},
"exprName": {
"type": "Identifier",
"span": {
"start": 33,
"end": 43,
"ctxt": 0
},
"value": "globalThis",
"optional": false
},
"typeArguments": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 80,
"end": 86,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 80,
"end": 86,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 80,
"end": 83,
"ctxt": 0
},
"value": "win",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 84,
"end": 86,
"ctxt": 0
},
"value": "hi",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 130,
"end": 137,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 130,
"end": 137,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 130,
"end": 134,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 135,
"end": 137,
"ctxt": 0
},
"value": "hi",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 138,
"end": 151,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 138,
"end": 151,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 138,
"end": 148,
"ctxt": 0
},
"value": "globalThis",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 149,
"end": 151,
"ctxt": 0
},
"value": "hi",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 206,
"end": 215,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 206,
"end": 215,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 206,
"end": 209,
"ctxt": 0
},
"value": "win",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 209,
"end": 215,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 210,
"end": 214,
"ctxt": 0
},
"value": "hi",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 216,
"end": 226,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 216,
"end": 226,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 216,
"end": 220,
"ctxt": 0
}
},
"property": {
"type": "Computed",
"span": {
"start": 220,
"end": 226,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 221,
"end": 225,
"ctxt": 0
},
"value": "hi",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 227,
"end": 243,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 227,
"end": 243,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 227,
"end": 237,
"ctxt": 0
},
"value": "globalThis",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 237,
"end": 243,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 238,
"end": 242,
"ctxt": 0
},
"value": "hi",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
}
}
],
"interpreter": null
}