iterator-non-iterable.js (624B)
1 // Copyright (C) 2025 Kevin Gibbons. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 esid: sec-iterator.zip 6 description: > 7 Throws a TypeError when the "iterables" argument is not iterable. 8 features: [joint-iteration] 9 ---*/ 10 11 var invalidIterables = [ 12 Object.create(null), 13 Object.create(null, { 14 next: { value: function(){} }, 15 return: { value: function(){} }, 16 }), 17 ]; 18 19 // Throws a TypeError for invalid iterables values. 20 for (var iterables of invalidIterables) { 21 assert.throws(TypeError, function() { 22 Iterator.zip(iterables); 23 }); 24 } 25 26 reportCompare(0, 0);