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

Unified Diff: lib/io.js

Issue 29545700: Issue 5685 - Pass ESLint (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Created Sept. 15, 2017, 7:38 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: lib/io.js
===================================================================
--- a/lib/io.js
+++ b/lib/io.js
@@ -10,67 +10,71 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
+"use strict";
+
function readFileAsync(fileName)
{
return new Promise((resolve, reject) =>
{
_fileSystem.read(fileName, (result) =>
{
if (result.error)
return reject(result.error);
resolve(result);
});
});
-};
+}
function writeFileAsync(fileName, content)
{
return new Promise((resolve, reject) =>
{
_fileSystem.write(fileName, content, (error) =>
{
if (error)
return reject(error);
resolve();
});
});
-};
+}
exports.IO =
{
lineBreak: "\n",
readFromFile(fileName, listener)
{
return new Promise((resolve, reject) =>
{
- _fileSystem.readFromFile(fileName, listener, (error) => {
+ _fileSystem.readFromFile(fileName, listener, (error) =>
+ {
if (error)
return reject(error);
resolve();
});
});
},
writeToFile(fileName, generator)
{
let content = Array.from(generator).join(this.lineBreak) + this.lineBreak;
return writeFileAsync(fileName, content);
},
copyFile(fromFileName, toFileName)
{
- return readFileAsync(fromFileName).then(content => writeFileAsync(toFileName, content));
+ return readFileAsync(fromFileName).then(
+ content => writeFileAsync(toFileName, content));
},
renameFile(fromFileName, newNameFile)
{
return new Promise((resolve, reject) =>
{
_fileSystem.move(fromFileName, newNameFile, (error) =>
{
« lib/init.js ('K') | « lib/init.js ('k') | lib/notificationShowRegistration.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld