swc/crates/swc_ecma_parser/tests/tsc/invalidNewTarget.es6.json

1073 lines
28 KiB
JSON

{
"type": "Script",
"span": {
"start": 17,
"end": 577,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 17,
"end": 38,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 23,
"end": 37,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 23,
"end": 24,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MetaProperty",
"span": {
"start": 27,
"end": 37,
"ctxt": 0
},
"kind": "new.target"
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 39,
"end": 66,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 45,
"end": 65,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 45,
"end": 46,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 49,
"end": 65,
"ctxt": 0
},
"params": [],
"body": {
"type": "MetaProperty",
"span": {
"start": 55,
"end": 65,
"ctxt": 0
},
"kind": "new.target"
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 74,
"end": 75,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 68,
"end": 411,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 82,
"end": 100,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 82,
"end": 94,
"ctxt": 0
},
"expression": {
"type": "MetaProperty",
"span": {
"start": 83,
"end": 93,
"ctxt": 0
},
"kind": "new.target"
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 82,
"end": 100,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 97,
"end": 100,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 105,
"end": 131,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 105,
"end": 106,
"ctxt": 0
},
"value": "c",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 105,
"end": 131,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 109,
"end": 131,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 111,
"end": 129,
"ctxt": 0
},
"argument": {
"type": "MetaProperty",
"span": {
"start": 118,
"end": 128,
"ctxt": 0
},
"kind": "new.target"
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 136,
"end": 166,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 140,
"end": 141,
"ctxt": 0
},
"value": "d",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 136,
"end": 166,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 144,
"end": 166,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 146,
"end": 164,
"ctxt": 0
},
"argument": {
"type": "MetaProperty",
"span": {
"start": 153,
"end": 163,
"ctxt": 0
},
"kind": "new.target"
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 171,
"end": 199,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 175,
"end": 176,
"ctxt": 0
},
"value": "e",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 177,
"end": 178,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 177,
"end": 178,
"ctxt": 0
},
"value": "_",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 171,
"end": 199,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 180,
"end": 199,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 182,
"end": 197,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 182,
"end": 196,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 182,
"end": 183,
"ctxt": 0
},
"value": "_",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "MetaProperty",
"span": {
"start": 186,
"end": 196,
"ctxt": 0
},
"kind": "new.target"
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "setter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassProperty",
"span": {
"start": 204,
"end": 225,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 204,
"end": 205,
"ctxt": 0
},
"value": "f",
"optional": false
},
"value": {
"type": "ArrowFunctionExpression",
"span": {
"start": 208,
"end": 224,
"ctxt": 0
},
"params": [],
"body": {
"type": "MetaProperty",
"span": {
"start": 214,
"end": 224,
"ctxt": 0
},
"kind": "new.target"
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 231,
"end": 256,
"ctxt": 0
},
"key": {
"type": "Computed",
"span": {
"start": 238,
"end": 250,
"ctxt": 0
},
"expression": {
"type": "MetaProperty",
"span": {
"start": 239,
"end": 249,
"ctxt": 0
},
"kind": "new.target"
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 231,
"end": 256,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 253,
"end": 256,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 261,
"end": 294,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 268,
"end": 269,
"ctxt": 0
},
"value": "g",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 261,
"end": 294,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 272,
"end": 294,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 274,
"end": 292,
"ctxt": 0
},
"argument": {
"type": "MetaProperty",
"span": {
"start": 281,
"end": 291,
"ctxt": 0
},
"kind": "new.target"
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 299,
"end": 336,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 310,
"end": 311,
"ctxt": 0
},
"value": "h",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 299,
"end": 336,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 314,
"end": 336,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 316,
"end": 334,
"ctxt": 0
},
"argument": {
"type": "MetaProperty",
"span": {
"start": 323,
"end": 333,
"ctxt": 0
},
"kind": "new.target"
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 341,
"end": 376,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 352,
"end": 353,
"ctxt": 0
},
"value": "i",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 354,
"end": 355,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 354,
"end": 355,
"ctxt": 0
},
"value": "_",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 341,
"end": 376,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 357,
"end": 376,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 359,
"end": 374,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 359,
"end": 373,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 359,
"end": 360,
"ctxt": 0
},
"value": "_",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "MetaProperty",
"span": {
"start": 363,
"end": 373,
"ctxt": 0
},
"kind": "new.target"
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "setter",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassProperty",
"span": {
"start": 381,
"end": 409,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 388,
"end": 389,
"ctxt": 0
},
"value": "j",
"optional": false
},
"value": {
"type": "ArrowFunctionExpression",
"span": {
"start": 392,
"end": 408,
"ctxt": 0
},
"params": [],
"body": {
"type": "MetaProperty",
"span": {
"start": 398,
"end": 408,
"ctxt": 0
},
"kind": "new.target"
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
},
"typeAnnotation": null,
"isStatic": true,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 413,
"end": 577,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 419,
"end": 576,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 419,
"end": 420,
"ctxt": 0
},
"value": "O",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 423,
"end": 576,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 429,
"end": 441,
"ctxt": 0
},
"expression": {
"type": "MetaProperty",
"span": {
"start": 430,
"end": 440,
"ctxt": 0
},
"kind": "new.target"
}
},
"value": {
"type": "Identifier",
"span": {
"start": 443,
"end": 452,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
},
{
"type": "MethodProperty",
"key": {
"type": "Identifier",
"span": {
"start": 458,
"end": 459,
"ctxt": 0
},
"value": "k",
"optional": false
},
"params": [],
"decorators": [],
"span": {
"start": 458,
"end": 484,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 462,
"end": 484,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 464,
"end": 482,
"ctxt": 0
},
"argument": {
"type": "MetaProperty",
"span": {
"start": 471,
"end": 481,
"ctxt": 0
},
"kind": "new.target"
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "GetterProperty",
"span": {
"start": 490,
"end": 520,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 494,
"end": 495,
"ctxt": 0
},
"value": "l",
"optional": false
},
"typeAnnotation": null,
"body": {
"type": "BlockStatement",
"span": {
"start": 498,
"end": 520,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 500,
"end": 518,
"ctxt": 0
},
"argument": {
"type": "MetaProperty",
"span": {
"start": 507,
"end": 517,
"ctxt": 0
},
"kind": "new.target"
}
}
]
}
},
{
"type": "SetterProperty",
"span": {
"start": 526,
"end": 554,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 530,
"end": 531,
"ctxt": 0
},
"value": "m",
"optional": false
},
"param": {
"type": "Identifier",
"span": {
"start": 532,
"end": 533,
"ctxt": 0
},
"value": "_",
"optional": false,
"typeAnnotation": null
},
"body": {
"type": "BlockStatement",
"span": {
"start": 535,
"end": 554,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 537,
"end": 552,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 537,
"end": 551,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 537,
"end": 538,
"ctxt": 0
},
"value": "_",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "MetaProperty",
"span": {
"start": 541,
"end": 551,
"ctxt": 0
},
"kind": "new.target"
}
}
}
]
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 560,
"end": 561,
"ctxt": 0
},
"value": "n",
"optional": false
},
"value": {
"type": "MetaProperty",
"span": {
"start": 563,
"end": 573,
"ctxt": 0
},
"kind": "new.target"
}
}
]
},
"definite": false
}
]
}
],
"interpreter": null
}