(fn, bookkeeping)
| 764 | } |
| 765 | |
| 766 | function batchedUpdates(fn, bookkeeping) { |
| 767 | if (isInsideEventHandler) { |
| 768 | // If we are currently inside another batch, we need to wait until it |
| 769 | // fully completes before restoring state. |
| 770 | return fn(bookkeeping); |
| 771 | } |
| 772 | |
| 773 | isInsideEventHandler = true; |
| 774 | |
| 775 | try { |
| 776 | return batchedUpdatesImpl(fn, bookkeeping); |
| 777 | } finally { |
| 778 | isInsideEventHandler = false; |
| 779 | finishEventHandler(); |
| 780 | } |
| 781 | } |
| 782 | function batchedEventUpdates(fn, a, b) { |
| 783 | if (isBatchingEventUpdates) { |
| 784 | // If we are currently inside another batch, we need to wait until it |
no test coverage detected