-
Notifications
You must be signed in to change notification settings - Fork 155
Open
Labels
Description
Closest issue I can find is #667
->* yield [x for x in arr]compiles to:
(function*(){
var x;
return (yield (yield* (function*(){
var i$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = arr).length; i$ < len$; ++i$) {
x = ref$[i$];
results$.push(x);
}
return results$;
}())));
});->* yield alert [x for x in arr]compiles to:
(function*(){
var x;
return (yield alert((yield* (function*(){
var i$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = arr).length; i$ < len$; ++i$) {
x = ref$[i$];
results$.push(x);
}
return results$;
}()))));
});
While in all cases the behavior is as expected, the compilation is surprising and undocumented. Clearly the yield* is extraneous in both cases. I suspect there must have been use cases where the yield* makes sense, but could we at least document this, and clarify when this rule is applicable?