Skip to content

Instantly share code, notes, and snippets.

@sebastienblanc
Last active December 15, 2015 17:19
Show Gist options
  • Save sebastienblanc/5295741 to your computer and use it in GitHub Desktop.
Save sebastienblanc/5295741 to your computer and use it in GitHub Desktop.
// the test case
function testReaddir() {
fs.readdir(basedir, function(e,r) {
vassert.assertTrue(r.length>0);
vassert.testComplete();
})
}
//try 1
this.readdir = function(path, callback) {
vertx.fileSystem.readDir(path, function(result) {
callback();
} );
}
//try 2
this.readdir = function(path, callback) {
vertx.fileSystem.readDir(path, function(err, res) {
callback(err,res);
} );
}
//try 3
this.readdir = function(path, callback) {
vertx.fileSystem.readDir(path, function(err, res) {
callback();
} );
}
// direct binding works
this.readdir = vertx.fileSystem.readDir.bind( vertx.fileSystem );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment