(fn, a)
| 25606 | } |
| 25607 | } |
| 25608 | function flushSync(fn, a) { |
| 25609 | if ((executionContext & (RenderContext | CommitContext)) !== NoContext) { |
| 25610 | { |
| 25611 | { |
| 25612 | throw Error( "flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering." ); |
| 25613 | } |
| 25614 | } |
| 25615 | } |
| 25616 | |
| 25617 | var prevExecutionContext = executionContext; |
| 25618 | executionContext |= BatchedContext; |
| 25619 | |
| 25620 | try { |
| 25621 | return runWithPriority$1(ImmediatePriority, fn.bind(null, a)); |
| 25622 | } finally { |
| 25623 | executionContext = prevExecutionContext; // Flush the immediate callbacks that were scheduled during this batch. |
| 25624 | // Note that this will happen even if batchedUpdates is higher up |
| 25625 | // the stack. |
| 25626 | |
| 25627 | flushSyncCallbackQueue(); |
| 25628 | } |
| 25629 | } |
| 25630 | |
| 25631 | function prepareFreshStack(root, expirationTime) { |
| 25632 | root.finishedWork = null; |
no test coverage detected