You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ToPropertyKey.js 411B

123456789101112131415
  1. 'use strict';
  2. var GetIntrinsic = require('../GetIntrinsic');
  3. var $String = GetIntrinsic('%String%');
  4. var ToPrimitive = require('./ToPrimitive');
  5. var ToString = require('./ToString');
  6. // https://www.ecma-international.org/ecma-262/6.0/#sec-topropertykey
  7. module.exports = function ToPropertyKey(argument) {
  8. var key = ToPrimitive(argument, $String);
  9. return typeof key === 'symbol' ? key : ToString(key);
  10. };