summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/for-of/next-2.js
blob: e557ab7a8b52461a46ab3fbe6a860438f39822b6 (plain)
1
2
3
4
5
6
7
8
// Iterator.prototype.next throws if applied to a non-iterator that inherits from an iterator.

load(libdir + "asserts.js");
load(libdir + "iteration.js");

var it = [1, 2][Symbol.iterator]();
var v = Object.create(it);
assertThrowsInstanceOf(function () { Iterator.prototype.next.call(v); }, TypeError);