(fn, a)
| 22046 | } |
| 22047 | } |
| 22048 | function flushSync(fn, a) { |
| 22049 | if ((executionContext & (RenderContext | CommitContext)) !== NoContext) { |
| 22050 | { |
| 22051 | { |
| 22052 | throw Error( "flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering." ); |
| 22053 | } |
| 22054 | } |
| 22055 | } |
| 22056 | |
| 22057 | var prevExecutionContext = executionContext; |
| 22058 | executionContext |= BatchedContext; |
| 22059 | |
| 22060 | try { |
| 22061 | return runWithPriority$1(ImmediatePriority, fn.bind(null, a)); |
| 22062 | } finally { |
| 22063 | executionContext = prevExecutionContext; // Flush the immediate callbacks that were scheduled during this batch. |
| 22064 | // Note that this will happen even if batchedUpdates is higher up |
| 22065 | // the stack. |
| 22066 | |
| 22067 | flushSyncCallbackQueue(); |
| 22068 | } |
| 22069 | } |
| 22070 | |
| 22071 | function prepareFreshStack(root, expirationTime) { |
| 22072 | root.finishedWork = null; |
no test coverage detected