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

506 lines
18 KiB
JSON

{
"type": "Module",
"span": {
"start": 1,
"end": 277,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 1,
"end": 277,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 17,
"end": 28,
"ctxt": 0
},
"value": "removeClass",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 30,
"end": 46,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 30,
"end": 46,
"ctxt": 0
},
"value": "node",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 34,
"end": 46,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 35,
"end": 46,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 35,
"end": 46,
"ctxt": 0
},
"value": "HTMLElement",
"optional": false
},
"typeParams": null
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 48,
"end": 64,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 48,
"end": 64,
"ctxt": 0
},
"value": "className",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 57,
"end": 64,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 58,
"end": 64,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 8,
"end": 277,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 66,
"end": 277,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 69,
"end": 275,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 69,
"end": 274,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 69,
"end": 83,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 69,
"end": 73,
"ctxt": 0
},
"value": "node",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 74,
"end": 83,
"ctxt": 0
},
"value": "className",
"optional": false
}
},
"right": {
"type": "CallExpression",
"span": {
"start": 86,
"end": 274,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 86,
"end": 108,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 86,
"end": 100,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 86,
"end": 90,
"ctxt": 0
},
"value": "node",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 91,
"end": 100,
"ctxt": 0
},
"value": "className",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 101,
"end": 108,
"ctxt": 0
},
"value": "replace",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "CallExpression",
"span": {
"start": 109,
"end": 136,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 109,
"end": 125,
"ctxt": 0
},
"value": "_classNameRegexp",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 126,
"end": 135,
"ctxt": 0
},
"value": "className",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"spread": null,
"expression": {
"type": "FunctionExpression",
"identifier": null,
"params": [
{
"type": "Parameter",
"span": {
"start": 148,
"end": 158,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 148,
"end": 158,
"ctxt": 0
},
"value": "everything",
"optional": false,
"typeAnnotation": null
}
},
{
"type": "Parameter",
"span": {
"start": 160,
"end": 173,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 160,
"end": 173,
"ctxt": 0
},
"value": "leftDelimiter",
"optional": false,
"typeAnnotation": null
}
},
{
"type": "Parameter",
"span": {
"start": 175,
"end": 179,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 175,
"end": 179,
"ctxt": 0
},
"value": "name",
"optional": false,
"typeAnnotation": null
}
},
{
"type": "Parameter",
"span": {
"start": 181,
"end": 195,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 181,
"end": 195,
"ctxt": 0
},
"value": "rightDelimiter",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 138,
"end": 273,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 197,
"end": 273,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 201,
"end": 270,
"ctxt": 0
},
"argument": {
"type": "ConditionalExpression",
"span": {
"start": 208,
"end": 269,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 208,
"end": 258,
"ctxt": 0
},
"operator": "===",
"left": {
"type": "BinaryExpression",
"span": {
"start": 208,
"end": 252,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "MemberExpression",
"span": {
"start": 208,
"end": 228,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 208,
"end": 221,
"ctxt": 0
},
"value": "leftDelimiter",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 222,
"end": 228,
"ctxt": 0
},
"value": "length",
"optional": false
}
},
"right": {
"type": "MemberExpression",
"span": {
"start": 231,
"end": 252,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 231,
"end": 245,
"ctxt": 0
},
"value": "rightDelimiter",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 246,
"end": 252,
"ctxt": 0
},
"value": "length",
"optional": false
}
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 257,
"end": 258,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
},
"consequent": {
"type": "StringLiteral",
"span": {
"start": 261,
"end": 264,
"ctxt": 0
},
"value": " ",
"raw": "' '"
},
"alternate": {
"type": "StringLiteral",
"span": {
"start": 267,
"end": 269,
"ctxt": 0
},
"value": "",
"raw": "''"
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
}
],
"typeArguments": null
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
}
],
"interpreter": null
}