swc/crates/swc_ecma_parser/tests/tsc/symbolProperty22.json
2022-03-22 07:54:08 +00:00

586 lines
15 KiB
JSON

{
"type": "Script",
"span": {
"start": 15,
"end": 174,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 15,
"end": 71,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 25,
"end": 26,
"ctxt": 0
},
"value": "I",
"optional": false
},
"declare": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 26,
"end": 32,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 27,
"end": 28,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 27,
"end": 28,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 30,
"end": 31,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 30,
"end": 31,
"ctxt": 0
},
"value": "U",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 33,
"end": 71,
"ctxt": 0
},
"body": [
{
"type": "TsMethodSignature",
"span": {
"start": 39,
"end": 69,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "MemberExpression",
"span": {
"start": 40,
"end": 58,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 40,
"end": 46,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 47,
"end": 58,
"ctxt": 0
},
"value": "unscopables",
"optional": false
}
},
"computed": true,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 60,
"end": 64,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 61,
"end": 64,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 63,
"end": 64,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 63,
"end": 64,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 65,
"end": 68,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 67,
"end": 68,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 67,
"end": 68,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 90,
"end": 93,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 100,
"end": 105,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 100,
"end": 105,
"ctxt": 0
},
"value": "p1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 102,
"end": 105,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 104,
"end": 105,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 104,
"end": 105,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 107,
"end": 118,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 107,
"end": 118,
"ctxt": 0
},
"value": "p2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 109,
"end": 118,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 111,
"end": 118,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 111,
"end": 112,
"ctxt": 0
},
"value": "I",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 112,
"end": 118,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 113,
"end": 114,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 113,
"end": 114,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 116,
"end": 117,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 116,
"end": 117,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
],
"decorators": [],
"span": {
"start": 73,
"end": 123,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 93,
"end": 99,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 94,
"end": 95,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 94,
"end": 95,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 97,
"end": 98,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 97,
"end": 98,
"ctxt": 0
},
"value": "U",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 119,
"end": 122,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 121,
"end": 122,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 121,
"end": 122,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 125,
"end": 174,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 125,
"end": 173,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 125,
"end": 128,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 129,
"end": 131,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
},
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
"start": 133,
"end": 172,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 135,
"end": 155,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 136,
"end": 154,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 136,
"end": 142,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 143,
"end": 154,
"ctxt": 0
},
"value": "unscopables",
"optional": false
}
}
},
"value": {
"type": "ArrowFunctionExpression",
"span": {
"start": 157,
"end": 170,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 157,
"end": 158,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "MemberExpression",
"span": {
"start": 162,
"end": 170,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 162,
"end": 163,
"ctxt": 0
},
"value": "s",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 164,
"end": 170,
"ctxt": 0
},
"value": "length",
"optional": false
}
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
]
}
}
],
"typeArguments": null
}
}
],
"interpreter": null
}