michael@0: // Deleting String.prototype.iterator makes for-of stop working on strings. michael@0: michael@0: load(libdir + "asserts.js"); michael@0: load(libdir + "iteration.js"); michael@0: michael@0: delete String.prototype[std_iterator]; michael@0: assertThrowsInstanceOf(function () { for (var v of "abc") ; }, TypeError); michael@0: assertThrowsInstanceOf(function () { for (var v of new String("abc")) ; }, TypeError);