Merge pull request #13124 from Snuffleupagus/animationStarted-Node

Tweak the pre-processor condition, for Node.js environments, in the `animationStarted` helper (issue 13057)
This commit is contained in:
Tim van der Meij 2021-03-20 18:18:32 +01:00 committed by GitHub
commit 39b485f69f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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;
} }