From 6a8a49c8fbd3f62c5e6d939a7f65fd1096fee65d Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 9 Nov 2017 11:39:12 -0500 Subject: [PATCH] Avoid PhantomJS BroadcastChannel failure Current version of PhantomJS used for unit tests, etc. does not recognize the relatively new BroadcastChannel object. Avoid trying to create such a channel when the executing code does not recognize it. Signed-off-by: Bill Erickson --- Open-ILS/web/js/ui/default/staff/services/auth.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Open-ILS/web/js/ui/default/staff/services/auth.js b/Open-ILS/web/js/ui/default/staff/services/auth.js index 8912c78a4b..ec8300579c 100644 --- a/Open-ILS/web/js/ui/default/staff/services/auth.js +++ b/Open-ILS/web/js/ui/default/staff/services/auth.js @@ -53,7 +53,10 @@ function($q , $timeout , $rootScope , $window , $location , egNet , egHatch) { }, // Listen for logout events in other tabs - authChannel : new BroadcastChannel('eg.auth') + // Current version of phantomjs (unit tests, etc.) does not + // support BroadcastChannel, so just dummy it up. + authChannel : (typeof BroadcastChannel == 'undefined') ? + {} : new BroadcastChannel('eg.auth') }; /* Returns a promise, which is resolved if valid -- 2.11.0