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

598 lines
16 KiB
JSON

{
"type": "Script",
"span": {
"start": 16,
"end": 175,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 16,
"end": 72,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 26,
"end": 27,
"ctxt": 0
},
"value": "I",
"optional": false
},
"declare": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 27,
"end": 33,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 28,
"end": 29,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 28,
"end": 29,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 31,
"end": 32,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 31,
"end": 32,
"ctxt": 0
},
"value": "U",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 34,
"end": 72,
"ctxt": 0
},
"body": [
{
"type": "TsMethodSignature",
"span": {
"start": 40,
"end": 70,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "MemberExpression",
"span": {
"start": 41,
"end": 59,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 41,
"end": 47,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 48,
"end": 59,
"ctxt": 0
},
"value": "unscopables",
"optional": false
}
},
"computed": true,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 61,
"end": 65,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 62,
"end": 65,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 64,
"end": 65,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 64,
"end": 65,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 66,
"end": 69,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 68,
"end": 69,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 68,
"end": 69,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
}
]
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 91,
"end": 94,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 101,
"end": 106,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 101,
"end": 106,
"ctxt": 0
},
"value": "p1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 103,
"end": 106,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 105,
"end": 106,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 105,
"end": 106,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 108,
"end": 119,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 108,
"end": 119,
"ctxt": 0
},
"value": "p2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 110,
"end": 119,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 112,
"end": 119,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 112,
"end": 113,
"ctxt": 0
},
"value": "I",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 113,
"end": 119,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 114,
"end": 115,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 114,
"end": 115,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 117,
"end": 118,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 117,
"end": 118,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
],
"decorators": [],
"span": {
"start": 74,
"end": 124,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 94,
"end": 100,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 95,
"end": 96,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 95,
"end": 96,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
},
{
"type": "TsTypeParameter",
"span": {
"start": 98,
"end": 99,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 98,
"end": 99,
"ctxt": 0
},
"value": "U",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 120,
"end": 123,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 122,
"end": 123,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 122,
"end": 123,
"ctxt": 0
},
"value": "U",
"optional": false
},
"typeParams": null
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 126,
"end": 175,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 126,
"end": 174,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 126,
"end": 129,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 130,
"end": 132,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
},
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
"start": 134,
"end": 173,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 136,
"end": 156,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 137,
"end": 155,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 137,
"end": 143,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 144,
"end": 155,
"ctxt": 0
},
"value": "unscopables",
"optional": false
}
}
},
"value": {
"type": "ArrowFunctionExpression",
"span": {
"start": 158,
"end": 171,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 158,
"end": 159,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "MemberExpression",
"span": {
"start": 163,
"end": 171,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 163,
"end": 164,
"ctxt": 0
},
"value": "s",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 165,
"end": 171,
"ctxt": 0
},
"value": "length",
"optional": false
}
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
]
}
}
],
"typeArguments": null
}
}
],
"interpreter": null
}