Wrap return expression in prefix statements into ActualCoroutineResult
commit7577f91dc41a5e952d98517018c08b2c5c03afbc
authorVladimir Matveev <vladima@fb.com>
Thu, 14 Sep 2017 08:44:17 +0000 (14 01:44 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Thu, 14 Sep 2017 08:54:20 +0000 (14 01:54 -0700)
treee219a8608e5d897d27230f459a20e23ecac40ddd
parent1f14c511e89a77f35cc59f32ba88e3d47a463138
Wrap return expression in prefix statements into ActualCoroutineResult

Summary:
Currently we rewrite code like
```
return a ? b : suspend c();
```
into the if-statement that replaces original return statement
```
if (a) {
   return new ActualCoroutineResult(a);
}
else {
   return c($cont);
}
```
The piece that was currently missing is wrapping returned values into `ActualCoroutineResult`

Reviewed By: michaeltingley

Differential Revision: D5824121

fbshipit-source-id: 37aefd200c14c98ff98067159fda7ba3f464b65e
hphp/hack/src/parser/coroutine/coroutine_suspend_rewriter.ml