Skip to content

Commit c2f97bb

Browse files
Added check for specific symbols in polyfills/symbols (#2804)
Co-authored-by: Ivan Goncharov <[email protected]>
1 parent 13ece49 commit c2f97bb

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/polyfills/symbols.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
// In ES2015 (or a polyfilled) environment, this will be Symbol.iterator
22
// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')
33
export const SYMBOL_ITERATOR: string =
4-
typeof Symbol === 'function' ? Symbol.iterator : '@@iterator';
4+
typeof Symbol === 'function' && Symbol.iterator != null
5+
? Symbol.iterator
6+
: '@@iterator';
57

68
// In ES2017 (or a polyfilled) environment, this will be Symbol.asyncIterator
79
// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')
810
export const SYMBOL_ASYNC_ITERATOR: string =
9-
typeof Symbol === 'function' ? Symbol.asyncIterator : '@@asyncIterator';
11+
typeof Symbol === 'function' && Symbol.asyncIterator != null
12+
? Symbol.asyncIterator
13+
: '@@asyncIterator';
1014

1115
// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')
1216
export const SYMBOL_TO_STRING_TAG: string =
13-
typeof Symbol === 'function' ? Symbol.toStringTag : '@@toStringTag';
17+
typeof Symbol === 'function' && Symbol.toStringTag != null
18+
? Symbol.toStringTag
19+
: '@@toStringTag';

0 commit comments

Comments
 (0)