Skip to content

Commit 0a5a338

Browse files
committed
Add a workaround for the Rollup bug
1 parent d529af4 commit 0a5a338

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/react-reconciler/src/ReactFiber.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,12 @@ if (__DEV__) {
4141
var hasBadMapPolyfill = false;
4242
try {
4343
var nonExtensibleObject = Object.preventExtensions({});
44-
/* eslint-disable no-new */
45-
new Map([[nonExtensibleObject, null]]);
46-
new Set([nonExtensibleObject]);
47-
/* eslint-enable no-new */
44+
var testMap = new Map([[nonExtensibleObject, null]]);
45+
var testSet = new Set([nonExtensibleObject]);
46+
// This is necessary for Rollup to not consider these unused.
47+
// TODO: report this as a Rollup bug.
48+
testMap.set(0, 0);
49+
testSet.add(0);
4850
} catch (e) {
4951
// TODO: Consider warning about bad polyfills
5052
hasBadMapPolyfill = true;

0 commit comments

Comments
 (0)