2 var anObject = require('../internals/an-object');
4 // `Map.prototype.emplace` method
5 // https://github.com/thumbsupep/proposal-upsert
6 module.exports = function emplace(key, handler) {
7 var map = anObject(this);
8 var value = (map.has(key) && 'update' in handler)
9 ? handler.update(map.get(key), key, map)
10 : handler.insert(key, map);