diff -r 000000000000 -r 6474c204b198 js/src/jit-test/tests/for-of/next-arity.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/src/jit-test/tests/for-of/next-arity.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,22 @@ +// For-of passes one arg to "next". + +load(libdir + 'iteration.js') + +var log = ''; + +function Iter() { + function next() { + log += 'n'; + assertEq(arguments.length, 1) + assertEq(arguments[0], undefined) + return { get value() { throw 42; }, done: true } + } + + this[std_iterator] = function () { return this; } + this.next = next; +} + +for (var x of new Iter()) + throw 'not reached'; + +assertEq(log, 'n');