From 9c01d8536a859a8392b4a22131deacc54df83665 Mon Sep 17 00:00:00 2001 From: sbarman Date: Mon, 20 Jun 2011 14:10:10 -0700 Subject: [PATCH] used typeof b == undefined --- pdf.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pdf.js b/pdf.js index 4fd3fedce..5b57d0db6 100644 --- 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; }