aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/js
diff options
context:
space:
mode:
authorPeter Wu2014-08-02 16:49:47 +0200
committerPim van den Berg2014-11-14 00:09:56 +0100
commitf374250927c641a8ded1d912e380fee50ca6c944 (patch)
treea8fe4ed35fdd186ce6b72d4815f0f07e8f9bb790 /js
parentjsrrdgraph: Simplify matching logic (diff)
downloadapt-panopticon_cgp-f374250927c641a8ded1d912e380fee50ca6c944.zip
apt-panopticon_cgp-f374250927c641a8ded1d912e380fee50ca6c944.tar.gz
apt-panopticon_cgp-f374250927c641a8ded1d912e380fee50ca6c944.tar.bz2
apt-panopticon_cgp-f374250927c641a8ded1d912e380fee50ca6c944.tar.xz
jsrrdgraph: Guard out antique browsers for happier debugging
Comment out more code that existed solely for IE10 and older. This prevents breaking the "Break on exceptions" functionality of the Chromium developer tools for no gain. This also removes the final jshint warnings from this file.
Diffstat (limited to 'js')
-rw-r--r--js/binaryXHR.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/js/binaryXHR.js b/js/binaryXHR.js
index d18f6a8..91915e6 100644
--- a/js/binaryXHR.js
+++ b/js/binaryXHR.js
@@ -48,6 +48,7 @@ function BinaryFile(data) {
48 }; 48 };
49 } else if (typeof DataView != "undefined" && data instanceof ArrayBuffer) { 49 } else if (typeof DataView != "undefined" && data instanceof ArrayBuffer) {
50 dataLength = data.dataLength; 50 dataLength = data.dataLength;
51 /*@cc_on
51 } else if (typeof data === "unknown") { 52 } else if (typeof data === "unknown") {
52 // Correct. "unknown" as type. MS JScript 8 added this. 53 // Correct. "unknown" as type. MS JScript 8 added this.
53 dataLength = IEBinary_getLength(data); 54 dataLength = IEBinary_getLength(data);
@@ -55,6 +56,7 @@ function BinaryFile(data) {
55 this.getByteAt = function(iOffset) { 56 this.getByteAt = function(iOffset) {
56 return IEBinary_getByteAt(data, iOffset); 57 return IEBinary_getByteAt(data, iOffset);
57 }; 58 };
59 @*/
58 } else { 60 } else {
59 throw new InvalidBinaryFile("Unsupported type " + (typeof data)); 61 throw new InvalidBinaryFile("Unsupported type " + (typeof data));
60 } 62 }
@@ -249,6 +251,7 @@ function FetchBinaryURL(url) {
249 request.send(null); 251 request.send(null);
250 252
251 var response = request.responseText; 253 var response = request.responseText;
254 /*@cc_on
252 try { 255 try {
253 // for older IE versions, the value in responseText is not usable 256 // for older IE versions, the value in responseText is not usable
254 if (IEBinary_getLength(this.responseBody)>0) { 257 if (IEBinary_getLength(this.responseBody)>0) {
@@ -256,8 +259,8 @@ function FetchBinaryURL(url) {
256 response=this.responseBody; 259 response=this.responseBody;
257 } 260 }
258 } catch (err) { 261 } catch (err) {
259 // not IE, do nothing
260 } 262 }
263 @*/
261 264
262 // cannot use responseType == "arraybuffer" for synchronous requests, so 265 // cannot use responseType == "arraybuffer" for synchronous requests, so
263 // convert it afterwards 266 // convert it afterwards
@@ -287,6 +290,7 @@ function FetchBinaryURLAsync(url, callback, callback_arg) {
287 if(this.readyState === 4) { 290 if(this.readyState === 4) {
288 // ArrayBuffer response or just the response as string 291 // ArrayBuffer response or just the response as string
289 var response = this.response || this.responseText; 292 var response = this.response || this.responseText;
293 /*@cc_on
290 try { 294 try {
291 // for older IE versions, the value in responseText is not usable 295 // for older IE versions, the value in responseText is not usable
292 if (IEBinary_getLength(this.responseBody)>0) { 296 if (IEBinary_getLength(this.responseBody)>0) {
@@ -294,8 +298,8 @@ function FetchBinaryURLAsync(url, callback, callback_arg) {
294 response=this.responseBody; 298 response=this.responseBody;
295 } 299 }
296 } catch (err) { 300 } catch (err) {
297 // not IE, do nothing
298 } 301 }
302 @*/
299 303
300 var bf = new BinaryFile(response); 304 var bf = new BinaryFile(response);
301 if (callback_arg) { 305 if (callback_arg) {