Skip to content

Commit

Permalink
Avoid new Set([iterable]) for thenables (#14592)
Browse files Browse the repository at this point in the history
Fixes #14583

Using `new Set([iterable])` does not work with IE11's non-compliant Set
implementation. By avoiding this pattern we don't need to require a Set
polyfill for IE11
  • Loading branch information
aweary authored and gaearon committed Jan 15, 2019
1 parent edb1f59 commit 0fc1547
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/react-reconciler/src/ReactFiberUnwindWork.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ function throwException(
// attach another listener to flip the boundary back to its normal state.
const thenables: Set<Thenable> = (workInProgress.updateQueue: any);
if (thenables === null) {
workInProgress.updateQueue = (new Set([thenable]): any);
workInProgress.updateQueue = (new Set(): any);
workInProgress.updateQueue.add(thenable);
} else {
thenables.add(thenable);
}
Expand Down

0 comments on commit 0fc1547

Please sign in to comment.