newtarget-or-active-function-object.js (547B)
1 // Copyright (C) 2020 Rick Waldron. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 esid: sec-iterator 6 description: > 7 Iterator is not callable or constructable 8 info: | 9 When the Iterator function is called, the following steps are taken: 10 11 If NewTarget is undefined or the active function object, throw a TypeError exception. 12 13 features: [iterator-helpers] 14 ---*/ 15 16 assert.throws(TypeError, () => { 17 Iterator(); 18 }); 19 20 assert.throws(TypeError, () => { 21 new Iterator(); 22 }); 23 24 reportCompare(0, 0);