diff --git a/src/languages/csharp.js b/src/languages/csharp.js index 9b27342..070e245 100644 --- a/src/languages/csharp.js +++ b/src/languages/csharp.js @@ -12,10 +12,10 @@ class CSharp extends Language { runWith(options) { if (options.has('e')) { - return { id: this.id, env: { EVAL_EXPR: 'true' } }; + return { env: { EVAL_EXPR: 'true' } }; } - return super.runWith(options); + return {}; } } diff --git a/src/languages/haskell.js b/src/languages/haskell.js index ceeb7e3..7e86266 100644 --- a/src/languages/haskell.js +++ b/src/languages/haskell.js @@ -12,10 +12,10 @@ class Haskell extends Language { runWith(options) { if (options.has('e')) { - return { id: this.id, env: { EVAL_EXPR: 'true' } }; + return { env: { EVAL_EXPR: 'true' } }; } - return super.runWith(options); + return {}; } } diff --git a/src/languages/julia.js b/src/languages/julia.js index fc26a1d..09b6e27 100644 --- a/src/languages/julia.js +++ b/src/languages/julia.js @@ -12,10 +12,10 @@ class Julia extends Language { runWith(options) { if (options.has('e')) { - return { id: this.id, env: { EVAL_EXPR: 'true' } }; + return { env: { EVAL_EXPR: 'true' } }; } - return super.runWith(options); + return {}; } } diff --git a/src/languages/python.js b/src/languages/python.js index cb68687..d2d91f2 100644 --- a/src/languages/python.js +++ b/src/languages/python.js @@ -13,10 +13,10 @@ class Python extends Language { runWith(options) { if (options.has('2')) { - return { id: 'python2', env: {} }; + return { id: 'python2' }; } - return { id: 'python3', env: {} }; + return { id: 'python3' }; } } diff --git a/src/struct/Language.js b/src/struct/Language.js index 760d403..f3b1441 100644 --- a/src/struct/Language.js +++ b/src/struct/Language.js @@ -15,7 +15,7 @@ class Language extends AkairoModule { } runWith() { - return { id: this.id, env: {} }; + return {}; } } diff --git a/src/struct/LanguageHandler.js b/src/struct/LanguageHandler.js index 411f2a5..c8d70a9 100644 --- a/src/struct/LanguageHandler.js +++ b/src/struct/LanguageHandler.js @@ -62,7 +62,7 @@ class LanguageHandler extends AkairoHandler { evalCode(message, { language, code, options }) { return new Promise((resolve, reject) => { const name = `comp_iler-${message.id}-${Date.now()}`; - const { id, env } = language.runWith(options); + const { id = language.id, env = {} } = language.runWith(options); const proc = childProcess.spawn('docker', [ 'run', '--rm', `--name=${name}`, '-u1000', '-w/tmp/', '--net=none', `--cpus=${this.client.config.cpus}`, `-m=${this.client.config.memory}`,