Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/scheduler/src/Scheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,12 @@ var requestHostCallback;
var cancelHostCallback;
var getFrameDeadline;

if (typeof window === 'undefined') {
// "addEventListener" might not be available on the window object
// if this is a mocked "window" object. So we need to validate that too.
if (
typeof window === 'undefined' ||
typeof window.addEventListener !== 'function'
) {
// If this accidentally gets imported in a non-browser environment, fallback
// to a naive implementation.
var timeoutID = -1;
Expand Down