diff options
Diffstat (limited to 'js/src/jit-test/tests/collections/iterator-proto-2.js')
-rw-r--r-- | js/src/jit-test/tests/collections/iterator-proto-2.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/collections/iterator-proto-2.js b/js/src/jit-test/tests/collections/iterator-proto-2.js new file mode 100644 index 000000000..d6d5ba7d7 --- /dev/null +++ b/js/src/jit-test/tests/collections/iterator-proto-2.js @@ -0,0 +1,13 @@ +// Iterators of different collection types have different prototypes. + +load(libdir + "iteration.js"); + +var aproto = Object.getPrototypeOf(Array()[Symbol.iterator]()); +var mproto = Object.getPrototypeOf((new Map())[Symbol.iterator]()); +var sproto = Object.getPrototypeOf((new Set())[Symbol.iterator]()); +assertEq(aproto !== mproto, true); +assertEq(aproto !== sproto, true); +assertEq(mproto !== sproto, true); +assertEq(aproto.next !== mproto.next, true); +assertEq(aproto.next !== sproto.next, true); +assertEq(mproto.next !== sproto.next, true); |