summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Iterator/from/wrap-next-forwards-value.js
blob: bc7c1c4086863a6e368cf660e2d9e0dc24949677 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// |reftest| skip-if(!this.hasOwnProperty('Iterator')) -- Iterator is not enabled unconditionally
class Iter {
  next(value) {
    assertEq(arguments.length, 0);
    return { done: false, value };
  }
}

const iter = new Iter();
const wrap = Iterator.from(iter);
assertEq(iter !== wrap, true);

assertEq(iter.v, undefined);
wrap.next(1);

if (typeof reportCompare === 'function')
  reportCompare(0, 0);