mirror of
https://github.com/swc-project/swc.git
synced 2024-11-28 11:13:43 +03:00
932 lines
23 KiB
JSON
932 lines
23 KiB
JSON
{
|
|
"type": "Module",
|
|
"span": {
|
|
"start": 115,
|
|
"end": 647,
|
|
"ctxt": 0
|
|
},
|
|
"body": [
|
|
{
|
|
"type": "TsImportEqualsDeclaration",
|
|
"span": {
|
|
"start": 115,
|
|
"end": 147,
|
|
"ctxt": 0
|
|
},
|
|
"declare": false,
|
|
"isExport": false,
|
|
"isTypeOnly": false,
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 122,
|
|
"end": 127,
|
|
"ctxt": 0
|
|
},
|
|
"value": "React",
|
|
"optional": false
|
|
},
|
|
"moduleRef": {
|
|
"type": "TsExternalModuleReference",
|
|
"span": {
|
|
"start": 130,
|
|
"end": 146,
|
|
"ctxt": 0
|
|
},
|
|
"expression": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 138,
|
|
"end": 145,
|
|
"ctxt": 0
|
|
},
|
|
"value": "react",
|
|
"raw": "'react'"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "TsInterfaceDeclaration",
|
|
"span": {
|
|
"start": 149,
|
|
"end": 200,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 159,
|
|
"end": 171,
|
|
"ctxt": 0
|
|
},
|
|
"value": "PoisonedProp",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"typeParams": null,
|
|
"extends": [],
|
|
"body": {
|
|
"type": "TsInterfaceBody",
|
|
"span": {
|
|
"start": 172,
|
|
"end": 200,
|
|
"ctxt": 0
|
|
},
|
|
"body": [
|
|
{
|
|
"type": "TsPropertySignature",
|
|
"span": {
|
|
"start": 178,
|
|
"end": 188,
|
|
"ctxt": 0
|
|
},
|
|
"readonly": false,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 178,
|
|
"end": 179,
|
|
"ctxt": 0
|
|
},
|
|
"value": "x",
|
|
"optional": false
|
|
},
|
|
"computed": false,
|
|
"optional": false,
|
|
"init": null,
|
|
"params": [],
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 179,
|
|
"end": 187,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 181,
|
|
"end": 187,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "string"
|
|
}
|
|
},
|
|
"typeParams": null
|
|
},
|
|
{
|
|
"type": "TsPropertySignature",
|
|
"span": {
|
|
"start": 193,
|
|
"end": 198,
|
|
"ctxt": 0
|
|
},
|
|
"readonly": false,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 193,
|
|
"end": 194,
|
|
"ctxt": 0
|
|
},
|
|
"value": "y",
|
|
"optional": false
|
|
},
|
|
"computed": false,
|
|
"optional": false,
|
|
"init": null,
|
|
"params": [],
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 194,
|
|
"end": 197,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsLiteralType",
|
|
"span": {
|
|
"start": 196,
|
|
"end": 197,
|
|
"ctxt": 0
|
|
},
|
|
"literal": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 196,
|
|
"end": 197,
|
|
"ctxt": 0
|
|
},
|
|
"value": 2.0
|
|
}
|
|
}
|
|
},
|
|
"typeParams": null
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "ClassDeclaration",
|
|
"identifier": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 208,
|
|
"end": 216,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Poisoned",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"span": {
|
|
"start": 202,
|
|
"end": 316,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"body": [
|
|
{
|
|
"type": "ClassMethod",
|
|
"span": {
|
|
"start": 265,
|
|
"end": 314,
|
|
"ctxt": 0
|
|
},
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 265,
|
|
"end": 271,
|
|
"ctxt": 0
|
|
},
|
|
"value": "render",
|
|
"optional": false
|
|
},
|
|
"function": {
|
|
"params": [],
|
|
"decorators": [],
|
|
"span": {
|
|
"start": 265,
|
|
"end": 314,
|
|
"ctxt": 0
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 274,
|
|
"end": 314,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 284,
|
|
"end": 308,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "JSXElement",
|
|
"span": {
|
|
"start": 291,
|
|
"end": 307,
|
|
"ctxt": 0
|
|
},
|
|
"opening": {
|
|
"type": "JSXOpeningElement",
|
|
"name": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 292,
|
|
"end": 295,
|
|
"ctxt": 0
|
|
},
|
|
"value": "div",
|
|
"optional": false
|
|
},
|
|
"span": {
|
|
"start": 291,
|
|
"end": 296,
|
|
"ctxt": 0
|
|
},
|
|
"attributes": [],
|
|
"selfClosing": false,
|
|
"typeArguments": null
|
|
},
|
|
"children": [
|
|
{
|
|
"type": "JSXText",
|
|
"span": {
|
|
"start": 296,
|
|
"end": 301,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Hello",
|
|
"raw": "Hello"
|
|
}
|
|
],
|
|
"closing": {
|
|
"type": "JSXClosingElement",
|
|
"span": {
|
|
"start": 301,
|
|
"end": 307,
|
|
"ctxt": 0
|
|
},
|
|
"name": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 303,
|
|
"end": 306,
|
|
"ctxt": 0
|
|
},
|
|
"value": "div",
|
|
"optional": false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"generator": false,
|
|
"async": false,
|
|
"typeParameters": null,
|
|
"returnType": null
|
|
},
|
|
"kind": "method",
|
|
"isStatic": false,
|
|
"accessibility": null,
|
|
"isAbstract": false,
|
|
"isOptional": false,
|
|
"isOverride": false
|
|
}
|
|
],
|
|
"superClass": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 225,
|
|
"end": 240,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 225,
|
|
"end": 230,
|
|
"ctxt": 0
|
|
},
|
|
"value": "React",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 231,
|
|
"end": 240,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Component",
|
|
"optional": false
|
|
}
|
|
},
|
|
"isAbstract": false,
|
|
"typeParams": null,
|
|
"superTypeParams": {
|
|
"type": "TsTypeParameterInstantiation",
|
|
"span": {
|
|
"start": 240,
|
|
"end": 258,
|
|
"ctxt": 0
|
|
},
|
|
"params": [
|
|
{
|
|
"type": "TsTypeReference",
|
|
"span": {
|
|
"start": 241,
|
|
"end": 253,
|
|
"ctxt": 0
|
|
},
|
|
"typeName": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 241,
|
|
"end": 253,
|
|
"ctxt": 0
|
|
},
|
|
"value": "PoisonedProp",
|
|
"optional": false
|
|
},
|
|
"typeParams": null
|
|
},
|
|
{
|
|
"type": "TsTypeLiteral",
|
|
"span": {
|
|
"start": 255,
|
|
"end": 257,
|
|
"ctxt": 0
|
|
},
|
|
"members": []
|
|
}
|
|
]
|
|
},
|
|
"implements": []
|
|
},
|
|
{
|
|
"type": "VariableDeclaration",
|
|
"span": {
|
|
"start": 318,
|
|
"end": 363,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "let",
|
|
"declare": false,
|
|
"declarations": [
|
|
{
|
|
"type": "VariableDeclarator",
|
|
"span": {
|
|
"start": 322,
|
|
"end": 362,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 322,
|
|
"end": 325,
|
|
"ctxt": 0
|
|
},
|
|
"value": "obj",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"init": {
|
|
"type": "ObjectExpression",
|
|
"span": {
|
|
"start": 328,
|
|
"end": 362,
|
|
"ctxt": 0
|
|
},
|
|
"properties": [
|
|
{
|
|
"type": "KeyValueProperty",
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 334,
|
|
"end": 335,
|
|
"ctxt": 0
|
|
},
|
|
"value": "x",
|
|
"optional": false
|
|
},
|
|
"value": {
|
|
"type": "StringLiteral",
|
|
"span": {
|
|
"start": 337,
|
|
"end": 350,
|
|
"ctxt": 0
|
|
},
|
|
"value": "hello world",
|
|
"raw": "\"hello world\""
|
|
}
|
|
},
|
|
{
|
|
"type": "KeyValueProperty",
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 356,
|
|
"end": 357,
|
|
"ctxt": 0
|
|
},
|
|
"value": "y",
|
|
"optional": false
|
|
},
|
|
"value": {
|
|
"type": "NumericLiteral",
|
|
"span": {
|
|
"start": 359,
|
|
"end": 360,
|
|
"ctxt": 0
|
|
},
|
|
"value": 2.0
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"definite": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "VariableDeclaration",
|
|
"span": {
|
|
"start": 417,
|
|
"end": 447,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "let",
|
|
"declare": false,
|
|
"declarations": [
|
|
{
|
|
"type": "VariableDeclarator",
|
|
"span": {
|
|
"start": 421,
|
|
"end": 446,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 421,
|
|
"end": 422,
|
|
"ctxt": 0
|
|
},
|
|
"value": "p",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"init": {
|
|
"type": "JSXElement",
|
|
"span": {
|
|
"start": 425,
|
|
"end": 446,
|
|
"ctxt": 0
|
|
},
|
|
"opening": {
|
|
"type": "JSXOpeningElement",
|
|
"name": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 426,
|
|
"end": 434,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Poisoned",
|
|
"optional": false
|
|
},
|
|
"span": {
|
|
"start": 425,
|
|
"end": 446,
|
|
"ctxt": 0
|
|
},
|
|
"attributes": [
|
|
{
|
|
"type": "SpreadElement",
|
|
"spread": {
|
|
"start": 436,
|
|
"end": 439,
|
|
"ctxt": 0
|
|
},
|
|
"arguments": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 439,
|
|
"end": 442,
|
|
"ctxt": 0
|
|
},
|
|
"value": "obj",
|
|
"optional": false
|
|
}
|
|
}
|
|
],
|
|
"selfClosing": true,
|
|
"typeArguments": null
|
|
},
|
|
"children": [],
|
|
"closing": null
|
|
},
|
|
"definite": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "ClassDeclaration",
|
|
"identifier": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 455,
|
|
"end": 464,
|
|
"ctxt": 0
|
|
},
|
|
"value": "EmptyProp",
|
|
"optional": false
|
|
},
|
|
"declare": false,
|
|
"span": {
|
|
"start": 449,
|
|
"end": 581,
|
|
"ctxt": 0
|
|
},
|
|
"decorators": [],
|
|
"body": [
|
|
{
|
|
"type": "ClassMethod",
|
|
"span": {
|
|
"start": 503,
|
|
"end": 557,
|
|
"ctxt": 0
|
|
},
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 503,
|
|
"end": 509,
|
|
"ctxt": 0
|
|
},
|
|
"value": "render",
|
|
"optional": false
|
|
},
|
|
"function": {
|
|
"params": [],
|
|
"decorators": [],
|
|
"span": {
|
|
"start": 503,
|
|
"end": 557,
|
|
"ctxt": 0
|
|
},
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"span": {
|
|
"start": 512,
|
|
"end": 557,
|
|
"ctxt": 0
|
|
},
|
|
"stmts": [
|
|
{
|
|
"type": "ReturnStatement",
|
|
"span": {
|
|
"start": 522,
|
|
"end": 551,
|
|
"ctxt": 0
|
|
},
|
|
"argument": {
|
|
"type": "JSXElement",
|
|
"span": {
|
|
"start": 529,
|
|
"end": 550,
|
|
"ctxt": 0
|
|
},
|
|
"opening": {
|
|
"type": "JSXOpeningElement",
|
|
"name": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 530,
|
|
"end": 533,
|
|
"ctxt": 0
|
|
},
|
|
"value": "div",
|
|
"optional": false
|
|
},
|
|
"span": {
|
|
"start": 529,
|
|
"end": 534,
|
|
"ctxt": 0
|
|
},
|
|
"attributes": [],
|
|
"selfClosing": false,
|
|
"typeArguments": null
|
|
},
|
|
"children": [
|
|
{
|
|
"type": "JSXText",
|
|
"span": {
|
|
"start": 534,
|
|
"end": 544,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Default hi",
|
|
"raw": "Default hi"
|
|
}
|
|
],
|
|
"closing": {
|
|
"type": "JSXClosingElement",
|
|
"span": {
|
|
"start": 544,
|
|
"end": 550,
|
|
"ctxt": 0
|
|
},
|
|
"name": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 546,
|
|
"end": 549,
|
|
"ctxt": 0
|
|
},
|
|
"value": "div",
|
|
"optional": false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"generator": false,
|
|
"async": false,
|
|
"typeParameters": null,
|
|
"returnType": null
|
|
},
|
|
"kind": "method",
|
|
"isStatic": false,
|
|
"accessibility": null,
|
|
"isAbstract": false,
|
|
"isOptional": false,
|
|
"isOverride": false
|
|
},
|
|
{
|
|
"type": "ClassProperty",
|
|
"span": {
|
|
"start": 562,
|
|
"end": 579,
|
|
"ctxt": 0
|
|
},
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 562,
|
|
"end": 570,
|
|
"ctxt": 0
|
|
},
|
|
"value": "greeting",
|
|
"optional": false
|
|
},
|
|
"value": null,
|
|
"typeAnnotation": {
|
|
"type": "TsTypeAnnotation",
|
|
"span": {
|
|
"start": 570,
|
|
"end": 578,
|
|
"ctxt": 0
|
|
},
|
|
"typeAnnotation": {
|
|
"type": "TsKeywordType",
|
|
"span": {
|
|
"start": 572,
|
|
"end": 578,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "string"
|
|
}
|
|
},
|
|
"isStatic": false,
|
|
"decorators": [],
|
|
"accessibility": null,
|
|
"isAbstract": false,
|
|
"isOptional": false,
|
|
"isOverride": false,
|
|
"readonly": false,
|
|
"declare": false,
|
|
"definite": false
|
|
}
|
|
],
|
|
"superClass": {
|
|
"type": "MemberExpression",
|
|
"span": {
|
|
"start": 473,
|
|
"end": 488,
|
|
"ctxt": 0
|
|
},
|
|
"object": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 473,
|
|
"end": 478,
|
|
"ctxt": 0
|
|
},
|
|
"value": "React",
|
|
"optional": false
|
|
},
|
|
"property": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 479,
|
|
"end": 488,
|
|
"ctxt": 0
|
|
},
|
|
"value": "Component",
|
|
"optional": false
|
|
}
|
|
},
|
|
"isAbstract": false,
|
|
"typeParams": null,
|
|
"superTypeParams": {
|
|
"type": "TsTypeParameterInstantiation",
|
|
"span": {
|
|
"start": 488,
|
|
"end": 496,
|
|
"ctxt": 0
|
|
},
|
|
"params": [
|
|
{
|
|
"type": "TsTypeLiteral",
|
|
"span": {
|
|
"start": 489,
|
|
"end": 491,
|
|
"ctxt": 0
|
|
},
|
|
"members": []
|
|
},
|
|
{
|
|
"type": "TsTypeLiteral",
|
|
"span": {
|
|
"start": 493,
|
|
"end": 495,
|
|
"ctxt": 0
|
|
},
|
|
"members": []
|
|
}
|
|
]
|
|
},
|
|
"implements": []
|
|
},
|
|
{
|
|
"type": "VariableDeclaration",
|
|
"span": {
|
|
"start": 583,
|
|
"end": 611,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "let",
|
|
"declare": false,
|
|
"declarations": [
|
|
{
|
|
"type": "VariableDeclarator",
|
|
"span": {
|
|
"start": 587,
|
|
"end": 611,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 587,
|
|
"end": 588,
|
|
"ctxt": 0
|
|
},
|
|
"value": "o",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"init": {
|
|
"type": "ObjectExpression",
|
|
"span": {
|
|
"start": 591,
|
|
"end": 611,
|
|
"ctxt": 0
|
|
},
|
|
"properties": [
|
|
{
|
|
"type": "KeyValueProperty",
|
|
"key": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 597,
|
|
"end": 602,
|
|
"ctxt": 0
|
|
},
|
|
"value": "prop1",
|
|
"optional": false
|
|
},
|
|
"value": {
|
|
"type": "BooleanLiteral",
|
|
"span": {
|
|
"start": 604,
|
|
"end": 609,
|
|
"ctxt": 0
|
|
},
|
|
"value": false
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"definite": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "VariableDeclaration",
|
|
"span": {
|
|
"start": 618,
|
|
"end": 647,
|
|
"ctxt": 0
|
|
},
|
|
"kind": "let",
|
|
"declare": false,
|
|
"declarations": [
|
|
{
|
|
"type": "VariableDeclarator",
|
|
"span": {
|
|
"start": 622,
|
|
"end": 646,
|
|
"ctxt": 0
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 622,
|
|
"end": 623,
|
|
"ctxt": 0
|
|
},
|
|
"value": "e",
|
|
"optional": false,
|
|
"typeAnnotation": null
|
|
},
|
|
"init": {
|
|
"type": "JSXElement",
|
|
"span": {
|
|
"start": 626,
|
|
"end": 646,
|
|
"ctxt": 0
|
|
},
|
|
"opening": {
|
|
"type": "JSXOpeningElement",
|
|
"name": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 627,
|
|
"end": 636,
|
|
"ctxt": 0
|
|
},
|
|
"value": "EmptyProp",
|
|
"optional": false
|
|
},
|
|
"span": {
|
|
"start": 626,
|
|
"end": 646,
|
|
"ctxt": 0
|
|
},
|
|
"attributes": [
|
|
{
|
|
"type": "SpreadElement",
|
|
"spread": {
|
|
"start": 638,
|
|
"end": 641,
|
|
"ctxt": 0
|
|
},
|
|
"arguments": {
|
|
"type": "Identifier",
|
|
"span": {
|
|
"start": 641,
|
|
"end": 642,
|
|
"ctxt": 0
|
|
},
|
|
"value": "o",
|
|
"optional": false
|
|
}
|
|
}
|
|
],
|
|
"selfClosing": true,
|
|
"typeArguments": null
|
|
},
|
|
"children": [],
|
|
"closing": null
|
|
},
|
|
"definite": false
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"interpreter": null
|
|
}
|