diff --git a/lib/compilers/dmd.js b/lib/compilers/dmd.js index 20f50142d..89a8d753d 100644 --- a/lib/compilers/dmd.js +++ b/lib/compilers/dmd.js @@ -40,11 +40,12 @@ class DMDCompiler extends BaseCompiler { return ['-g', '-of' + this.filename(outputFilename)]; } - execPostProcess(result, postProcesses, outputFilename, maxSize) { + async execPostProcess(result, postProcesses, outputFilename, maxSize) { const dirPath = path.dirname(outputFilename); const lPath = path.basename(outputFilename); - return this.exec(postProcesses[0], ["-l", lPath], {customCwd: dirPath, maxOutput: maxSize}) - .then(postResult => this.handlePostProcessResult(result, postResult)); + return this.handlePostProcessResult( + result, + await this.exec(postProcesses[0], ["-l", lPath], {customCwd: dirPath, maxOutput: maxSize})); } getOutputFilename(dirPath, outputFilebase) { @@ -57,19 +58,18 @@ class DMDCompiler extends BaseCompiler { return this.runCompiler(compiler, options, inputFilename, execOptions); } - objdump(outputFilename, result, maxSize, intelAsm, demangle) { + async objdump(outputFilename, result, maxSize, intelAsm, demangle) { const dirPath = path.dirname(outputFilename); let args = ["-d", outputFilename, "-l", "--insn-width=16"]; if (demangle) args = args.concat("-C"); if (intelAsm) args = args.concat(["-M", "intel"]); - return this.exec(this.compiler.objdumper, args, {maxOutput: maxSize, customCwd: dirPath}) - .then(objResult => { - result.asm = objResult.stdout; - if (objResult.code !== 0) { - result.asm = ``; - } - return result; - }); + const objResult = await this.exec( + this.compiler.objdumper, args, {maxOutput: maxSize, customCwd: dirPath}); + result.asm = objResult.stdout; + if (objResult.code !== 0) { + result.asm = ``; + } + return result; } getArgumentParser() {