1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/for-of/semantics-01.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,13 @@ 1.4 +// for-of is defined in terms of basic operations on objects, particularly 1.5 +// [[Get]] for properties named "iterator" and "next", and [[Call]]. These 1.6 +// "semantics" tests check that for-of really does appear to be implemented in 1.7 +// terms of those more basic operations, as required by the spec, even in 1.8 +// unusual cases. 1.9 + 1.10 +// Deleting Array.prototype.iterator makes for-of stop working on arrays. 1.11 + 1.12 +load(libdir + "asserts.js"); 1.13 +load(libdir + "iteration.js"); 1.14 + 1.15 +delete Array.prototype[std_iterator]; 1.16 +assertThrowsInstanceOf(function () { for (var x of []) ; }, TypeError);