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.

13 lines
394 B

4 years ago
  1. 'use strict';
  2. var origSymbol = global.Symbol;
  3. var hasSymbolSham = require('./shams');
  4. module.exports = function hasNativeSymbols() {
  5. if (typeof origSymbol !== 'function') { return false; }
  6. if (typeof Symbol !== 'function') { return false; }
  7. if (typeof origSymbol('foo') !== 'symbol') { return false; }
  8. if (typeof Symbol('bar') !== 'symbol') { return false; }
  9. return hasSymbolSham();
  10. };