Skip to content

Commit

Permalink
Remove unnecessary lines for hasBadMapPolyfill issue for rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
iAziz786 committed Mar 22, 2020
1 parent c0cd1be commit 7bd2a61
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
11 changes: 4 additions & 7 deletions packages/react-reconciler/src/ReactFiber.js
Expand Up @@ -101,13 +101,10 @@ if (__DEV__) {
hasBadMapPolyfill = false;
try {
const nonExtensibleObject = Object.preventExtensions({});
const testMap = new Map([[nonExtensibleObject, null]]);
const testSet = new Set([nonExtensibleObject]);
// This is necessary for Rollup to not consider these unused.
// https://github.com/rollup/rollup/issues/1771
// TODO: we can remove these if Rollup fixes the bug.
testMap.set(0, 0);
testSet.add(0);
/* eslint-disable no-new */
new Map([[nonExtensibleObject, null]]);
new Set([nonExtensibleObject]);
/* eslint-enable no-new */
} catch (e) {
// TODO: Consider warning about bad polyfills
hasBadMapPolyfill = true;
Expand Down
11 changes: 4 additions & 7 deletions packages/react/src/BadMapPolyfill.js
Expand Up @@ -12,13 +12,10 @@ if (__DEV__) {
hasBadMapPolyfill = false;
try {
const frozenObject = Object.freeze({});
const testMap = new Map([[frozenObject, null]]);
const testSet = new Set([frozenObject]);
// This is necessary for Rollup to not consider these unused.
// https://github.com/rollup/rollup/issues/1771
// TODO: we can remove these if Rollup fixes the bug.
testMap.set(0, 0);
testSet.add(0);
/* 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;
Expand Down

0 comments on commit 7bd2a61

Please sign in to comment.