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-2017 eyeo GmbH | 3 * Copyright (C) 2006-2017 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 25 matching lines...) Expand all Loading... |
36 for (var i = 0; i < lines.length; i++) | 36 for (var i = 0; i < lines.length; i++) |
37 listener.process(lines[i]); | 37 listener.process(lines[i]); |
38 listener.process(null); | 38 listener.process(null); |
39 callback(null); | 39 callback(null); |
40 } | 40 } |
41 }); | 41 }); |
42 }, | 42 }, |
43 | 43 |
44 writeToFile: function(file, data, callback, timeLineID) | 44 writeToFile: function(file, data, callback, timeLineID) |
45 { | 45 { |
46 var content = data.join(this.lineBreak) + this.lineBreak; | 46 let content = Array.from(data).join(this.lineBreak) + this.lineBreak; |
47 _fileSystem.write(file.path, content, callback); | 47 _fileSystem.write(file.path, content, callback); |
48 }, | 48 }, |
49 | 49 |
50 copyFile: function(fromFile, toFile, callback) | 50 copyFile: function(fromFile, toFile, callback) |
51 { | 51 { |
52 // Simply combine read and write operations | 52 // Simply combine read and write operations |
53 var data = []; | 53 var data = []; |
54 this.readFromFile(fromFile, { | 54 this.readFromFile(fromFile, { |
55 process: function(line) | 55 process: function(line) |
56 { | 56 { |
(...skipping 20 matching lines...) Expand all Loading... |
77 }, | 77 }, |
78 | 78 |
79 statFile: function(file, callback) | 79 statFile: function(file, callback) |
80 { | 80 { |
81 _fileSystem.stat(file.path, function(result) | 81 _fileSystem.stat(file.path, function(result) |
82 { | 82 { |
83 callback(result.error, result); | 83 callback(result.error, result); |
84 }); | 84 }); |
85 } | 85 } |
86 }; | 86 }; |
OLD | NEW |