From 00ccad1d9b73fac8445c10b885ced7f6c2006871 Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Tue, 28 Aug 2018 13:42:42 +0100 Subject: [PATCH] Fix isavailable --- lib/core/modules/coderunner/runCode.js | 4 ++-- lib/modules/ens/embarkjs.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/core/modules/coderunner/runCode.js b/lib/core/modules/coderunner/runCode.js index 3db6de7bf..cdf3b5ae5 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 3a8418daa..7e84f1046 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); };