| 1 | /** |
| 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
| 3 | * |
| 4 | * This source code is licensed under the MIT license found in the |
| 5 | * LICENSE file in the root directory of this source tree. |
| 6 | * @flow |
| 7 | */ |
| 8 | |
| 9 | export let hasBadMapPolyfill: boolean; |
| 10 | |
| 11 | if (__DEV__) { |
| 12 | hasBadMapPolyfill = false; |
| 13 | try { |
| 14 | const frozenObject = Object.freeze({}); |
| 15 | /* eslint-disable no-new */ |
| 16 | new Map([[frozenObject, null]]); |
| 17 | new Set([frozenObject]); |
| 18 | /* eslint-enable no-new */ |
| 19 | } catch (e) { |
| 20 | // TODO: Consider warning about bad polyfills |
| 21 | hasBadMapPolyfill = true; |
| 22 | } |
| 23 | } |