Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f619275

Browse files
authored
Merge pull request #1242 from laverdet/master
2 parents e840da1 + 1a0dfd4 commit f619275

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
/* eslint-disable es/no-symbol -- required for testing */
22
var V8_VERSION = require('../internals/engine-v8-version');
33
var fails = require('../internals/fails');
4+
var global = require('../internals/global');
5+
6+
var $String = global.String;
47

58
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
69
module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
710
var symbol = Symbol();
811
// Chrome 38 Symbol has incorrect toString conversion
912
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
10-
return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
13+
// nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
14+
// of course, fail.
15+
return !$String(symbol) || !(Object(symbol) instanceof Symbol) ||
1116
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
1217
!Symbol.sham && V8_VERSION && V8_VERSION < 41;
1318
});

0 commit comments

Comments
 (0)