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

Unified Diff: lib/io.js

Issue 29531696: Issue 5568 - Improve string handling by splitting read strings into only ASCII and non-ASCII strings (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git
Patch Set: address comments Created Aug. 31, 2017, 1:20 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
« no previous file with comments | « no previous file | src/FileSystemJsObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/io.js
diff --git a/lib/io.js b/lib/io.js
index b3a8326b4fab275d5202544139ba4d1a7b78f1d3..143787db0c55f775aa6eeeaed73d16ff179e9f57 100644
--- a/lib/io.js
+++ b/lib/io.js
@@ -47,11 +47,13 @@ exports.IO =
readFromFile(fileName, listener)
{
- return readFileAsync(fileName).then((result) =>
+ return new Promise((resolve, reject) =>
{
- let lines = result.content.split(/[\r\n]+/);
- for (let line of lines)
- listener(line);
+ _fileSystem.readFromFile(fileName, listener, (error) => {
+ if (error)
+ return reject(error);
+ resolve();
+ });
});
},
« no previous file with comments | « no previous file | src/FileSystemJsObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld