diff --git a/game/game.js b/game/game.js index ab642343a..fbdf0a801 100644 --- a/game/game.js +++ b/game/game.js @@ -8389,13 +8389,13 @@ }); }); }; - game.getFileList=function(dir,callback){ + game.getFileList=(dir,success,failure)=>{ var files=[],folders=[]; - window.resolveLocalFileSystemURL(lib.assetURL+dir,function(entry){ + window.resolveLocalFileSystemURL(lib.assetURL+dir,entry=>{ var dirReader=entry.createReader(); var entries=[]; - var readEntries=function(){ - dirReader.readEntries(function(results){ + var readEntries=()=>{ + dirReader.readEntries(results=>{ if(!results.length){ entries.sort(); for(var i=0;i{ var files=[],folders=[]; dir=__dirname+'/'+dir; - lib.node.fs.readdir(dir,function(err,filelist){ - for(var i=0;i{ + if(err) { + failure(err); + return; + } + lib.node.fs.readdir(dir,(err,filelist)=>{ + if(err){ + failure(err); + return; + } + for(var i=0;i