blob: be5bd7f6e29d5d90bdfdc0d456cd8d3f95ca6d3a (
plain)
1
2
3
4
5
6
7
8
|
// Deleting String.prototype.iterator makes for-of stop working on strings.
load(libdir + "asserts.js");
load(libdir + "iteration.js");
delete String.prototype[Symbol.iterator];
assertThrowsInstanceOf(function () { for (var v of "abc") ; }, TypeError);
assertThrowsInstanceOf(function () { for (var v of new String("abc")) ; }, TypeError);
|