diff options
author | RabsRincon <rubrinbla@gmail.com> | 2017-12-29 11:07:34 +0100 |
---|---|---|
committer | RabsRincon <rubrinbla@gmail.com> | 2017-12-29 11:08:01 +0100 |
commit | 3692c298a6cc7f365cf6858698dac062af1c838c (patch) | |
tree | 47203c44b8b01923d9740f5a46e0d5bdc5a0bf1b | |
parent | 738d60de5686d15d8f566ff804d0ca9a6162cf37 (diff) | |
download | compiler-explorer-3692c298a6cc7f365cf6858698dac062af1c838c.tar.gz compiler-explorer-3692c298a6cc7f365cf6858698dac062af1c838c.zip |
Stop storing the same info twice
-rw-r--r-- | lib/base-compiler.js | 11 | ||||
-rw-r--r-- | lib/compilers/pascal.js | 4 | ||||
-rw-r--r-- | static/compiler.js | 1 |
3 files changed, 7 insertions, 9 deletions
diff --git a/lib/base-compiler.js b/lib/base-compiler.js index ad0df152e..747e3e6f4 100644 --- a/lib/base-compiler.js +++ b/lib/base-compiler.js @@ -39,14 +39,13 @@ const child_process = require('child_process'), function Compile(compiler, env) { this.compiler = compiler; - this.lang = compiler.lang; - this.langInfo = languages[this.lang]; - if (!this.langInfo) { - throw new Error("Missing language info for " + this.lang); + this.lang = languages[compiler.lang]; + if (!this.lang) { + throw new Error("Missing language info for " + compiler.lang); } - this.compileFilename = 'example' + this.langInfo.extensions[0]; + this.compileFilename = 'example' + this.lang.extensions[0]; this.env = env; - this.compilerProps = _.partial(this.env.compilerPropsL, this.lang); + this.compilerProps = _.partial(this.env.compilerPropsL, this.lang.id); this.asm = new asm.AsmParser(this.compilerPropsL); this.compiler.supportsIntel = !!this.compiler.intelAsm; } diff --git a/lib/compilers/pascal.js b/lib/compilers/pascal.js index 8be044285..21049ad98 100644 --- a/lib/compilers/pascal.js +++ b/lib/compilers/pascal.js @@ -65,11 +65,11 @@ function compileFPC(info, env) { }; compiler.getOutputFilename = function (dirPath, outputFilebase) { - return path.join(dirPath, path.basename(this.compileFilename, this.langInfo.extensions[0]) + ".s"); + return path.join(dirPath, path.basename(this.compileFilename, this.lang.extensions[0]) + ".s"); }; var saveDummyProjectFile = function (filename) { - const unitName = path.basename(compiler.compileFilename, compiler.langInfo.extensions[0]); + const unitName = path.basename(compiler.compileFilename, compiler.lang.extensions[0]); fs.writeFileSync(filename, "program prog; " + diff --git a/static/compiler.js b/static/compiler.js index 12339fe24..2f8d58207 100644 --- a/static/compiler.js +++ b/static/compiler.js @@ -627,7 +627,6 @@ define(function (require) { }; Compiler.prototype.onEditorChange = function (editor, source, langId) { - console.log(editor, this.sourceEditorId, langId, this.currentLangId); if (editor === this.sourceEditorId && langId === this.currentLangId) { this.source = source; this.compile(); |