swc/ecmascript/ast/benches/module-2.json
강동윤 ed100700f1
Make deserialization fast (#314)
swc_ecma_ast:
  - add deserialization benchmark

ast_node:
 - #[ast_node] on enum now implements faster deserialization
2019-03-05 23:16:45 +09:00

539 lines
25 KiB
JSON

{
"type": "Module",
"span": {
"start": 0,
"end": 23,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"value": "asyncGeneratorStep",
"optional": false
},
"declare": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"value": "gen",
"optional": false
},
{
"type": "Identifier",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"value": "resolve",
"optional": false
},
{
"type": "Identifier",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"value": "reject",
"optional": false
},
{
"type": "Identifier",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"value": "_next",
"optional": false
},
{
"type": "Identifier",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"value": "_throw",
"optional": false
},
{
"type": "Identifier",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"value": "key",
"optional": false
},
{
"type": "Identifier",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"value": "arg",
"optional": false
}
],
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"stmts": [
{
"type": "TryStatement",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"block": {
"type": "BlockStatement",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"value": "info",
"optional": false
},
"init": {
"type": "CallExpression",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"value": "gen",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"value": "key",
"optional": false
},
"computed": true
},
"arguments": [
{
"expr": {
"type": "Identifier",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"value": "arg",
"optional": false
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"value": "value",
"optional": false
},
"init": {
"type": "MemberExpression",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"value": "info",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"value": "value",
"optional": false
},
"computed": false
},
"definite": false
}
]
}
]
},
"handler": {
"type": "CatchClause",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"param": {
"type": "Identifier",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"value": "error",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"stmts": [
{
"type": "CallExpression",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"value": "reject",
"optional": false
},
"arguments": [
{
"expr": {
"type": "Identifier",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"value": "error",
"optional": false
}
}
],
"typeArguments": null
},
{
"type": "ReturnStatement",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
}
}
]
}
}
},
{
"type": "IfStatement",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"test": {
"type": "MemberExpression",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"value": "info",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"value": "done",
"optional": false
},
"computed": false
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"stmts": [
{
"type": "CallExpression",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"value": "resolve",
"optional": false
},
"arguments": [
{
"expr": {
"type": "Identifier",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"value": "value",
"optional": false
}
}
],
"typeArguments": null
}
]
},
"alternate": {
"type": "BlockStatement",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"stmts": [
{
"type": "CallExpression",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"value": "Promise",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"value": "resolve",
"optional": false
},
"computed": false
},
"arguments": [
{
"expr": {
"type": "Identifier",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"value": "value",
"optional": false
}
}
],
"typeArguments": null
},
"property": {
"type": "Identifier",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"value": "then",
"optional": false
},
"computed": false
},
"arguments": [
{
"expr": {
"type": "Identifier",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"value": "_next",
"optional": false
}
},
{
"expr": {
"type": "Identifier",
"span": {
"start": 0,
"end": 0,
"ctxt": 0
},
"value": "_throw",
"optional": false
}
}
],
"typeArguments": null
}
]
}
}
]
},
"generator": false,
"async": false
}
]
}