Index: lib/io.js |
diff --git a/lib/io.js b/lib/io.js |
index 6a07389c6f2eafec04176b87cf46de1cacbd17c6..2abd6bdd4fbe4ce53cfe45b64ae357253c4a27cd 100644 |
--- a/lib/io.js |
+++ b/lib/io.js |
@@ -15,6 +15,8 @@ |
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
*/ |
+"use strict"; |
+ |
const keyPrefix = "file:"; |
function fileToKey(file) |
@@ -26,7 +28,7 @@ function loadFile(file, successCallback, errorCallback) |
{ |
let key = fileToKey(file); |
- ext.storage.get([key], function(items) |
+ ext.storage.get([key], items => |
{ |
let entry = items[key]; |
@@ -51,12 +53,9 @@ function saveFile(file, data, callback) |
exports.IO = |
{ |
- resolveFilePath: function(path) |
- { |
- return new FakeFile(path); |
- }, |
+ resolveFilePath: path => new FakeFile(path), |
- readFromFile: function(file, listener, callback) |
+ readFromFile: (file, listener, callback) => |
{ |
function onLoaded(entry) |
{ |
@@ -70,12 +69,12 @@ exports.IO = |
loadFile(file, onLoaded, callback); |
}, |
- writeToFile: function(file, data, callback) |
+ writeToFile: (file, data, callback) => |
{ |
saveFile(file, data, callback); |
}, |
- copyFile: function(fromFile, toFile, callback) |
+ copyFile: (fromFile, toFile, callback) => |
{ |
function onLoaded(entry) |
{ |
@@ -85,11 +84,11 @@ exports.IO = |
loadFile(fromFile, onLoaded, callback); |
}, |
- renameFile: function(fromFile, newName, callback) |
+ renameFile: (fromFile, newName, callback) => |
{ |
function onLoaded(entry) |
{ |
- ext.storage.remove(fileToKey(fromFile), function() |
+ ext.storage.remove(fileToKey(fromFile), () => |
{ |
ext.storage.set(keyPrefix + newName, entry, callback); |
}); |
@@ -98,12 +97,12 @@ exports.IO = |
loadFile(fromFile, onLoaded, callback); |
}, |
- removeFile: function(file, callback) |
+ removeFile: (file, callback) => |
{ |
ext.storage.remove(fileToKey(file), callback); |
}, |
- statFile: function(file, callback) |
+ statFile: (file, callback) => |
{ |
function onLoaded(entry) |
{ |