Skip to content

Commit

Permalink
Add a workaround for the Rollup bug
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Dec 1, 2017
1 parent d529af4 commit 0a5a338
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/react-reconciler/src/ReactFiber.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ if (__DEV__) {
var hasBadMapPolyfill = false;
try {
var nonExtensibleObject = Object.preventExtensions({});
/* eslint-disable no-new */
new Map([[nonExtensibleObject, null]]);
new Set([nonExtensibleObject]);
/* eslint-enable no-new */
var testMap = new Map([[nonExtensibleObject, null]]);
var testSet = new Set([nonExtensibleObject]);
// This is necessary for Rollup to not consider these unused.
// TODO: report this as a Rollup bug.
testMap.set(0, 0);
testSet.add(0);
} catch (e) {
// TODO: Consider warning about bad polyfills
hasBadMapPolyfill = true;
Expand Down

0 comments on commit 0a5a338

Please sign in to comment.