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

1025 lines
24 KiB
JSON

{
"type": "Script",
"span": {
"start": 58,
"end": 467,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 58,
"end": 76,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 62,
"end": 75,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 62,
"end": 70,
"ctxt": 0
},
"value": "variable",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 73,
"end": 75,
"ctxt": 0
},
"properties": []
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 77,
"end": 92,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 77,
"end": 91,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 77,
"end": 87,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 77,
"end": 85,
"ctxt": 0
},
"value": "variable",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 86,
"end": 87,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 90,
"end": 91,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 100,
"end": 101,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 94,
"end": 212,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 108,
"end": 131,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 108,
"end": 125,
"ctxt": 0
},
"value": "initializedMember",
"optional": false
},
"value": {
"type": "ObjectExpression",
"span": {
"start": 128,
"end": 130,
"ctxt": 0
},
"properties": []
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "Constructor",
"span": {
"start": 136,
"end": 210,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 136,
"end": 147,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 150,
"end": 210,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 160,
"end": 177,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 160,
"end": 176,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 160,
"end": 171,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 160,
"end": 164,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 165,
"end": 171,
"ctxt": 0
},
"value": "member",
"optional": false
}
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 174,
"end": 176,
"ctxt": 0
},
"properties": []
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 186,
"end": 204,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 186,
"end": 203,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 186,
"end": 199,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 186,
"end": 197,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 186,
"end": 190,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 191,
"end": 197,
"ctxt": 0
},
"value": "member",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 198,
"end": 199,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 202,
"end": 203,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
}
]
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 214,
"end": 245,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 218,
"end": 244,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 218,
"end": 221,
"ctxt": 0
},
"value": "obj",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 224,
"end": 244,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 230,
"end": 238,
"ctxt": 0
},
"value": "property",
"optional": false
},
"value": {
"type": "ObjectExpression",
"span": {
"start": 240,
"end": 242,
"ctxt": 0
},
"properties": []
}
}
]
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 247,
"end": 266,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 247,
"end": 265,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 247,
"end": 261,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 247,
"end": 259,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 247,
"end": 250,
"ctxt": 0
},
"value": "obj",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 251,
"end": 259,
"ctxt": 0
},
"value": "property",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 260,
"end": 261,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 264,
"end": 265,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 268,
"end": 283,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 272,
"end": 282,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 272,
"end": 275,
"ctxt": 0
},
"value": "arr",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 278,
"end": 282,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
"start": 279,
"end": 281,
"ctxt": 0
},
"properties": []
}
}
]
},
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 294,
"end": 300,
"ctxt": 0
},
"value": "getObj",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 285,
"end": 321,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 303,
"end": 321,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 309,
"end": 319,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
"start": 316,
"end": 318,
"ctxt": 0
},
"properties": []
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 343,
"end": 358,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 343,
"end": 357,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 343,
"end": 353,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 343,
"end": 351,
"ctxt": 0
},
"value": "variable",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 352,
"end": 353,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 356,
"end": 357,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 359,
"end": 382,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 359,
"end": 381,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 359,
"end": 377,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 359,
"end": 375,
"ctxt": 0
},
"object": {
"type": "ParenthesisExpression",
"span": {
"start": 359,
"end": 368,
"ctxt": 0
},
"expression": {
"type": "NewExpression",
"span": {
"start": 360,
"end": 367,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 364,
"end": 365,
"ctxt": 0
},
"value": "C",
"optional": false
},
"arguments": [],
"typeArguments": null
}
},
"property": {
"type": "Identifier",
"span": {
"start": 369,
"end": 375,
"ctxt": 0
},
"value": "member",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 376,
"end": 377,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 380,
"end": 381,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 383,
"end": 417,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 383,
"end": 416,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 383,
"end": 412,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 383,
"end": 410,
"ctxt": 0
},
"object": {
"type": "ParenthesisExpression",
"span": {
"start": 383,
"end": 392,
"ctxt": 0
},
"expression": {
"type": "NewExpression",
"span": {
"start": 384,
"end": 391,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 388,
"end": 389,
"ctxt": 0
},
"value": "C",
"optional": false
},
"arguments": [],
"typeArguments": null
}
},
"property": {
"type": "Identifier",
"span": {
"start": 393,
"end": 410,
"ctxt": 0
},
"value": "initializedMember",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 411,
"end": 412,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 415,
"end": 416,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 418,
"end": 437,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 418,
"end": 436,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 418,
"end": 432,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 418,
"end": 430,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 418,
"end": 421,
"ctxt": 0
},
"value": "obj",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 422,
"end": 430,
"ctxt": 0
},
"value": "property",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 431,
"end": 432,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 435,
"end": 436,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 438,
"end": 451,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 438,
"end": 450,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 438,
"end": 446,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 438,
"end": 444,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 438,
"end": 441,
"ctxt": 0
},
"value": "arr",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 441,
"end": 444,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 442,
"end": 443,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
},
"property": {
"type": "Identifier",
"span": {
"start": 445,
"end": 446,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 449,
"end": 450,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 452,
"end": 467,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 452,
"end": 466,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 452,
"end": 462,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 452,
"end": 460,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 452,
"end": 458,
"ctxt": 0
},
"value": "getObj",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Identifier",
"span": {
"start": 461,
"end": 462,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 465,
"end": 466,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
],
"interpreter": null
}