File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
packages/core-js/internals Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 1
1
/* eslint-disable es/no-symbol -- required for testing */
2
2
var V8_VERSION = require ( '../internals/engine-v8-version' ) ;
3
3
var fails = require ( '../internals/fails' ) ;
4
+ var global = require ( '../internals/global' ) ;
5
+
6
+ var $String = global . String ;
4
7
5
8
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
6
9
module . exports = ! ! Object . getOwnPropertySymbols && ! fails ( function ( ) {
7
10
var symbol = Symbol ( ) ;
8
11
// Chrome 38 Symbol has incorrect toString conversion
9
12
// `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 ) ||
11
16
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
12
17
! Symbol . sham && V8_VERSION && V8_VERSION < 41 ;
13
18
} ) ;
You can’t perform that action at this time.
0 commit comments