Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: lib/compat.js

Issue 29544685: Issue 5510 - Call onerror in case of error (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Created Sept. 14, 2017, 3:45 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 this.responseText = result.responseText; 318 this.responseText = result.responseText;
319 this._responseHeaders = result.responseHeaders; 319 this._responseHeaders = result.responseHeaders;
320 this.readyState = 4; 320 this.readyState = 4;
321 321
322 // Notify event listeners 322 // Notify event listeners
323 const NS_OK = 0; 323 const NS_OK = 0;
324 var eventName = (this.channel.status == NS_OK ? "load" : "error"); 324 var eventName = (this.channel.status == NS_OK ? "load" : "error");
325 var event = {type: eventName}; 325 var event = {type: eventName};
326 326
327 if (this["on" + eventName]) 327 if (this["on" + eventName])
328 this.onload.call(this, event); 328 this["on" + eventName].call(this, event);
329 329
330 var list = this["_" + eventName + "Handlers"]; 330 var list = this["_" + eventName + "Handlers"];
331 for (var i = 0; i < list.length; i++) 331 for (var i = 0; i < list.length; i++)
332 list[i].call(this, event); 332 list[i].call(this, event);
333 }.bind(this); 333 }.bind(this);
334 // HACK (#5066): the code checking whether the connection is allowed is temp orary, 334 // HACK (#5066): the code checking whether the connection is allowed is temp orary,
335 // the actual check should be in the core when we make a decision whether 335 // the actual check should be in the core when we make a decision whether
336 // to update a subscription with current connection or not, thus whether to 336 // to update a subscription with current connection or not, thus whether to
337 // even construct XMLHttpRequest object or not. 337 // even construct XMLHttpRequest object or not.
338 _isSubscriptionDownloadAllowed(function(isAllowed) 338 _isSubscriptionDownloadAllowed(function(isAllowed)
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 var kValue = o[k]; 434 var kValue = o[k];
435 if (predicate.call(thisArg, kValue, k, o)) { 435 if (predicate.call(thisArg, kValue, k, o)) {
436 return kValue; 436 return kValue;
437 } 437 }
438 // e. Increase k by 1. 438 // e. Increase k by 1.
439 k++; 439 k++;
440 } 440 }
441 } 441 }
442 }); 442 });
443 } 443 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld