UNPKG

601 BJavaScriptView Raw
1'use strict';
2var $ = require('../internals/export');
3var getCompositeKeyNode = require('../internals/composite-key');
4var getBuiltIn = require('../internals/get-built-in');
5var apply = require('../internals/function-apply');
6
7// https://github.com/tc39/proposal-richer-keys/tree/master/compositeKey
8$({ global: true, forced: true }, {
9 compositeSymbol: function compositeSymbol() {
10 if (arguments.length === 1 && typeof arguments[0] == 'string') return getBuiltIn('Symbol')['for'](arguments[0]);
11 return apply(getCompositeKeyNode, null, arguments).get('symbol', getBuiltIn('Symbol'));
12 }
13});