core-js.js 723 B

12345678910111213141516171819202122232425262728
  1. 'use strict';
  2. var test = require('tape');
  3. if (typeof Symbol === 'function' && typeof Symbol() === 'symbol') {
  4. test('has native Symbol support', function (t) {
  5. t.equal(typeof Symbol, 'function');
  6. t.equal(typeof Symbol(), 'symbol');
  7. t.end();
  8. });
  9. return;
  10. }
  11. var hasSymbols = require('../../shams');
  12. test('polyfilled Symbols', function (t) {
  13. /* eslint-disable global-require */
  14. t.equal(hasSymbols(), false, 'hasSymbols is false before polyfilling');
  15. require('core-js/fn/symbol');
  16. require('core-js/fn/symbol/to-string-tag');
  17. require('../tests')(t);
  18. var hasSymbolsAfter = hasSymbols();
  19. t.equal(hasSymbolsAfter, true, 'hasSymbols is true after polyfilling');
  20. /* eslint-enable global-require */
  21. t.end();
  22. });