OLD | NEW |
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-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 catch (e) | 53 catch (e) |
54 { | 54 { |
55 return null; | 55 return null; |
56 } | 56 } |
57 } | 57 } |
58 | 58 |
59 function convertObject(keys, obj) | 59 function convertObject(keys, obj) |
60 { | 60 { |
61 var result = {}; | 61 var result = {}; |
62 for (var i = 0; i < keys.length; i++) | 62 for (var i = 0; i < keys.length; i++) |
63 result[keys[i]] = obj[keys[i]]; | 63 { |
| 64 var key = keys[i]; |
| 65 if (key in obj) |
| 66 result[key] = obj[key]; |
| 67 } |
64 return result; | 68 return result; |
65 } | 69 } |
66 | 70 |
67 function convertSubscription(subscription) | 71 function convertSubscription(subscription) |
68 { | 72 { |
69 var obj = convertObject(["disabled", "downloadStatus", "homepage", | 73 var obj = convertObject(["disabled", "downloadStatus", "homepage", |
70 "lastDownload", "title", "url"], subscription); | 74 "lastDownload", "title", "url"], subscription); |
71 obj.isDownloading = Synchronizer.isExecuting(subscription.url); | 75 obj.isDownloading = Synchronizer.isExecuting(subscription.url); |
72 return obj; | 76 return obj; |
73 } | 77 } |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 for (var i = 0; i < subscriptions.length; i++) | 402 for (var i = 0; i < subscriptions.length; i++) |
399 { | 403 { |
400 var subscription = subscriptions[i]; | 404 var subscription = subscriptions[i]; |
401 if (subscription instanceof DownloadableSubscription) | 405 if (subscription instanceof DownloadableSubscription) |
402 Synchronizer.execute(subscription, true); | 406 Synchronizer.execute(subscription, true); |
403 } | 407 } |
404 break; | 408 break; |
405 } | 409 } |
406 }); | 410 }); |
407 })(this); | 411 })(this); |
OLD | NEW |