Last change
on this file since b738035 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
790 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 | var $ = require('../internals/export');
|
---|
3 | var IS_PURE = require('../internals/is-pure');
|
---|
4 | var anObject = require('../internals/an-object');
|
---|
5 | var aFunction = require('../internals/a-function');
|
---|
6 | var iterate = require('../internals/iterate');
|
---|
7 |
|
---|
8 | // `Map.prototype.merge` method
|
---|
9 | // https://github.com/tc39/proposal-collection-methods
|
---|
10 | $({ target: 'Map', proto: true, real: true, forced: IS_PURE }, {
|
---|
11 | // eslint-disable-next-line no-unused-vars -- required for `.length`
|
---|
12 | merge: function merge(iterable /* ...iterbles */) {
|
---|
13 | var map = anObject(this);
|
---|
14 | var setter = aFunction(map.set);
|
---|
15 | var argumentsLength = arguments.length;
|
---|
16 | var i = 0;
|
---|
17 | while (i < argumentsLength) {
|
---|
18 | iterate(arguments[i++], setter, { that: map, AS_ENTRIES: true });
|
---|
19 | }
|
---|
20 | return map;
|
---|
21 | }
|
---|
22 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.