source: imaps-frontend/node_modules/core-js/modules/es.symbol.for.js

main
Last change on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 919 bytes
Line 
1'use strict';
2var $ = require('../internals/export');
3var getBuiltIn = require('../internals/get-built-in');
4var hasOwn = require('../internals/has-own-property');
5var toString = require('../internals/to-string');
6var shared = require('../internals/shared');
7var NATIVE_SYMBOL_REGISTRY = require('../internals/symbol-registry-detection');
8
9var StringToSymbolRegistry = shared('string-to-symbol-registry');
10var SymbolToStringRegistry = shared('symbol-to-string-registry');
11
12// `Symbol.for` method
13// https://tc39.es/ecma262/#sec-symbol.for
14$({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
15 'for': function (key) {
16 var string = toString(key);
17 if (hasOwn(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
18 var symbol = getBuiltIn('Symbol')(string);
19 StringToSymbolRegistry[string] = symbol;
20 SymbolToStringRegistry[symbol] = string;
21 return symbol;
22 }
23});
Note: See TracBrowser for help on using the repository browser.