Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary lines for hasBadMapPolyfill issue for rollup #16231

Merged
merged 1 commit into from Mar 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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