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

406 lines
9.6 KiB
JSON

{
"type": "Script",
"span": {
"start": 1,
"end": 134,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 1,
"end": 12,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 5,
"end": 11,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 5,
"end": 6,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "StringLiteral",
"span": {
"start": 9,
"end": 11,
"ctxt": 0
},
"value": "",
"raw": "''"
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 13,
"end": 33,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 17,
"end": 32,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 17,
"end": 18,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 21,
"end": 32,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 21,
"end": 29,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 21,
"end": 22,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 23,
"end": 29,
"ctxt": 0
},
"value": "charAt",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 30,
"end": 31,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 34,
"end": 69,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 38,
"end": 68,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 38,
"end": 39,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 42,
"end": 68,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 42,
"end": 58,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 42,
"end": 43,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 44,
"end": 58,
"ctxt": 0
},
"value": "hasOwnProperty",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 59,
"end": 67,
"ctxt": 0
},
"value": "charAt",
"raw": "'charAt'"
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 71,
"end": 94,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 75,
"end": 93,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 75,
"end": 76,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 79,
"end": 93,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 79,
"end": 90,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 79,
"end": 80,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 80,
"end": 90,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 81,
"end": 89,
"ctxt": 0
},
"value": "charAt",
"raw": "'charAt'"
}
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 91,
"end": 92,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 95,
"end": 134,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 99,
"end": 133,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 99,
"end": 100,
"ctxt": 0
},
"value": "e",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 103,
"end": 133,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 103,
"end": 122,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 103,
"end": 104,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 104,
"end": 122,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 105,
"end": 121,
"ctxt": 0
},
"value": "hasOwnProperty",
"raw": "'hasOwnProperty'"
}
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 123,
"end": 132,
"ctxt": 0
},
"value": "toFixed",
"raw": "'toFixed'"
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
],
"interpreter": null
}