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

298 lines
6.3 KiB
JSON

{
"type": "Script",
"span": {
"start": 1,
"end": 148,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 7,
"end": 10,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"declare": false,
"span": {
"start": 1,
"end": 14,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 32,
"end": 34,
"ctxt": 0
},
"value": "as",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 35,
"end": 49,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 35,
"end": 49,
"ctxt": 0
},
"rest": {
"start": 35,
"end": 38,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 38,
"end": 42,
"ctxt": 0
},
"value": "args",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 42,
"end": 49,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 44,
"end": 49,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 44,
"end": 47,
"ctxt": 0
},
"kind": "any"
}
}
}
}
}
],
"decorators": [],
"span": {
"start": 15,
"end": 51,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "VariableDeclaration",
"span": {
"start": 66,
"end": 76,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 70,
"end": 76,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 70,
"end": 71,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 74,
"end": 76,
"ctxt": 0
},
"value": 10.0,
"raw": "10"
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 77,
"end": 94,
"ctxt": 0
},
"expression": {
"type": "TaggedTemplateExpression",
"span": {
"start": 77,
"end": 93,
"ctxt": 0
},
"tag": {
"type": "Identifier",
"span": {
"start": 77,
"end": 79,
"ctxt": 0
},
"value": "as",
"optional": false
},
"typeParameters": null,
"template": {
"type": "TemplateLiteral",
"span": {
"start": 80,
"end": 93,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 81,
"end": 92,
"ctxt": 0
},
"tail": true,
"cooked": "Hello world",
"raw": "Hello world"
}
]
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 129,
"end": 139,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 133,
"end": 139,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 133,
"end": 134,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 137,
"end": 139,
"ctxt": 0
},
"value": 20.0,
"raw": "20"
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 140,
"end": 148,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 140,
"end": 147,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 140,
"end": 142,
"ctxt": 0
},
"value": "as",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 143,
"end": 146,
"ctxt": 0
},
"value": "Foo",
"optional": false
}
}
],
"typeArguments": null
}
}
],
"interpreter": null
}