debian-mirror-gitlab/core-js/modules/esnext.map.merge.js

22 lines
699 B
JavaScript
Raw Normal View History

2019-09-25 13:30:05 +05:30
'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, map, true);
}
return map;
}
});