esnext.composite-key.js 671 B

12345678910111213141516171819
  1. var $ = require('../internals/export');
  2. var apply = require('../internals/function-apply');
  3. var getCompositeKeyNode = require('../internals/composite-key');
  4. var getBuiltIn = require('../internals/get-built-in');
  5. var create = require('../internals/object-create');
  6. var $Object = Object;
  7. var initializer = function () {
  8. var freeze = getBuiltIn('Object', 'freeze');
  9. return freeze ? freeze(create(null)) : create(null);
  10. };
  11. // https://github.com/tc39/proposal-richer-keys/tree/master/compositeKey
  12. $({ global: true, forced: true }, {
  13. compositeKey: function compositeKey() {
  14. return apply(getCompositeKeyNode, $Object, arguments).get('object', initializer);
  15. }
  16. });