[FIX] scheduler: make sure raf is bound to window

This commit is contained in:
Géry Debongnie
2022-01-20 10:31:33 +01:00
committed by Samuel Degueldre
parent 8e36a11b6e
commit 5f24caf40d
+2 -2
View File
@@ -9,13 +9,13 @@ import { STATUS } from "./status";
export class Scheduler {
// capture the value of requestAnimationFrame as soon as possible, to avoid
// interactions with other code, such as test frameworks that override them
static requestAnimationFrame = window.requestAnimationFrame.bind(this);
static requestAnimationFrame = window.requestAnimationFrame.bind(window);
tasks: Set<RootFiber> = new Set();
isRunning: boolean = false;
requestAnimationFrame: Window["requestAnimationFrame"];
constructor() {
this.requestAnimationFrame = requestAnimationFrame;
this.requestAnimationFrame = Scheduler.requestAnimationFrame;
}
start() {