diff --git a/lib/core/modules/coderunner/runCode.js b/lib/core/modules/coderunner/runCode.js index 3db6de7b..cdf3b5ae 100644 --- a/lib/core/modules/coderunner/runCode.js +++ b/lib/core/modules/coderunner/runCode.js @@ -2,14 +2,14 @@ const vm = require('vm'); class RunCode { constructor() { - this.context = Object.assign({}, {require, console}, global.this); + this.context = Object.assign({}, {console, exports, require, module, __filename, __dirname}, global.this); } doEval(code) { try { return vm.runInNewContext(code, this.context); } catch(e) { - console.log(e.message) + console.log(e.message); } } diff --git a/lib/modules/ens/embarkjs.js b/lib/modules/ens/embarkjs.js index 3a8418da..7e84f104 100644 --- a/lib/modules/ens/embarkjs.js +++ b/lib/modules/ens/embarkjs.js @@ -156,7 +156,7 @@ __embarkENS.setProvider = function (config) { web3.eth.net.getId() .then((id) => { const registryAddress = self.registryAddresses[id] || config.registryAddress; - self.isAvailable = true; + self._isAvailable = true; self.ens = new EmbarkJS.Contract({abi: config.registryAbi, address: registryAddress}); self.registrar = new EmbarkJS.Contract({abi: config.registrarAbi, address: config.registrarAddress}); self.resolver = new EmbarkJS.Contract({abi: config.resolverAbi, address: config.resolverAddress}); @@ -245,5 +245,5 @@ __embarkENS.registerSubDomain = function (name, address, callback) { }; __embarkENS.isAvailable = function () { - return Boolean(this.isAvailable); + return Boolean(this._isAvailable); };