diff --git a/src/app/compiler/compiler.js b/src/app/compiler/compiler.js index b9ba214a0c..4082c5ee51 100644 --- a/src/app/compiler/compiler.js +++ b/src/app/compiler/compiler.js @@ -49,9 +49,7 @@ function Compiler (handleImportCall) { self.lastCompilationResult = null self.event.trigger('compilationFinished', [false, {'error': { formattedMessage: error, severity: 'error' }}, files]) } else { - setTimeout(function () { - compileJSON(input, optimize ? 1 : 0) - }, 0) + compileJSON(input, optimize ? 1 : 0) } }) } diff --git a/src/app/files/basicReadOnlyExplorer.js b/src/app/files/basicReadOnlyExplorer.js index b35fafbc7e..cbf54a2255 100644 --- a/src/app/files/basicReadOnlyExplorer.js +++ b/src/app/files/basicReadOnlyExplorer.js @@ -108,7 +108,7 @@ class BasicReadOnlyExplorer { '/content': self.get(path) }) }) - setTimeout(_ => callback(null, tree), 0) + callback(null, tree) } removePrefix (path) { diff --git a/src/app/files/browser-files.js b/src/app/files/browser-files.js index de26e56fee..ecc42a083b 100644 --- a/src/app/files/browser-files.js +++ b/src/app/files/browser-files.js @@ -118,42 +118,40 @@ function Files (storage) { this.resolveDirectory = function (path, callback) { var self = this // path = '' + (path || '') - setTimeout(function () { - function hashmapize (obj, path, val) { - var nodes = path.split('/') - var i = 0 - for (; i < nodes.length - 1; i++) { - var node = nodes[i] - if (obj[node] === undefined) { - obj[node] = {} - } - obj = obj[node] + function hashmapize (obj, path, val) { + var nodes = path.split('/') + var i = 0 + for (; i < nodes.length - 1; i++) { + var node = nodes[i] + if (obj[node] === undefined) { + obj[node] = {} } - obj[nodes[i]] = val + obj = obj[node] } - var filesList = {} - // add r/w filesList to the list - storage.keys().forEach((path) => { - // NOTE: as a temporary measure do not show the config file - if (path !== '.remix.config') { - filesList[self.type + '/' + path] = false - } - }) - // add r/o files to the list - Object.keys(readonly).forEach((path) => { - filesList[self.type + '/' + path] = true - }) - var tree = {} - // This does not include '.remix.config', because it is filtered - // inside list(). - Object.keys(filesList).forEach(function (path) { - hashmapize(tree, path, { - '/readonly': self.isReadOnly(path), - '/content': self.get(path) - }) + obj[nodes[i]] = val + } + var filesList = {} + // add r/w filesList to the list + storage.keys().forEach((path) => { + // NOTE: as a temporary measure do not show the config file + if (path !== '.remix.config') { + filesList[self.type + '/' + path] = false + } + }) + // add r/o files to the list + Object.keys(readonly).forEach((path) => { + filesList[self.type + '/' + path] = true + }) + var tree = {} + // This does not include '.remix.config', because it is filtered + // inside list(). + Object.keys(filesList).forEach(function (path) { + hashmapize(tree, path, { + '/readonly': self.isReadOnly(path), + '/content': self.get(path) }) - callback(null, tree) - }, 0) + }) + callback(null, tree) } this.removePrefix = function (path) {