From 71e61c3533b40017306f88f2ac8dc582f6298500 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sat, 20 Mar 2021 13:34:38 +0100 Subject: [PATCH] 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. --- web/ui_utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/ui_utils.js b/web/ui_utils.js index a5995a6c9..44a01b97b 100644 --- a/web/ui_utils.js +++ b/web/ui_utils.js @@ -684,11 +684,11 @@ function waitOnEventOrTimeout({ target, name, delay = 0 }) { const animationStarted = new Promise(function (resolve) { if ( typeof PDFJSDev !== "undefined" && - PDFJSDev.test("LIB && TESTING") && + PDFJSDev.test("LIB") && typeof window === "undefined" ) { // 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); return; }