michael@0: // The first call to yield* passes one arg to "next". michael@0: michael@0: function Iter() { michael@0: function next() { michael@0: if (arguments.length != 1) michael@0: throw Error; michael@0: return { value: 42, done: true } michael@0: } michael@0: michael@0: this.next = next; michael@0: this[std_iterator] = function () { return this; } michael@0: } michael@0: michael@0: function* delegate(iter) { return yield* iter; } michael@0: michael@0: var iter = delegate(new Iter()); michael@0: assertDeepEq(iter.next(), {value:42, done:true}); michael@0: michael@0: if (typeof reportCompare == "function") michael@0: reportCompare(true, true);