Fixed failing JS tests
diff --git a/js/debug.js b/js/debug.js
index 0b2c5f6..4ae3c2a 100644
--- a/js/debug.js
+++ b/js/debug.js
@@ -79,7 +79,7 @@
       type == 'null' || type == 'undefined') {
     return thing;
   }
-  if (window.Uint8Array) {
+  if (typeof Uint8Array !== 'undefined') {
     // Will fail on IE9, where Uint8Array doesn't exist.
     if (message instanceof Uint8Array) {
       return thing;