Re: something wrong about generator

2018-05-07 Thread Jeremy Martin
The `yield *` expression actually *evaluates* to the final value of the delegated generator (i.e., the final value when *done* is *true*). In other words, if you modified your second generator in your example to the following: function* b() { const result = yield* a();

Re: something wrong about generator

2018-05-06 Thread Vic99999
>or it need to return {value: {value: "end", done: true}, done: true} this case is supported, seems, if to use: function* b() { return yield* a() } ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

something wrong about generator

2018-05-06 Thread 郑宇光
generator function shouldn't allow a "return value" when use yield or it need to return {value: {value: "end", done: true}, done: true} at the iter end when use yield* code: ``` javascript function* a() { yield 1; yield 2; return "end" } //undefined function* b() { yield* a() } //undefined c =