From 0fc15475139206f1f999b5c16bbe6f90142e936a Mon Sep 17 00:00:00 2001 From: Brandon Dail Date: Mon, 14 Jan 2019 17:00:15 -0800 Subject: [PATCH] Avoid new Set([iterable]) for thenables (#14592) Fixes https://github.com/facebook/react/issues/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 --- packages/react-reconciler/src/ReactFiberUnwindWork.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/react-reconciler/src/ReactFiberUnwindWork.js b/packages/react-reconciler/src/ReactFiberUnwindWork.js index 86e2b1a964a39..f8c0b050f04a5 100644 --- a/packages/react-reconciler/src/ReactFiberUnwindWork.js +++ b/packages/react-reconciler/src/ReactFiberUnwindWork.js @@ -214,7 +214,8 @@ function throwException( // attach another listener to flip the boundary back to its normal state. const thenables: Set = (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); }