undefined-newtarget.js (482B)
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-weakmap-iterable 5 description: > 6 Throws a TypeError if NewTarget is undefined. 7 info: | 8 23.3.1.1 WeakMap ( [ iterable ] ) 9 10 1. If NewTarget is undefined, throw a TypeError exception. 11 ---*/ 12 13 assert.throws(TypeError, function() { 14 WeakMap(); 15 }); 16 17 assert.throws(TypeError, function() { 18 WeakMap([]); 19 }); 20 21 reportCompare(0, 0);