diff --git a/src/lib/core/modules/coderunner/runCode.js b/src/lib/core/modules/coderunner/runCode.js index c8dbe9cee..e5dd781b8 100644 --- a/src/lib/core/modules/coderunner/runCode.js +++ b/src/lib/core/modules/coderunner/runCode.js @@ -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 }); }