esnext.composite-key.js 721 B

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