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

821 lines
19 KiB
JSON

{
"type": "Script",
"span": {
"start": 24,
"end": 544,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 24,
"end": 33,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 28,
"end": 33,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 28,
"end": 29,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 32,
"end": 33,
"ctxt": 0
},
"value": 1.0
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 34,
"end": 45,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 40,
"end": 45,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 40,
"end": 41,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 44,
"end": 45,
"ctxt": 0
},
"value": 2.0
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 46,
"end": 55,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 50,
"end": 55,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 50,
"end": 51,
"ctxt": 0
},
"value": "z",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 54,
"end": 55,
"ctxt": 0
},
"value": 3.0
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 56,
"end": 68,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 56,
"end": 68,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 56,
"end": 66,
"ctxt": 0
},
"value": "globalThis",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 67,
"end": 68,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 75,
"end": 87,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 75,
"end": 87,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 75,
"end": 85,
"ctxt": 0
},
"value": "globalThis",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 86,
"end": 87,
"ctxt": 0
},
"value": "y",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 121,
"end": 133,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 121,
"end": 133,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 121,
"end": 131,
"ctxt": 0
},
"value": "globalThis",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 132,
"end": 133,
"ctxt": 0
},
"value": "z",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 167,
"end": 182,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 167,
"end": 182,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 167,
"end": 177,
"ctxt": 0
},
"value": "globalThis",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 177,
"end": 182,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 178,
"end": 181,
"ctxt": 0
},
"value": "x",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 189,
"end": 204,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 189,
"end": 204,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 189,
"end": 199,
"ctxt": 0
},
"value": "globalThis",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 199,
"end": 204,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 200,
"end": 203,
"ctxt": 0
},
"value": "y",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 238,
"end": 253,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 238,
"end": 253,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 238,
"end": 248,
"ctxt": 0
},
"value": "globalThis",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 248,
"end": 253,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 249,
"end": 252,
"ctxt": 0
},
"value": "z",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 287,
"end": 310,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 287,
"end": 310,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 287,
"end": 297,
"ctxt": 0
},
"value": "globalThis",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 298,
"end": 310,
"ctxt": 0
},
"value": "Float64Array",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 317,
"end": 336,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 317,
"end": 336,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 317,
"end": 327,
"ctxt": 0
},
"value": "globalThis",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 328,
"end": 336,
"ctxt": 0
},
"value": "Infinity",
"optional": false
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 344,
"end": 387,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 356,
"end": 387,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 356,
"end": 361,
"ctxt": 0
},
"value": "test1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 361,
"end": 387,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIndexedAccessType",
"span": {
"start": 363,
"end": 387,
"ctxt": 0
},
"readonly": false,
"objectType": {
"type": "TsParenthesizedType",
"span": {
"start": 363,
"end": 382,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeQuery",
"span": {
"start": 364,
"end": 381,
"ctxt": 0
},
"exprName": {
"type": "Identifier",
"span": {
"start": 371,
"end": 381,
"ctxt": 0
},
"value": "globalThis",
"optional": false
},
"typeArguments": null
}
},
"indexType": {
"type": "TsLiteralType",
"span": {
"start": 383,
"end": 386,
"ctxt": 0
},
"literal": {
"type": "StringLiteral",
"span": {
"start": 383,
"end": 386,
"ctxt": 0
},
"value": "x",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 394,
"end": 437,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 406,
"end": 437,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 406,
"end": 411,
"ctxt": 0
},
"value": "test2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 411,
"end": 437,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIndexedAccessType",
"span": {
"start": 413,
"end": 437,
"ctxt": 0
},
"readonly": false,
"objectType": {
"type": "TsParenthesizedType",
"span": {
"start": 413,
"end": 432,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeQuery",
"span": {
"start": 414,
"end": 431,
"ctxt": 0
},
"exprName": {
"type": "Identifier",
"span": {
"start": 421,
"end": 431,
"ctxt": 0
},
"value": "globalThis",
"optional": false
},
"typeArguments": null
}
},
"indexType": {
"type": "TsLiteralType",
"span": {
"start": 433,
"end": 436,
"ctxt": 0
},
"literal": {
"type": "StringLiteral",
"span": {
"start": 433,
"end": 436,
"ctxt": 0
},
"value": "y",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 447,
"end": 490,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 459,
"end": 490,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 459,
"end": 464,
"ctxt": 0
},
"value": "test3",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 464,
"end": 490,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsIndexedAccessType",
"span": {
"start": 466,
"end": 490,
"ctxt": 0
},
"readonly": false,
"objectType": {
"type": "TsParenthesizedType",
"span": {
"start": 466,
"end": 485,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeQuery",
"span": {
"start": 467,
"end": 484,
"ctxt": 0
},
"exprName": {
"type": "Identifier",
"span": {
"start": 474,
"end": 484,
"ctxt": 0
},
"value": "globalThis",
"optional": false
},
"typeArguments": null
}
},
"indexType": {
"type": "TsLiteralType",
"span": {
"start": 486,
"end": 489,
"ctxt": 0
},
"literal": {
"type": "StringLiteral",
"span": {
"start": 486,
"end": 489,
"ctxt": 0
},
"value": "z",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 500,
"end": 544,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 512,
"end": 544,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 512,
"end": 519,
"ctxt": 0
},
"value": "themAll",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 519,
"end": 544,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeOperator",
"span": {
"start": 521,
"end": 544,
"ctxt": 0
},
"op": "keyof",
"typeAnnotation": {
"type": "TsTypeQuery",
"span": {
"start": 527,
"end": 544,
"ctxt": 0
},
"exprName": {
"type": "Identifier",
"span": {
"start": 534,
"end": 544,
"ctxt": 0
},
"value": "globalThis",
"optional": false
},
"typeArguments": null
}
}
}
},
"init": null,
"definite": false
}
]
}
],
"interpreter": null
}