compiler-discord/src/languages/javascript.js

29 lines
599 B
JavaScript
Raw Normal View History

2019-03-12 10:09:46 +01:00
const Language = require('../struct/Language');
class JavaScript extends Language {
constructor() {
super('javascript', {
aliases: ['javascript', 'js'],
2019-03-12 10:09:46 +01:00
options: {
2019-03-13 06:51:49 +01:00
harmony: () => '',
e: () => ''
2019-03-12 10:09:46 +01:00
}
});
}
runWith(options) {
2019-03-13 06:51:49 +01:00
const ret = { id: this.id, env: {} };
2019-03-12 10:09:46 +01:00
if (options.has('harmony')) {
2019-03-13 06:51:49 +01:00
ret.env.EVAL_HARMONY = 'true';
2019-03-12 10:09:46 +01:00
}
2019-03-13 06:51:49 +01:00
if (options.has('e')) {
ret.env.EVAL_EXPR = 'true';
}
return ret;
2019-03-12 10:09:46 +01:00
}
}
module.exports = JavaScript;