You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
721 B
21 lines
721 B
'use strict';
|
|
var $ = require('../internals/export');
|
|
var IS_PURE = require('../internals/is-pure');
|
|
var anObject = require('../internals/an-object');
|
|
var aFunction = require('../internals/a-function');
|
|
var iterate = require('../internals/iterate');
|
|
|
|
// `Map.prototype.merge` method
|
|
// https://github.com/tc39/proposal-collection-methods
|
|
$({ target: 'Map', proto: true, real: true, forced: IS_PURE }, {
|
|
// eslint-disable-next-line no-unused-vars
|
|
merge: function merge(iterable /* ...iterbles */) {
|
|
var map = anObject(this);
|
|
var setter = aFunction(map.set);
|
|
var i = 0;
|
|
while (i < arguments.length) {
|
|
iterate(arguments[i++], setter, { that: map, AS_ENTRIES: true });
|
|
}
|
|
return map;
|
|
}
|
|
});
|
|
|