Skip to content

Commit

Permalink
test: add yield-expression test case
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Jul 1, 2019
1 parent a1a4558 commit bd7550c
Show file tree
Hide file tree
Showing 2 changed files with 196 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function *foo() {
yield %StringParseInt("42", 10)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
{
"type": "File",
"start": 0,
"end": 53,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 3,
"column": 1
}
},
"program": {
"type": "Program",
"start": 0,
"end": 53,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 3,
"column": 1
}
},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "FunctionDeclaration",
"start": 0,
"end": 53,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 3,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 10,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 1,
"column": 13
},
"identifierName": "foo"
},
"name": "foo"
},
"generator": true,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 16,
"end": 53,
"loc": {
"start": {
"line": 1,
"column": 16
},
"end": {
"line": 3,
"column": 1
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 20,
"end": 51,
"loc": {
"start": {
"line": 2,
"column": 2
},
"end": {
"line": 2,
"column": 33
}
},
"expression": {
"type": "YieldExpression",
"start": 20,
"end": 51,
"loc": {
"start": {
"line": 2,
"column": 2
},
"end": {
"line": 2,
"column": 33
}
},
"delegate": false,
"argument": {
"type": "CallExpression",
"start": 26,
"end": 51,
"loc": {
"start": {
"line": 2,
"column": 8
},
"end": {
"line": 2,
"column": 33
}
},
"callee": {
"type": "V8IntrinsicIdentifier",
"start": 26,
"end": 41,
"loc": {
"start": {
"line": 2,
"column": 8
},
"end": {
"line": 2,
"column": 23
},
"identifierName": "StringParseInt"
},
"name": "StringParseInt"
},
"arguments": [
{
"type": "StringLiteral",
"start": 42,
"end": 46,
"loc": {
"start": {
"line": 2,
"column": 24
},
"end": {
"line": 2,
"column": 28
}
},
"extra": {
"rawValue": "42",
"raw": "\"42\""
},
"value": "42"
},
{
"type": "NumericLiteral",
"start": 48,
"end": 50,
"loc": {
"start": {
"line": 2,
"column": 30
},
"end": {
"line": 2,
"column": 32
}
},
"extra": {
"rawValue": 10,
"raw": "10"
},
"value": 10
}
]
}
}
}
],
"directives": []
}
}
],
"directives": []
}
}

0 comments on commit bd7550c

Please sign in to comment.