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

506 lines
13 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 238,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 0,
"end": 26,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 4,
"end": 25,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 4,
"end": 14,
"ctxt": 0
},
"properties": [
{
"type": "RestElement",
"span": {
"start": 5,
"end": 9,
"ctxt": 0
},
"rest": {
"start": 5,
"end": 8,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 8,
"end": 9,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
},
{
"type": "AssignmentPatternProperty",
"span": {
"start": 11,
"end": 12,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 11,
"end": 12,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 17,
"end": 25,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 19,
"end": 20,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 22,
"end": 23,
"ctxt": 0
},
"value": 1.0
}
}
]
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 67,
"end": 91,
"ctxt": 0
},
"expression": {
"type": "ParenthesisExpression",
"span": {
"start": 67,
"end": 90,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 68,
"end": 89,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "ObjectPattern",
"span": {
"start": 68,
"end": 78,
"ctxt": 0
},
"properties": [
{
"type": "RestElement",
"span": {
"start": 69,
"end": 73,
"ctxt": 0
},
"rest": {
"start": 69,
"end": 72,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 72,
"end": 73,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
},
{
"type": "AssignmentPatternProperty",
"span": {
"start": 75,
"end": 76,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 75,
"end": 76,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": null
}
],
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 81,
"end": 89,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 83,
"end": 84,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 86,
"end": 87,
"ctxt": 0
},
"value": 1.0
}
}
]
}
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 135,
"end": 167,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 139,
"end": 166,
"ctxt": 0
},
"id": {
"type": "ObjectPattern",
"span": {
"start": 139,
"end": 155,
"ctxt": 0
},
"properties": [
{
"type": "RestElement",
"span": {
"start": 140,
"end": 144,
"ctxt": 0
},
"rest": {
"start": 140,
"end": 143,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 143,
"end": 144,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
},
{
"type": "AssignmentPatternProperty",
"span": {
"start": 146,
"end": 147,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 146,
"end": 147,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": null
},
{
"type": "RestElement",
"span": {
"start": 149,
"end": 153,
"ctxt": 0
},
"rest": {
"start": 149,
"end": 152,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 152,
"end": 153,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 158,
"end": 166,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 160,
"end": 161,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 163,
"end": 164,
"ctxt": 0
},
"value": 1.0
}
}
]
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 208,
"end": 238,
"ctxt": 0
},
"expression": {
"type": "ParenthesisExpression",
"span": {
"start": 208,
"end": 237,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 209,
"end": 236,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "ObjectPattern",
"span": {
"start": 209,
"end": 225,
"ctxt": 0
},
"properties": [
{
"type": "RestElement",
"span": {
"start": 210,
"end": 214,
"ctxt": 0
},
"rest": {
"start": 210,
"end": 213,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 213,
"end": 214,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
},
{
"type": "AssignmentPatternProperty",
"span": {
"start": 216,
"end": 217,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 216,
"end": 217,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": null
},
{
"type": "RestElement",
"span": {
"start": 219,
"end": 223,
"ctxt": 0
},
"rest": {
"start": 219,
"end": 222,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 222,
"end": 223,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": null
}
],
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 228,
"end": 236,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 230,
"end": 231,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 233,
"end": 234,
"ctxt": 0
},
"value": 1.0
}
}
]
}
}
}
}
],
"interpreter": null
}