no-iterable.js (777B)
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 If the iterable argument is undefined, return new WeakMap object. 7 info: | 8 WeakMap ( [ iterable ] ) 9 10 ... 11 5. If iterable is not present, let iterable be undefined. 12 6. If iterable is either undefined or null, let iter be undefined. 13 ... 14 8. If iter is undefined, return map. 15 ... 16 ---*/ 17 18 var a = new WeakMap(); 19 var b = new WeakMap(undefined); 20 var c = new WeakMap(null); 21 22 assert.sameValue(Object.getPrototypeOf(a), WeakMap.prototype); 23 assert.sameValue(Object.getPrototypeOf(b), WeakMap.prototype); 24 assert.sameValue(Object.getPrototypeOf(c), WeakMap.prototype); 25 26 reportCompare(0, 0);