Skip to content

Commit

Permalink
test added for yield
Browse files Browse the repository at this point in the history
  • Loading branch information
The-x-Theorist committed Nov 5, 2021
1 parent 69d4708 commit fe9c3d2
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 0 deletions.
@@ -0,0 +1,4 @@
(function* () {
function f(_=()=>null) {}
yield;
});
@@ -0,0 +1,86 @@
{
"type": "File",
"start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":3}},
"program": {
"type": "Program",
"start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":3}},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "ExpressionStatement",
"start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":3}},
"expression": {
"type": "FunctionExpression",
"start":1,"end":54,"loc":{"start":{"line":1,"column":1},"end":{"line":4,"column":1}},
"id": null,
"generator": true,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start":14,"end":54,"loc":{"start":{"line":1,"column":14},"end":{"line":4,"column":1}},
"body": [
{
"type": "FunctionDeclaration",
"start":18,"end":43,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":27}},
"id": {
"type": "Identifier",
"start":27,"end":28,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":12},"identifierName":"f"},
"name": "f"
},
"generator": false,
"async": false,
"params": [
{
"type": "AssignmentPattern",
"start":29,"end":39,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":23}},
"left": {
"type": "Identifier",
"start":29,"end":30,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14},"identifierName":"_"},
"name": "_"
},
"right": {
"type": "ArrowFunctionExpression",
"start":31,"end":39,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":23}},
"id": null,
"generator": false,
"async": false,
"params": [],
"body": {
"type": "NullLiteral",
"start":35,"end":39,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":23}}
}
}
}
],
"body": {
"type": "BlockStatement",
"start":41,"end":43,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":27}},
"body": [],
"directives": []
}
},
{
"type": "ExpressionStatement",
"start":46,"end":52,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":8}},
"expression": {
"type": "YieldExpression",
"start":46,"end":51,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":7}},
"delegate": false,
"argument": null
}
}
],
"directives": []
},
"extra": {
"parenthesized": true,
"parenStart": 0
}
}
}
],
"directives": []
}
}

0 comments on commit fe9c3d2

Please sign in to comment.