undefined-newtarget.js (564B)
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-weakset-iterable 5 description: > 6 The WeakSet constructor is the %WeakSet% intrinsic object and the initial 7 value of the WeakSet property of the global object. 8 info: | 9 23.4.1.1 WeakSet ( [ iterable ] ) 10 11 1. If NewTarget is undefined, throw a TypeError exception. 12 ---*/ 13 14 assert.throws(TypeError, function() { 15 WeakSet(); 16 }); 17 18 assert.throws(TypeError, function() { 19 WeakSet([]); 20 }); 21 22 reportCompare(0, 0);