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

567 lines
12 KiB
JSON
Raw Normal View History

{
"type": "Module",
"span": {
"start": 116,
"end": 744,
"ctxt": 0
},
"body": [
{
"type": "ExportDefaultExpression",
"span": {
"start": 116,
"end": 134,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 131,
"end": 133,
"ctxt": 0
},
"value": 12.0
}
},
{
"type": "ExportDefaultDeclaration",
"span": {
"start": 160,
"end": 209,
"ctxt": 0
},
"decl": {
"type": "FunctionExpression",
"identifier": {
"type": "Identifier",
"span": {
"start": 184,
"end": 187,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"params": [],
"decorators": [],
"span": {
"start": 175,
"end": 209,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 190,
"end": 209,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 196,
"end": 207,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 203,
"end": 206,
"ctxt": 0
},
"value": "foo",
"optional": false
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 210,
"end": 231,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 217,
"end": 231,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 223,
"end": 230,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 223,
"end": 224,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "Identifier",
"span": {
"start": 227,
"end": 230,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"definite": false
}
]
}
},
{
"type": "ExportNamedDeclaration",
"span": {
"start": 232,
"end": 254,
"ctxt": 0
},
"specifiers": [
{
"type": "ExportSpecifier",
"span": {
"start": 241,
"end": 251,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 241,
"end": 244,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"exported": {
"type": "Identifier",
"span": {
"start": 248,
"end": 251,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"isTypeOnly": false
}
],
"source": null,
"typeOnly": false,
"asserts": null
},
{
"type": "ExportDefaultDeclaration",
"span": {
"start": 280,
"end": 342,
"ctxt": 0
},
"decl": {
"type": "ClassExpression",
"identifier": {
"type": "Identifier",
"span": {
"start": 301,
"end": 304,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"span": {
"start": 295,
"end": 342,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 311,
"end": 340,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 311,
"end": 312,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": {
"type": "ParenthesisExpression",
"span": {
"start": 333,
"end": 339,
"ctxt": 0
},
"expression": {
"type": "NullLiteral",
"span": {
"start": 334,
"end": 338,
"ctxt": 0
}
}
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
},
{
"type": "EmptyStatement",
"span": {
"start": 342,
"end": 343,
"ctxt": 0
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 344,
"end": 365,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 351,
"end": 365,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 357,
"end": 364,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 357,
"end": 358,
"ctxt": 0
},
"value": "X",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "Identifier",
"span": {
"start": 361,
"end": 364,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"definite": false
}
]
}
},
{
"type": "ExportNamedDeclaration",
"span": {
"start": 366,
"end": 388,
"ctxt": 0
},
"specifiers": [
{
"type": "ExportSpecifier",
"span": {
"start": 375,
"end": 385,
"ctxt": 0
},
"orig": {
"type": "Identifier",
"span": {
"start": 375,
"end": 378,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"exported": {
"type": "Identifier",
"span": {
"start": 382,
"end": 385,
"ctxt": 0
},
"value": "Bar",
"optional": false
},
"isTypeOnly": false
}
],
"source": null,
"typeOnly": false,
"asserts": null
},
{
"type": "ImportDeclaration",
"span": {
"start": 414,
"end": 441,
"ctxt": 0
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"span": {
"start": 421,
"end": 424,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 421,
"end": 424,
"ctxt": 0
},
"value": "Fab",
"optional": false
}
}
],
"source": {
"type": "StringLiteral",
"span": {
"start": 430,
"end": 440,
"ctxt": 0
},
"value": "./index3",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeOnly": false,
"asserts": null
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 448,
"end": 451,
"ctxt": 0
},
"value": "Bar",
"optional": false
},
"declare": false,
"span": {
"start": 442,
"end": 501,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 470,
"end": 499,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 470,
"end": 471,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "ParenthesisExpression",
"span": {
"start": 492,
"end": 498,
"ctxt": 0
},
"expression": {
"type": "NullLiteral",
"span": {
"start": 493,
"end": 497,
"ctxt": 0
}
}
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 460,
"end": 463,
"ctxt": 0
},
"value": "Fab",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ExportDefaultExpression",
"span": {
"start": 502,
"end": 521,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 517,
"end": 520,
"ctxt": 0
},
"value": "Bar",
"optional": false
}
},
{
"type": "ExportDefaultExpression",
"span": {
"start": 582,
"end": 600,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 597,
"end": 599,
"ctxt": 0
},
"value": 12.0
}
},
{
"type": "ExportDefaultDeclaration",
"span": {
"start": 710,
"end": 743,
"ctxt": 0
},
"decl": {
"type": "FunctionExpression",
"identifier": {
"type": "Identifier",
"span": {
"start": 734,
"end": 738,
"ctxt": 0
},
"value": "func",
"optional": false
},
"params": [],
"decorators": [],
"span": {
"start": 725,
"end": 743,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 741,
"end": 743,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "EmptyStatement",
"span": {
"start": 743,
"end": 744,
"ctxt": 0
}
}
],
"interpreter": null
}