@@ -162,7 +162,7 @@ function handleTimeout(currentTime: number) {
162162 }
163163}
164164
165- function flushWork ( hasTimeRemaining : boolean , initialTime : number ) {
165+ function flushWork ( initialTime : number ) {
166166 if ( enableProfiling ) {
167167 markSchedulerUnsuspended ( initialTime ) ;
168168 }
@@ -180,7 +180,7 @@ function flushWork(hasTimeRemaining: boolean, initialTime: number) {
180180 try {
181181 if ( enableProfiling ) {
182182 try {
183- return workLoop ( hasTimeRemaining , initialTime ) ;
183+ return workLoop ( initialTime ) ;
184184 } catch ( error ) {
185185 if ( currentTask !== null ) {
186186 const currentTime = getCurrentTime ( ) ;
@@ -193,7 +193,7 @@ function flushWork(hasTimeRemaining: boolean, initialTime: number) {
193193 }
194194 } else {
195195 // No catch in prod code path.
196- return workLoop ( hasTimeRemaining , initialTime ) ;
196+ return workLoop ( initialTime ) ;
197197 }
198198 } finally {
199199 currentTask = null ;
@@ -206,18 +206,15 @@ function flushWork(hasTimeRemaining: boolean, initialTime: number) {
206206 }
207207}
208208
209- function workLoop ( hasTimeRemaining : boolean , initialTime : number ) {
209+ function workLoop ( initialTime : number ) {
210210 let currentTime = initialTime ;
211211 advanceTimers ( currentTime ) ;
212212 currentTask = peek ( taskQueue ) ;
213213 while (
214214 currentTask !== null &&
215215 ! ( enableSchedulerDebugging && isSchedulerPaused )
216216 ) {
217- if (
218- currentTask . expirationTime > currentTime &&
219- ( ! hasTimeRemaining || shouldYieldToHost ( ) )
220- ) {
217+ if ( currentTask . expirationTime > currentTime && shouldYieldToHost ( ) ) {
221218 // This currentTask hasn't expired, and we've reached the deadline.
222219 break ;
223220 }
@@ -467,10 +464,7 @@ function unstable_getCurrentPriorityLevel(): PriorityLevel {
467464let isMessageLoopRunning = false ;
468465let scheduledHostCallback :
469466 | null
470- | ( (
471- hasTimeRemaining : boolean ,
472- initialTime : DOMHighResTimeStamp | number ,
473- ) => boolean ) = null ;
467+ | ( ( initialTime : DOMHighResTimeStamp | number ) => boolean ) = null ;
474468let taskTimeoutID : TimeoutID = ( - 1 : any ) ;
475469
476470// Scheduler periodically yields in case there is other work on the main
@@ -567,7 +561,6 @@ const performWorkUntilDeadline = () => {
567561 // Keep track of the start time so we can measure how long the main thread
568562 // has been blocked.
569563 startTime = currentTime ;
570- const hasTimeRemaining = true ;
571564
572565 // If a scheduler task throws, exit the current browser task so the
573566 // error can be observed.
@@ -578,7 +571,7 @@ const performWorkUntilDeadline = () => {
578571 let hasMoreWork = true ;
579572 try {
580573 // $FlowFixMe[not-a-function] found when upgrading Flow
581- hasMoreWork = scheduledHostCallback ( hasTimeRemaining , currentTime ) ;
574+ hasMoreWork = scheduledHostCallback ( currentTime ) ;
582575 } finally {
583576 if ( hasMoreWork ) {
584577 // If there's more work, schedule the next message event at the end
@@ -630,9 +623,7 @@ if (typeof localSetImmediate === 'function') {
630623 } ;
631624}
632625
633- function requestHostCallback (
634- callback : ( hasTimeRemaining : boolean , initialTime : number ) = > boolean ,
635- ) {
626+ function requestHostCallback ( callback : ( initialTime : number ) = > boolean ) {
636627 scheduledHostCallback = callback ;
637628 if ( ! isMessageLoopRunning ) {
638629 isMessageLoopRunning = true ;
0 commit comments