clarity icon indicating copy to clipboard operation
clarity copied to clipboard

`requestIdleCallback` polyfill is wrongly implemented

Open Joozty opened this issue 3 years ago • 0 comments

The timeRemaing callback in requestIdleCallback polyfill always returns the same number.

Steps to replicate:

Run this function

requestIdleCallbackPolyfill((deadline) => {
    // infinite loop
     while (deadline.timeRemaining() > 0) {
            console.log((deadline.timeRemaining());
     }
})

Suggested changes: https://www.diffchecker.com/oBCHzF5I

Joozty avatar May 03 '22 11:05 Joozty