_cloneSymbol.js 524 B

12345678910111213141516171819
  1. var Symbol = require('./_Symbol');
  2. /** Used to convert symbols to primitives and strings. */
  3. var symbolProto = Symbol ? Symbol.prototype : undefined,
  4. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
  5. /**
  6. * Creates a clone of the `symbol` object.
  7. *
  8. * @private
  9. * @param {Object} symbol The symbol object to clone.
  10. * @returns {Object} Returns the cloned symbol object.
  11. */
  12. function cloneSymbol(symbol) {
  13. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  14. }
  15. module.exports = cloneSymbol;