symbol-constructor-detection.js 709 B

12345678910111213
  1. /* eslint-disable es/no-symbol -- required for testing */
  2. var V8_VERSION = require('../internals/engine-v8-version');
  3. var fails = require('../internals/fails');
  4. // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
  5. module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
  6. var symbol = Symbol();
  7. // Chrome 38 Symbol has incorrect toString conversion
  8. // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
  9. return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
  10. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  11. !Symbol.sham && V8_VERSION && V8_VERSION < 41;
  12. });