Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Map/map-iterable.js

raw
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 Contructor returns a map object set with the elements from the iterable
7 argument.
8 info: |
9 Map ( [ iterable ] )
10
11 ...
12 9. Repeat
13 a. Let next be IteratorStep(iter).
14 b. ReturnIfAbrupt(next).
15 c. If next is false, return map.
16 ...
17 ---*/
18
19 var m = new Map([
20 ["attr", 1],
21 ["foo", 2]
22 ]);
23
24 assert.sameValue(m.size, 2, 'The value of `m.size` is `2`');
25 assert.sameValue(m.get("attr"), 1);
26 assert.sameValue(m.get("foo"), 2);