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

823 lines
25 KiB
JSON

{
"type": "Script",
"span": {
"start": 108,
"end": 387,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 117,
"end": 121,
"ctxt": 0
},
"value": "test",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 122,
"end": 226,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "ObjectPattern",
"span": {
"start": 122,
"end": 226,
"ctxt": 0
},
"properties": [
{
"type": "AssignmentPatternProperty",
"span": {
"start": 128,
"end": 140,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 128,
"end": 134,
"ctxt": 0
},
"value": "method",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 137,
"end": 140,
"ctxt": 0
},
"value": "z",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
{
"type": "KeyValuePatternProperty",
"key": {
"type": "Identifier",
"span": {
"start": 146,
"end": 152,
"ctxt": 0
},
"value": "nested",
"optional": false
},
"value": {
"type": "ObjectPattern",
"span": {
"start": 154,
"end": 165,
"ctxt": 0
},
"properties": [
{
"type": "AssignmentPatternProperty",
"span": {
"start": 156,
"end": 163,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 156,
"end": 157,
"ctxt": 0
},
"value": "p",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 160,
"end": 163,
"ctxt": 0
},
"value": "c",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"optional": false,
"typeAnnotation": null
}
}
],
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 167,
"end": 226,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 169,
"end": 226,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 175,
"end": 194,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 175,
"end": 181,
"ctxt": 0
},
"value": "method",
"optional": false
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 182,
"end": 193,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 184,
"end": 193,
"ctxt": 0
},
"types": [
{
"type": "TsLiteralType",
"span": {
"start": 184,
"end": 187,
"ctxt": 0
},
"literal": {
"type": "StringLiteral",
"span": {
"start": 184,
"end": 187,
"ctxt": 0
},
"value": "x",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
{
"type": "TsLiteralType",
"span": {
"start": 190,
"end": 193,
"ctxt": 0
},
"literal": {
"type": "StringLiteral",
"span": {
"start": 190,
"end": 193,
"ctxt": 0
},
"value": "y",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 199,
"end": 224,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 199,
"end": 205,
"ctxt": 0
},
"value": "nested",
"optional": false
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 206,
"end": 224,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 208,
"end": 224,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 210,
"end": 222,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 210,
"end": 211,
"ctxt": 0
},
"value": "p",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 211,
"end": 222,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 213,
"end": 222,
"ctxt": 0
},
"types": [
{
"type": "TsLiteralType",
"span": {
"start": 213,
"end": 216,
"ctxt": 0
},
"literal": {
"type": "StringLiteral",
"span": {
"start": 213,
"end": 216,
"ctxt": 0
},
"value": "a",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
{
"type": "TsLiteralType",
"span": {
"start": 219,
"end": 222,
"ctxt": 0
},
"literal": {
"type": "StringLiteral",
"span": {
"start": 219,
"end": 222,
"ctxt": 0
},
"value": "b",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
}
},
"typeParams": null
}
]
}
},
"typeParams": null
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 108,
"end": 248,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 228,
"end": 248,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 234,
"end": 240,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 234,
"end": 240,
"ctxt": 0
},
"value": "method",
"optional": false
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 245,
"end": 246,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 245,
"end": 246,
"ctxt": 0
},
"value": "p",
"optional": false
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 250,
"end": 259,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 250,
"end": 258,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 250,
"end": 254,
"ctxt": 0
},
"value": "test",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
"start": 255,
"end": 257,
"ctxt": 0
},
"properties": []
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 260,
"end": 301,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 260,
"end": 301,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 260,
"end": 264,
"ctxt": 0
},
"value": "test",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
"start": 265,
"end": 300,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 267,
"end": 273,
"ctxt": 0
},
"value": "method",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 275,
"end": 278,
"ctxt": 0
},
"value": "x",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 280,
"end": 286,
"ctxt": 0
},
"value": "nested",
"optional": false
},
"value": {
"type": "ObjectExpression",
"span": {
"start": 288,
"end": 298,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 290,
"end": 291,
"ctxt": 0
},
"value": "p",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 293,
"end": 296,
"ctxt": 0
},
"value": "a",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
}
}
]
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 302,
"end": 343,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 302,
"end": 343,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 302,
"end": 306,
"ctxt": 0
},
"value": "test",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
"start": 307,
"end": 342,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 309,
"end": 315,
"ctxt": 0
},
"value": "method",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 317,
"end": 320,
"ctxt": 0
},
"value": "z",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 322,
"end": 328,
"ctxt": 0
},
"value": "nested",
"optional": false
},
"value": {
"type": "ObjectExpression",
"span": {
"start": 330,
"end": 340,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 332,
"end": 333,
"ctxt": 0
},
"value": "p",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 335,
"end": 338,
"ctxt": 0
},
"value": "b",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
}
}
]
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 344,
"end": 387,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 344,
"end": 387,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 344,
"end": 348,
"ctxt": 0
},
"value": "test",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ObjectExpression",
"span": {
"start": 349,
"end": 386,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 351,
"end": 357,
"ctxt": 0
},
"value": "method",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 359,
"end": 364,
"ctxt": 0
},
"value": "one",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 366,
"end": 372,
"ctxt": 0
},
"value": "nested",
"optional": false
},
"value": {
"type": "ObjectExpression",
"span": {
"start": 374,
"end": 384,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 376,
"end": 377,
"ctxt": 0
},
"value": "p",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 379,
"end": 382,
"ctxt": 0
},
"value": "a",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
}
}
]
}
}
],
"typeArguments": null
}
}
],
"interpreter": null
}