esnext.composite-key.js 580 B

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