main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
745 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 | var $ = require('../internals/export');
|
---|
3 | var aMap = require('../internals/a-map');
|
---|
4 | var iterate = require('../internals/iterate');
|
---|
5 | var set = require('../internals/map-helpers').set;
|
---|
6 |
|
---|
7 | // `Map.prototype.merge` method
|
---|
8 | // https://github.com/tc39/proposal-collection-methods
|
---|
9 | $({ target: 'Map', proto: true, real: true, arity: 1, forced: true }, {
|
---|
10 | // eslint-disable-next-line no-unused-vars -- required for `.length`
|
---|
11 | merge: function merge(iterable /* ...iterables */) {
|
---|
12 | var map = aMap(this);
|
---|
13 | var argumentsLength = arguments.length;
|
---|
14 | var i = 0;
|
---|
15 | while (i < argumentsLength) {
|
---|
16 | iterate(arguments[i++], function (key, value) {
|
---|
17 | set(map, key, value);
|
---|
18 | }, { AS_ENTRIES: true });
|
---|
19 | }
|
---|
20 | return map;
|
---|
21 | }
|
---|
22 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.