租房小程序前端代码
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.

14 lines
447 B

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