main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
939 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | 'use strict';
|
---|
| 2 | /* eslint-disable es/no-symbol -- required for testing */
|
---|
| 3 | var V8_VERSION = require('../internals/engine-v8-version');
|
---|
| 4 | var fails = require('../internals/fails');
|
---|
| 5 | var global = require('../internals/global');
|
---|
| 6 |
|
---|
| 7 | var $String = global.String;
|
---|
| 8 |
|
---|
| 9 | // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
---|
| 10 | module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
|
---|
| 11 | var symbol = Symbol('symbol detection');
|
---|
| 12 | // Chrome 38 Symbol has incorrect toString conversion
|
---|
| 13 | // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
---|
| 14 | // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
|
---|
| 15 | // of course, fail.
|
---|
| 16 | return !$String(symbol) || !(Object(symbol) instanceof Symbol) ||
|
---|
| 17 | // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
---|
| 18 | !Symbol.sham && V8_VERSION && V8_VERSION < 41;
|
---|
| 19 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.