Got this debugging another error. Filing here for reference. Original code: https://phabricator.intern.facebook.com/P59317705
while (scheduledCallback !== null && !didStop) {
          const cb = scheduledCallback;
          scheduledCallback = null;
          cb({
            timeRemaining() {
              if (units > 0) {
                return 999;
              }
              didStop = true;
              return 0;
            },
          });
          units--;
        }
      }
    };
    global.performance = {
      now() {
        return now;
      },
    };
    global.requestIdleCallback = function(cb) {
      scheduledCallback = cb;
    };
    now = 0;
    expire = function(ms) {
      now += ms;
    };
    global.performance = {
      now() {