MCPcopy Create free account
hub / github.com/reactjs/react-rails / flushWork

Function flushWork

lib/assets/react-source/development/react.js:3362–3407  ·  view source on GitHub ↗
(hasTimeRemaining, initialTime)

Source from the content-addressed store, hash-verified

3360 }
3361
3362 function flushWork(hasTimeRemaining, initialTime) {
3363 {
3364 markSchedulerUnsuspended(initialTime);
3365 } // We'll need a host callback the next time work is scheduled.
3366
3367
3368 isHostCallbackScheduled = false;
3369
3370 if (isHostTimeoutScheduled) {
3371 // We scheduled a timeout but it's no longer needed. Cancel it.
3372 isHostTimeoutScheduled = false;
3373 cancelHostTimeout();
3374 }
3375
3376 isPerformingWork = true;
3377 var previousPriorityLevel = currentPriorityLevel;
3378
3379 try {
3380 if (enableProfiling) {
3381 try {
3382 return workLoop(hasTimeRemaining, initialTime);
3383 } catch (error) {
3384 if (currentTask !== null) {
3385 var currentTime = exports.unstable_now();
3386 markTaskErrored(currentTask, currentTime);
3387 currentTask.isQueued = false;
3388 }
3389
3390 throw error;
3391 }
3392 } else {
3393 // No catch in prod codepath.
3394 return workLoop(hasTimeRemaining, initialTime);
3395 }
3396 } finally {
3397 currentTask = null;
3398 currentPriorityLevel = previousPriorityLevel;
3399 isPerformingWork = false;
3400
3401 {
3402 var _currentTime = exports.unstable_now();
3403
3404 markSchedulerSuspended(_currentTime);
3405 }
3406 }
3407 }
3408
3409 function workLoop(hasTimeRemaining, initialTime) {
3410 var currentTime = initialTime;

Callers

nothing calls this directly

Calls 4

markSchedulerUnsuspendedFunction · 0.85
workLoopFunction · 0.85
markTaskErroredFunction · 0.85
markSchedulerSuspendedFunction · 0.85

Tested by

no test coverage detected