set-undefined-newtarget.js (517B)
1 // Copyright (C) 2015 the V8 project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 /*--- 4 esid: sec-set-constructor 5 description: > 6 Set ( [ iterable ] ) 7 8 When the Set function is called with optional argument iterable the following steps are taken: 9 10 1. If NewTarget is undefined, throw a TypeError exception. 11 ... 12 13 ---*/ 14 15 assert.throws(TypeError, function() { 16 Set(); 17 }); 18 19 assert.throws(TypeError, function() { 20 Set([]); 21 }); 22 23 reportCompare(0, 0);