esnext.composite-symbol.js 521 B

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