summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/for-of/semantics-06.js
blob: 1ff3d9570e95eed9726dfc37739800ed14f9e269 (plain)
1
2
3
4
5
6
7
8
// Deleting the .next method makes for-of stop working on arrays.

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

var iterProto = Object.getPrototypeOf([][Symbol.iterator]());
delete iterProto.next;
assertThrowsInstanceOf(function () { for (var v of []) ; }, TypeError);