blob: 4d4e66f00c493865c3f80f11b5a0937949d6ebcc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
// mapiter.next() returns a fresh array each time.
load(libdir + "iteration.js");
var map = new Map([['a', 1], ['b', 2]]);
var iter = map[Symbol.iterator]();
var a = iter.next(), b = iter.next();
assertIteratorResult(a, ['a', 1], false);
assertIteratorResult(b, ['b', 2], false);
assertEq(a.value !== b.value, true);
var a1 = map[Symbol.iterator]();
assertIteratorNext(a1, ['a', 1]);
assertEq(a.value !== a1.value, true);
|