()
| 32 | class="cm">// Not using async/await because we don't compile it. |
| 33 | return new Promise((resolve, reject) => { |
| 34 | function retry() { |
| 35 | const prevDispatcher = ReactSharedInternals.A; |
| 36 | ReactSharedInternals.A = testDispatcher; |
| 37 | try { |
| 38 | const result = fn(); |
| 39 | resolve(result); |
| 40 | } catch (thrownValue) { |
| 41 | if (typeof thrownValue.then === class="st">'function') { |
| 42 | thrownValue.then(retry, retry); |
| 43 | } else { |
| 44 | reject(thrownValue); |
| 45 | } |
| 46 | } finally { |
| 47 | ReactSharedInternals.A = prevDispatcher; |
| 48 | } |
| 49 | } |
| 50 | retry(); |
| 51 | }); |
| 52 | } |
no test coverage detected