Fix isavailable
This commit is contained in:
parent
6c63179fa1
commit
00ccad1d9b
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue