Description
yield
Example:
fn = ->*
let a = 1
yield a
Result:
var fn;
fn = function*(){
return (function(a){
return (yield a);
}.call(this, 1));
};
Expected result:
var fn;
fn = function*(){
return (yield* (function*(a){
return (yield a);
}.call(this, 1)));
};
await
Example:
fn = ->>
let a = Promise.resolve 1
await a
Result:
var fn;
fn = async function(){
return (function(a){
return (await a);
}.call(this, Promise.resolve(1)));
};
Expected result:
var fn;
fn = async function(){
return await (async function(a){
return await a;
}.call(this, Promise.resolve(1)));
};
(AFAIK, unlike yield
, await
doesn't need wrapping in parentheses, !await something
works fine)
Sidenote:
This is the first issue of many I'm going to post. Way back I announced, that I am planning to start posting some pull requests for the bugs I've found (#903 (comment)), but ended up posting nothing. I even was waiting so long, before I started doing something to fix #1005, despite knowing about this bug for years.
So this time I decided to dump my list of bugs and feature proposals one at the time, at least once a day. I hope I'll find some time and will to learn the internals to help more, by making pull requests. But "done is better than perfect". I have procrastinated for so long and I see, that LiveScript needs a help (with bugfixes, with tools, with promotion, with rewriting), and it hurts me, that I just wait and do nothing about it.
Feel free to post suggestions about how I can be more helpful, given low time resources.
I tried learning how the compiler works, but it's quite complicated and requires more analysis, so I've postponed it. Do you know some good resources to learn how to get into such code?
And I'm sorry for any duplicates. I'm not familiar with the whole issue pool, it's quite daunting.
And don't wait for me with 1.6.0. These all can be included in future versions.