Tweak the pre-processor condition, for Node.js environments, in the animationStarted helper (issue 13057)

While it's still not entirely clear if this would've prevented the issue as reported, given that the particular use-case reported apparently no longer applies, this small change really cannot hurt in general *and* it won't effect "regular" viewer builds in any way.
This commit is contained in:
Jonas Jenwald 2021-03-20 13:34:38 +01:00
parent d775616fd4
commit 71e61c3533

View File

@ -684,11 +684,11 @@ function waitOnEventOrTimeout({ target, name, delay = 0 }) {
const animationStarted = new Promise(function (resolve) { const animationStarted = new Promise(function (resolve) {
if ( if (
typeof PDFJSDev !== "undefined" && typeof PDFJSDev !== "undefined" &&
PDFJSDev.test("LIB && TESTING") && PDFJSDev.test("LIB") &&
typeof window === "undefined" typeof window === "undefined"
) { ) {
// Prevent "ReferenceError: window is not defined" errors when running the // Prevent "ReferenceError: window is not defined" errors when running the
// unit-tests in Node.js/Travis. // unit-tests in Node.js environments.
setTimeout(resolve, 20); setTimeout(resolve, 20);
return; return;
} }