On Mon, May 13, 2013 at 11:08 AM, Andreas Rossberg <[email protected]> wrote:
> The case I was talking about is simply this:
>
> function* g() {
> yield* [1, 2]
> }
>
> var o = g()
> o.send(undefined)
> o.send(5) // what does this mean?
>
> But I suppose the answer is that the sent value is just dropped on the
> floor, as per the iterator expression interpretation you gave in the
> other post. Makes sense, I guess.
Yes, because that code is equivalent to:
function* g() {
yield 1;
yield 2;
}
Using .send() instead of .next() makes no difference to this code.
Using .throw() should just percolate the error up to the yield*
expression, as Allen suggested.
~TJ
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss