compiler-discord/src/languages/javascript.js
2019-03-14 20:29:03 -04:00

28 lines
599 B
JavaScript

const Language = require('../struct/Language');
class JavaScript extends Language {
constructor() {
super('javascript', {
aliases: ['javascript', 'js'],
options: {
harmony: () => '',
e: () => ''
}
});
}
runWith(options) {
const ret = { id: this.id, env: {} };
if (options.has('harmony')) {
ret.env.EVAL_HARMONY = 'true';
}
if (options.has('e')) {
ret.env.EVAL_EXPR = 'true';
}
return ret;
}
}
module.exports = JavaScript;