| Index: test/mjsunit/harmony/generators.js
|
| diff --git a/test/mjsunit/harmony/generators.js b/test/mjsunit/harmony/generators.js
|
| index 5b045049e9963c1d31bf15584544d6906f3b3a31..df6cec892532b83d37601f639ccda8aed6188d12 100644
|
| --- a/test/mjsunit/harmony/generators.js
|
| +++ b/test/mjsunit/harmony/generators.js
|
| @@ -237,8 +237,8 @@
|
| let x = g();
|
| assertEquals({value: 1, done: false}, x.next());
|
| assertEquals({value: 42, done: false}, x.next());
|
| - assertEquals({value: 43, done: false}, x.return(666));
|
| - assertEquals({value: undefined, done: false}, x.next());
|
| + assertEquals({value: 43, done: false}, x.return(44));
|
| + assertEquals({value: 44, done: false}, x.next());
|
| assertEquals({value: undefined, done: true}, x.next());
|
| }
|
|
|
| @@ -250,3 +250,23 @@
|
| assertThrowsEquals(() => x.next(), 666);
|
| }
|
| }
|
| +
|
| +
|
| +{ // yield*, .return argument is final result
|
| +
|
| + function* inner() {
|
| + yield 2;
|
| + }
|
| +
|
| + function* g() {
|
| + yield 1;
|
| + return yield* inner();
|
| + }
|
| +
|
| + {
|
| + let x = g();
|
| + assertEquals({value: 1, done: false}, x.next());
|
| + assertEquals({value: 2, done: false}, x.next());
|
| + assertEquals({value: 42, done: true}, x.return(42));
|
| + }
|
| +}
|
|
|