source: frontend/node_modules/core-js-pure/modules/es.map.get-or-insert-computed.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 811 bytes
Line 
1'use strict';
2var $ = require('../internals/export');
3var aCallable = require('../internals/a-callable');
4var MapHelpers = require('../internals/map-helpers');
5var IS_PURE = require('../internals/is-pure');
6
7var get = MapHelpers.get;
8var has = MapHelpers.has;
9var set = MapHelpers.set;
10
11// `Map.prototype.getOrInsertComputed` method
12// https://tc39.es/ecma262/#sec-map.prototype.getorinsertcomputed
13$({ target: 'Map', proto: true, real: true, forced: IS_PURE }, {
14 getOrInsertComputed: function getOrInsertComputed(key, callbackfn) {
15 var hasKey = has(this, key);
16 aCallable(callbackfn);
17 if (hasKey) return get(this, key);
18 // CanonicalizeKeyedCollectionKey
19 if (key === 0 && 1 / key === -Infinity) key = 0;
20 var value = callbackfn(key);
21 set(this, key, value);
22 return value;
23 }
24});
Note: See TracBrowser for help on using the repository browser.