iterator-is-undefined-throws.js (503B)
1 // Copyright (C) 2018 Amal Hussein. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 /*--- 4 esid: sec-map-objects 5 description: > 6 Throws a TypeError if the iterator of the iterable is undefined. 7 info: | 8 Map ( [ iterable ] ) 9 ... 10 9. Let iteratorRecord be ? GetIterator(iterable). 11 features: [Symbol.iterator] 12 ---*/ 13 14 var iterable = { [Symbol.iterator]: undefined }; 15 16 assert.throws(TypeError, 17 function () { 18 new Map(iterable); 19 }); 20 21 reportCompare(0, 0);