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

732 lines
17 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 34,
"end": 275,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 34,
"end": 45,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 38,
"end": 44,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 38,
"end": 39,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 42,
"end": 44,
"ctxt": 0
},
"elements": []
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 46,
"end": 67,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 50,
"end": 66,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 50,
"end": 51,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 54,
"end": 66,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 58,
"end": 63,
"ctxt": 0
},
"value": "Array",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 64,
"end": 65,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 69,
"end": 81,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 73,
"end": 80,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 73,
"end": 74,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 77,
"end": 80,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 78,
"end": 79,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 82,
"end": 97,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 86,
"end": 96,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 86,
"end": 87,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 90,
"end": 96,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 91,
"end": 92,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 94,
"end": 95,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 98,
"end": 126,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 102,
"end": 125,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 102,
"end": 103,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 106,
"end": 125,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 110,
"end": 115,
"ctxt": 0
},
"value": "Array",
"optional": false
},
"arguments": [],
"typeArguments": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 115,
"end": 123,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 116,
"end": 122,
"ctxt": 0
},
"kind": "number"
}
]
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 128,
"end": 150,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 132,
"end": 149,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 132,
"end": 134,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 134,
"end": 144,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 136,
"end": 144,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 136,
"end": 142,
"ctxt": 0
},
"kind": "number"
}
}
}
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 147,
"end": 149,
"ctxt": 0
},
"elements": []
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 151,
"end": 183,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 155,
"end": 182,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 155,
"end": 157,
"ctxt": 0
},
"value": "x2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 157,
"end": 167,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 159,
"end": 167,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 159,
"end": 165,
"ctxt": 0
},
"kind": "number"
}
}
}
},
"init": {
"type": "NewExpression",
"span": {
"start": 170,
"end": 182,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 174,
"end": 179,
"ctxt": 0
},
"value": "Array",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 180,
"end": 181,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 185,
"end": 208,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 189,
"end": 207,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 189,
"end": 191,
"ctxt": 0
},
"value": "y2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 191,
"end": 201,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 193,
"end": 201,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 193,
"end": 199,
"ctxt": 0
},
"kind": "number"
}
}
}
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 204,
"end": 207,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 205,
"end": 206,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 209,
"end": 235,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 213,
"end": 234,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 213,
"end": 215,
"ctxt": 0
},
"value": "y2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 215,
"end": 225,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 217,
"end": 225,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 217,
"end": 223,
"ctxt": 0
},
"kind": "number"
}
}
}
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 228,
"end": 234,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 229,
"end": 230,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 232,
"end": 233,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 236,
"end": 275,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 240,
"end": 274,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 240,
"end": 242,
"ctxt": 0
},
"value": "y2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 242,
"end": 252,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 244,
"end": 252,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 244,
"end": 250,
"ctxt": 0
},
"kind": "number"
}
}
}
},
"init": {
"type": "NewExpression",
"span": {
"start": 255,
"end": 274,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 259,
"end": 264,
"ctxt": 0
},
"value": "Array",
"optional": false
},
"arguments": [],
"typeArguments": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 264,
"end": 272,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 265,
"end": 271,
"ctxt": 0
},
"kind": "number"
}
]
}
},
"definite": false
}
]
}
],
"interpreter": null
}