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

Unified Diff: lib/io.js

Issue 29731562: Issue 6477 - separate done and error callbacks in IFileSystem::Read (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git@c0a6434596a83383e37678ef3b6ecef00ed6a261
Patch Set: Created March 23, 2018, 10:58 a.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
diff --git a/lib/io.js b/lib/io.js
index 8cf974d4a87b8834c0262401ebf11b1499d3819b..1cdd590b6811d2e5cb533966ae77bf45d2247e6d 100644
--- a/lib/io.js
+++ b/lib/io.js
@@ -21,12 +21,7 @@ function readFileAsync(fileName)
{
return new Promise((resolve, reject) =>
{
- _fileSystem.read(fileName, (result) =>
- {
- if (result.error)
- return reject(result.error);
- resolve(result);
- });
+ _fileSystem.read(fileName, resolve, reject);
});
}
@@ -51,12 +46,7 @@ exports.IO =
{
return new Promise((resolve, reject) =>
{
- _fileSystem.readFromFile(fileName, listener, (error) =>
- {
- if (error)
- return reject(error);
- resolve();
- });
+ _fileSystem.readFromFile(fileName, listener, resolve, reject);
});
},
« no previous file with comments | « include/AdblockPlus/JsEngine.h ('k') | lib/prefs.js » ('j') | src/FileSystemJsObject.cpp » ('J')

Powered by Google App Engine
This is Rietveld