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