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

712 lines
19 KiB
JSON
Raw Normal View History

{
"type": "Module",
"span": {
"start": 128,
"end": 619,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 128,
"end": 157,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 134,
"end": 156,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 134,
"end": 145,
"ctxt": 0
},
"value": "TopLevelSym",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 148,
"end": 156,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 148,
"end": 154,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 158,
"end": 184,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 164,
"end": 183,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 164,
"end": 172,
"ctxt": 0
},
"value": "InnerSym",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 175,
"end": 183,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 175,
"end": 181,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 185,
"end": 322,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 185,
"end": 322,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 185,
"end": 199,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 185,
"end": 191,
"ctxt": 0
},
"value": "module",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 192,
"end": 199,
"ctxt": 0
},
"value": "exports",
"optional": false
}
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 202,
"end": 322,
"ctxt": 0
},
"properties": [
{
"type": "MethodProperty",
"key": {
"type": "Computed",
"span": {
"start": 208,
"end": 221,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 209,
"end": 220,
"ctxt": 0
},
"value": "TopLevelSym",
"optional": false
}
},
"params": [
{
"type": "Parameter",
"span": {
"start": 222,
"end": 228,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "AssignmentPattern",
"span": {
"start": 222,
"end": 228,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 222,
"end": 223,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 226,
"end": 228,
"ctxt": 0
},
"value": 12.0
},
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 208,
"end": 255,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 230,
"end": 255,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 240,
"end": 249,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 247,
"end": 248,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 261,
"end": 266,
"ctxt": 0
},
"value": "items",
"optional": false
},
"value": {
"type": "ObjectExpression",
"span": {
"start": 268,
"end": 320,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 278,
"end": 288,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 279,
"end": 287,
"ctxt": 0
},
"value": "InnerSym",
"optional": false
}
},
"value": {
"type": "ArrowFunctionExpression",
"span": {
"start": 290,
"end": 314,
"ctxt": 0
},
"params": [
{
"type": "AssignmentPattern",
"span": {
"start": 291,
"end": 304,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 291,
"end": 294,
"ctxt": 0
},
"value": "arg",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 297,
"end": 304,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 298,
"end": 299,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 301,
"end": 303,
"ctxt": 0
},
"value": 12.0
}
}
]
},
"typeAnnotation": null
}
],
"body": {
"type": "MemberExpression",
"span": {
"start": 309,
"end": 314,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 309,
"end": 312,
"ctxt": 0
},
"value": "arg",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 313,
"end": 314,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
]
}
}
]
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 348,
"end": 377,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 354,
"end": 376,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 354,
"end": 365,
"ctxt": 0
},
"value": "TopLevelSym",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 368,
"end": 376,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 368,
"end": 374,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 378,
"end": 404,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 384,
"end": 403,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 384,
"end": 392,
"ctxt": 0
},
"value": "InnerSym",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 395,
"end": 403,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 395,
"end": 401,
"ctxt": 0
},
"value": "Symbol",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExportDeclaration",
"span": {
"start": 406,
"end": 619,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 419,
"end": 426,
"ctxt": 0
},
"value": "MyClass",
"optional": false
},
"declare": false,
"span": {
"start": 413,
"end": 619,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 433,
"end": 459,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 440,
"end": 453,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 441,
"end": 452,
"ctxt": 0
},
"value": "TopLevelSym",
"optional": false
}
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 456,
"end": 458,
"ctxt": 0
},
"value": 12.0
},
"typeAnnotation": null,
"isStatic": true,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 464,
"end": 482,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 464,
"end": 474,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 465,
"end": 473,
"ctxt": 0
},
"value": "InnerSym",
"optional": false
}
},
"value": {
"type": "StringLiteral",
"span": {
"start": 477,
"end": 481,
"ctxt": 0
},
"value": "ok",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "Constructor",
"span": {
"start": 559,
"end": 617,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 559,
"end": 570,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 571,
"end": 584,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "AssignmentPattern",
"span": {
"start": 571,
"end": 584,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 571,
"end": 573,
"ctxt": 0
},
"value": "_p",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 576,
"end": 584,
"ctxt": 0
},
"value": "InnerSym",
"optional": false
},
"typeAnnotation": null
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 586,
"end": 617,
"ctxt": 0
},
"stmts": []
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
}
],
"interpreter": null
}