Left: | ||
Right: |
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-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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
102 transaction.oncomplete = event => | 102 transaction.oncomplete = event => |
103 { | 103 { |
104 resolve(filesData); | 104 resolve(filesData); |
105 }; | 105 }; |
106 | 106 |
107 cursorReq.onsuccess = event => | 107 cursorReq.onsuccess = event => |
108 { | 108 { |
109 let cursor = event.currentTarget.result; | 109 let cursor = event.currentTarget.result; |
110 if (cursor) | 110 if (cursor) |
111 { | 111 { |
112 let value = cursor.value; | 112 let {value} = cursor; |
Sebastian Noack
2018/06/15 20:13:57
Shouldn't this one at least trigger an eslint erro
hub
2018/06/15 20:20:03
both were triggered. that's why I'm fixing them.
Sebastian Noack
2018/06/15 21:18:33
Weird, not for me:
$ hg id
d97edcab2c18 tip next
| |
113 | 113 |
114 filesData.push({ | 114 filesData.push({ |
115 fileName: cursor.key, | 115 fileName: cursor.key, |
116 content: value.content, | 116 content: value.content, |
117 lastModified: value.lastModified | 117 lastModified: value.lastModified |
118 }); | 118 }); |
119 cursor.continue(); | 119 cursor.continue(); |
120 } | 120 } |
121 }; | 121 }; |
122 | 122 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
159 | 159 |
160 function getFile(fileName, dbInstance, storeName) | 160 function getFile(fileName, dbInstance, storeName) |
161 { | 161 { |
162 return new Promise((resolve, reject) => | 162 return new Promise((resolve, reject) => |
163 { | 163 { |
164 let store = getObjectStore(dbInstance, storeName); | 164 let store = getObjectStore(dbInstance, storeName); |
165 let req = store.get(fileToKey(fileName)); | 165 let req = store.get(fileToKey(fileName)); |
166 | 166 |
167 req.onsuccess = event => | 167 req.onsuccess = event => |
168 { | 168 { |
169 let result = event.currentTarget.result; | 169 let {result} = event.currentTarget; |
170 | 170 |
171 if (result) | 171 if (result) |
172 resolve(result); | 172 resolve(result); |
173 else | 173 else |
174 reject({type: "NoSuchFile"}); | 174 reject({type: "NoSuchFile"}); |
175 }; | 175 }; |
176 req.onerror = reject; | 176 req.onerror = reject; |
177 }); | 177 }); |
178 } | 178 } |
179 | 179 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
294 fileName: fileToKey(newName), | 294 fileName: fileToKey(newName), |
295 content: fileData.content, | 295 content: fileData.content, |
296 lastModified: fileData.lastModified | 296 lastModified: fileData.lastModified |
297 }, | 297 }, |
298 dbInstance, | 298 dbInstance, |
299 dbConfig.storeName)) | 299 dbConfig.storeName)) |
300 .then(() => deleteFile(fromFile, dbInstance, dbConfig.storeName)))); | 300 .then(() => deleteFile(fromFile, dbInstance, dbConfig.storeName)))); |
301 } | 301 } |
302 }; | 302 }; |
303 | 303 |
OLD | NEW |