| 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.1.1.1 |
| 5 |
description: > |
| 6 |
Creating a new Map object without arguments doesn't throw if `set` is not |
| 7 |
callable |
| 8 |
info: | |
| 9 |
Map ( [ iterable ] ) |
| 10 |
|
| 11 |
When the Set function is called with optional argument iterable the following steps are taken: |
| 12 |
|
| 13 |
... |
| 14 |
5. If iterable is not present, let iterable be undefined. |
| 15 |
6. If iterable is either undefined or null, let iter be undefined. |
| 16 |
7. Else, |
| 17 |
a. Let adder be Get(map, "set"). |
| 18 |
b. ReturnIfAbrupt(adder). |
| 19 |
c. If IsCallable(adder) is false, throw a TypeError exception. |
| 20 |
... |
| 21 |
8. If iter is undefined, return map. |
| 22 |
... |
| 23 |
---*/ |
| 24 |
|
| 25 |
Map.prototype.set = null; |
| 26 |
|
| 27 |
var m = new Map(); |
| 28 |
|
| 29 |
assert.sameValue(m.size, 0, 'The value of `m.size` is `0`'); |