Skip to content

Commit

Permalink
feat: code runner use fs overrided
Browse files Browse the repository at this point in the history
  • Loading branch information
alaibe committed Dec 17, 2018
1 parent a147e27 commit 944b392
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/core/modules/coderunner/runCode.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
const vm = require('vm');
const fs = require('../../fs');

class RunCode {
constructor({logger}) {
this.logger = logger;
const newGlobal = Object.create(global);
newGlobal.fs = fs;
this.context = Object.assign({}, {
global, console, exports, require, module, __filename, __dirname, process,
global: newGlobal, console, exports, require, module, __filename, __dirname, process,
setTimeout, setInterval, clearTimeout, clearInterval
});
}
Expand Down

0 comments on commit 944b392

Please sign in to comment.