swc/crates/swc_ecma_parser/tests/tsc/parser509534.json
2022-03-22 07:54:08 +00:00

469 lines
15 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 292,
"ctxt": 0
},
"body": [
{
"type": "ExpressionStatement",
"span": {
"start": 0,
"end": 13,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 0,
"end": 12,
"ctxt": 0
},
"value": "use strict",
"raw": "\"use strict\""
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 14,
"end": 48,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 18,
"end": 47,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 18,
"end": 24,
"ctxt": 0
},
"value": "config",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 27,
"end": 47,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 27,
"end": 34,
"ctxt": 0
},
"value": "require",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 35,
"end": 46,
"ctxt": 0
},
"value": "../config",
"raw": "\"../config\""
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 49,
"end": 292,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 49,
"end": 292,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 49,
"end": 69,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 49,
"end": 63,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 49,
"end": 55,
"ctxt": 0
},
"value": "module",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 56,
"end": 63,
"ctxt": 0
},
"value": "exports",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 64,
"end": 69,
"ctxt": 0
},
"value": "route",
"optional": false
}
},
"right": {
"type": "FunctionExpression",
"identifier": null,
"params": [
{
"type": "Parameter",
"span": {
"start": 82,
"end": 88,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 82,
"end": 88,
"ctxt": 0
},
"value": "server",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 72,
"end": 292,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 90,
"end": 292,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 118,
"end": 290,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 118,
"end": 289,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 118,
"end": 128,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 118,
"end": 124,
"ctxt": 0
},
"value": "server",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 125,
"end": 128,
"ctxt": 0
},
"value": "get",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "BinaryExpression",
"span": {
"start": 129,
"end": 164,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "MemberExpression",
"span": {
"start": 129,
"end": 148,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 129,
"end": 139,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 129,
"end": 135,
"ctxt": 0
},
"value": "config",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 136,
"end": 139,
"ctxt": 0
},
"value": "env",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 140,
"end": 148,
"ctxt": 0
},
"value": "siteRoot",
"optional": false
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 151,
"end": 164,
"ctxt": 0
},
"value": "/auth/login",
"raw": "\"/auth/login\""
}
}
},
{
"spread": null,
"expression": {
"type": "FunctionExpression",
"identifier": null,
"params": [
{
"type": "Parameter",
"span": {
"start": 176,
"end": 179,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 176,
"end": 179,
"ctxt": 0
},
"value": "req",
"optional": false,
"typeAnnotation": null
}
},
{
"type": "Parameter",
"span": {
"start": 181,
"end": 184,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 181,
"end": 184,
"ctxt": 0
},
"value": "res",
"optional": false,
"typeAnnotation": null
}
},
{
"type": "Parameter",
"span": {
"start": 186,
"end": 190,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 186,
"end": 190,
"ctxt": 0
},
"value": "next",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 166,
"end": 288,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 192,
"end": 288,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 258,
"end": 285,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 258,
"end": 284,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 258,
"end": 270,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 258,
"end": 261,
"ctxt": 0
},
"value": "req",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 262,
"end": 270,
"ctxt": 0
},
"value": "redirect",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 271,
"end": 283,
"ctxt": 0
},
"value": "/auth/live",
"raw": "\"/auth/live\""
}
}
],
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
}
],
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
}
}
],
"interpreter": null
}