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

544 lines
14 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 16,
"end": 262,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 33,
"end": 47,
"ctxt": 0
},
"value": "extractIndexer",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 51,
"end": 72,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 51,
"end": 72,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 52,
"end": 72,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 54,
"end": 72,
"ctxt": 0
},
"members": [
{
"type": "TsIndexSignature",
"params": [
{
"type": "Identifier",
"span": {
"start": 57,
"end": 66,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 58,
"end": 66,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 60,
"end": 66,
"ctxt": 0
},
"kind": "number"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 67,
"end": 70,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 69,
"end": 70,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 69,
"end": 70,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
"readonly": false,
"static": false,
"span": {
"start": 56,
"end": 70,
"ctxt": 0
}
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 16,
"end": 77,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 47,
"end": 50,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 48,
"end": 49,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 48,
"end": 49,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 73,
"end": 76,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 75,
"end": 76,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 75,
"end": 76,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 79,
"end": 91,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 84,
"end": 85,
"ctxt": 0
},
"value": "E",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 88,
"end": 89,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 88,
"end": 89,
"ctxt": 0
},
"value": "x",
"optional": false
},
"init": null
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 93,
"end": 104,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 97,
"end": 103,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 97,
"end": 98,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 98,
"end": 103,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 100,
"end": 103,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 106,
"end": 138,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 106,
"end": 137,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 106,
"end": 120,
"ctxt": 0
},
"value": "extractIndexer",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
"start": 121,
"end": 136,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 127,
"end": 130,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 128,
"end": 129,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"value": {
"type": "StringLiteral",
"span": {
"start": 132,
"end": 134,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
]
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 164,
"end": 198,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 164,
"end": 197,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 164,
"end": 178,
"ctxt": 0
},
"value": "extractIndexer",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
"start": 179,
"end": 196,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 185,
"end": 190,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 186,
"end": 189,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 186,
"end": 187,
"ctxt": 0
},
"value": "E",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 188,
"end": 189,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
"value": {
"type": "StringLiteral",
"span": {
"start": 192,
"end": 194,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
]
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 224,
"end": 262,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 224,
"end": 261,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 224,
"end": 238,
"ctxt": 0
},
"value": "extractIndexer",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
"start": 239,
"end": 260,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 245,
"end": 254,
"ctxt": 0
},
"expression": {
"type": "BinaryExpression",
"span": {
"start": 246,
"end": 253,
"ctxt": 0
},
"operator": "||",
"left": {
"type": "StringLiteral",
"span": {
"start": 246,
"end": 248,
"ctxt": 0
},
"value": "",
"raw": "\"\""
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 252,
"end": 253,
"ctxt": 0
},
"value": 0.0
}
}
},
"value": {
"type": "StringLiteral",
"span": {
"start": 256,
"end": 258,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
]
}
}
],
"typeArguments": null
}
}
],
"interpreter": null
}