]> git.parisson.com Git - pdf.js.git/commitdiff
used typeof b == undefined
authorsbarman <sbarman@L3CWZ5T.(none)>
Mon, 20 Jun 2011 21:10:10 +0000 (14:10 -0700)
committersbarman <sbarman@L3CWZ5T.(none)>
Mon, 20 Jun 2011 21:10:10 +0000 (14:10 -0700)
pdf.js

diff --git a/pdf.js b/pdf.js
index 4fd3fedce9092de5a36daef6f73f4dc234e3bd71..5b57d0db69d85e22e44398195acc3ff80f96b608 100644 (file)
--- a/pdf.js
+++ b/pdf.js
@@ -288,7 +288,7 @@ var FlateStream = (function() {
 
             while (codeSize < maxLen) {
                 var b;
-                if ((b = bytes[bytesPos++]) == undefined)
+                if (typeof (b = bytes[bytesPos++]) == "undefined")
                     error("Bad encoding in flate stream");
                 codeBuf |= (b << codeSize);
                 codeSize += 8;
@@ -416,16 +416,16 @@ var FlateStream = (function() {
 
             var b;
             if (hdr == 0) { // uncompressed block
-                if ((b = bytes[bytesPos++]) == undefined)
+                if (typeof (b = bytes[bytesPos++]) == "undefined")
                     error("Bad block header in flate stream");
                 var blockLen = b;
-                if ((b = bytes[bytesPos++]) == undefined)
+                if (typeof (b = bytes[bytesPos++]) == "undefined")
                     error("Bad block header in flate stream");
                 blockLen |= (b << 8);
-                if ((b = bytes[bytesPos++]) == undefined)
+                if (typeof (b = bytes[bytesPos++]) == "undefined")
                     error("Bad block header in flate stream");
                 var check = b;
-                if ((b = bytes[bytesPos++]) == undefined)
+                if (typeof (b = bytes[bytesPos++]) == "undefined")
                     error("Bad block header in flate stream");
                 check |= (b << 8);
                 if (check != (~this.blockLen & 0xffff))
@@ -434,7 +434,7 @@ var FlateStream = (function() {
                 var buffer = this.ensureBuffer(bufferLength + blockLen);
                 this.bufferLength = bufferLength + blockLen;
                 for (var n = bufferLength; n < blockLen; ++n) {
-                    if ((b = bytes[bytesPos++]) == undefined) {
+                    if (typeof (b = bytes[bytesPos++]) == "undefined") {
                         this.eof = true;
                         break;
                     }