Home / File/ BadMapPolyfill.js — react Source File

BadMapPolyfill.js — react Source File

Architecture documentation for BadMapPolyfill.js, a javascript file in the react codebase.

Entity Profile

Source Code

/**
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 * @flow
 */

export let hasBadMapPolyfill: boolean;

if (__DEV__) {
  hasBadMapPolyfill = false;
  try {
    const frozenObject = Object.freeze({});
    /* eslint-disable no-new */
    new Map([[frozenObject, null]]);
    new Set([frozenObject]);
    /* eslint-enable no-new */
  } catch (e) {
    // TODO: Consider warning about bad polyfills
    hasBadMapPolyfill = true;
  }
}

Frequently Asked Questions

What does BadMapPolyfill.js do?
BadMapPolyfill.js is a source file in the react codebase, written in javascript.
Where is BadMapPolyfill.js in the architecture?
BadMapPolyfill.js is located at packages/react/src/BadMapPolyfill.js (directory: packages/react/src).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free