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

Unified Diff: lib/adblockplus_compat.js

Issue 8492145: Fixed: IO.readFromFile expects a listener object, not a callback (Closed)
Patch Set: Created Oct. 9, 2012, 5:56 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
« .hgsubstate ('K') | « .hgsubstate ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/adblockplus_compat.js
===================================================================
--- a/lib/adblockplus_compat.js
+++ b/lib/adblockplus_compat.js
@@ -203,19 +203,22 @@ require.scopes.io =
}, callback);
}, callback);
},
copyFile: function(fromFile, toFile, callback)
{
// Simply combine read and write operations
var data = [];
- this.readFromFile(fromFile, false, function(line)
- {
- data.push(line);
+ this.readFromFile(fromFile, false, {
+ process: function(line)
+ {
+ if (line !== null)
+ data.push(line);
+ }
}, function(e)
{
if (e)
callback(e);
else
this.writeToFile(toFile, false, data, callback);
}.bind(this));
},
« .hgsubstate ('K') | « .hgsubstate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld