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

1015 lines
24 KiB
JSON

{
"type": "Script",
"span": {
"start": 57,
"end": 466,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 57,
"end": 75,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 61,
"end": 74,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 61,
"end": 69,
"ctxt": 0
},
"value": "variable",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 72,
"end": 74,
"ctxt": 0
},
"properties": []
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 76,
"end": 91,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 76,
"end": 90,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 76,
"end": 86,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 76,
"end": 84,
"ctxt": 0
},
"value": "variable",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 85,
"end": 86,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 89,
"end": 90,
"ctxt": 0
},
"value": 0.0
}
}
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 99,
"end": 100,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 93,
"end": 211,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 107,
"end": 130,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 107,
"end": 124,
"ctxt": 0
},
"value": "initializedMember",
"optional": false
},
"value": {
"type": "ObjectExpression",
"span": {
"start": 127,
"end": 129,
"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": 135,
"end": 209,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 135,
"end": 146,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 149,
"end": 209,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 159,
"end": 176,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 159,
"end": 175,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 159,
"end": 170,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 159,
"end": 163,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 164,
"end": 170,
"ctxt": 0
},
"value": "member",
"optional": false
}
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 173,
"end": 175,
"ctxt": 0
},
"properties": []
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 185,
"end": 203,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 185,
"end": 202,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 185,
"end": 198,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 185,
"end": 196,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 185,
"end": 189,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 190,
"end": 196,
"ctxt": 0
},
"value": "member",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 197,
"end": 198,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 201,
"end": 202,
"ctxt": 0
},
"value": 0.0
}
}
}
]
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 213,
"end": 244,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 217,
"end": 243,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 217,
"end": 220,
"ctxt": 0
},
"value": "obj",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 223,
"end": 243,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 229,
"end": 237,
"ctxt": 0
},
"value": "property",
"optional": false
},
"value": {
"type": "ObjectExpression",
"span": {
"start": 239,
"end": 241,
"ctxt": 0
},
"properties": []
}
}
]
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 246,
"end": 265,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 246,
"end": 264,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 246,
"end": 260,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 246,
"end": 258,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 246,
"end": 249,
"ctxt": 0
},
"value": "obj",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 250,
"end": 258,
"ctxt": 0
},
"value": "property",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 259,
"end": 260,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 263,
"end": 264,
"ctxt": 0
},
"value": 0.0
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 267,
"end": 282,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 271,
"end": 281,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 271,
"end": 274,
"ctxt": 0
},
"value": "arr",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 277,
"end": 281,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
"start": 278,
"end": 280,
"ctxt": 0
},
"properties": []
}
}
]
},
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 293,
"end": 299,
"ctxt": 0
},
"value": "getObj",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 284,
"end": 320,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 302,
"end": 320,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 308,
"end": 318,
"ctxt": 0
},
"argument": {
"type": "ObjectExpression",
"span": {
"start": 315,
"end": 317,
"ctxt": 0
},
"properties": []
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 342,
"end": 357,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 342,
"end": 356,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 342,
"end": 352,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 342,
"end": 350,
"ctxt": 0
},
"value": "variable",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 351,
"end": 352,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 355,
"end": 356,
"ctxt": 0
},
"value": 1.0
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 358,
"end": 381,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 358,
"end": 380,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 358,
"end": 376,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 358,
"end": 374,
"ctxt": 0
},
"object": {
"type": "ParenthesisExpression",
"span": {
"start": 358,
"end": 367,
"ctxt": 0
},
"expression": {
"type": "NewExpression",
"span": {
"start": 359,
"end": 366,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 363,
"end": 364,
"ctxt": 0
},
"value": "C",
"optional": false
},
"arguments": [],
"typeArguments": null
}
},
"property": {
"type": "Identifier",
"span": {
"start": 368,
"end": 374,
"ctxt": 0
},
"value": "member",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 375,
"end": 376,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 379,
"end": 380,
"ctxt": 0
},
"value": 1.0
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 382,
"end": 416,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 382,
"end": 415,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 382,
"end": 411,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 382,
"end": 409,
"ctxt": 0
},
"object": {
"type": "ParenthesisExpression",
"span": {
"start": 382,
"end": 391,
"ctxt": 0
},
"expression": {
"type": "NewExpression",
"span": {
"start": 383,
"end": 390,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 387,
"end": 388,
"ctxt": 0
},
"value": "C",
"optional": false
},
"arguments": [],
"typeArguments": null
}
},
"property": {
"type": "Identifier",
"span": {
"start": 392,
"end": 409,
"ctxt": 0
},
"value": "initializedMember",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 410,
"end": 411,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 414,
"end": 415,
"ctxt": 0
},
"value": 1.0
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 417,
"end": 436,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 417,
"end": 435,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 417,
"end": 431,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 417,
"end": 429,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 417,
"end": 420,
"ctxt": 0
},
"value": "obj",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 421,
"end": 429,
"ctxt": 0
},
"value": "property",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 430,
"end": 431,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 434,
"end": 435,
"ctxt": 0
},
"value": 1.0
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 437,
"end": 450,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 437,
"end": 449,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 437,
"end": 445,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 437,
"end": 443,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 437,
"end": 440,
"ctxt": 0
},
"value": "arr",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 440,
"end": 443,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 441,
"end": 442,
"ctxt": 0
},
"value": 0.0
}
}
},
"property": {
"type": "Identifier",
"span": {
"start": 444,
"end": 445,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 448,
"end": 449,
"ctxt": 0
},
"value": 1.0
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 451,
"end": 466,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 451,
"end": 465,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 451,
"end": 461,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 451,
"end": 459,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 451,
"end": 457,
"ctxt": 0
},
"value": "getObj",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"property": {
"type": "Identifier",
"span": {
"start": 460,
"end": 461,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 464,
"end": 465,
"ctxt": 0
},
"value": 1.0
}
}
}
],
"interpreter": null
}