Skip to content

Commit

Permalink
Remove Symbol
Browse files Browse the repository at this point in the history
Summary: Remove Symbol use as it is not available on IE 11.

Reviewed By: drarmstr

Differential Revision: D25963011

fbshipit-source-id: 93e30978a299ba5e82c857ad77f609190b3469f7
  • Loading branch information
davidmccabe authored and facebook-github-bot committed Jan 20, 2021
1 parent 42a1e03 commit d27c800
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/adt/Recoil_ArrayKeyedMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
*/
'use strict';

// eslint-disable-next-line fb-www/no-symbol
const LEAF = Symbol('ArrayKeyedMap');
const LEAF = {};

const emptyMap = new Map();

Expand Down
6 changes: 5 additions & 1 deletion src/util/Recoil_stableStringify.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ function stringify(x: mixed, opt: Options, key?: string): string {
}

// Anything else that is iterable serialize as an Array.
if (x[Symbol.iterator] != null && typeof x[Symbol.iterator] === 'function') {
if (
Symbol !== undefined &&
x[Symbol.iterator] != null &&
typeof x[Symbol.iterator] === 'function'
) {
// flowlint-next-line unclear-type: off
return stringify(Array.from((x: any)), opt, key);
}
Expand Down

0 comments on commit d27c800

Please sign in to comment.