mirror of https://github.com/embarklabs/embark.git
Fix isavailable
This commit is contained in:
parent
6c63179fa1
commit
00ccad1d9b
|
@ -2,14 +2,14 @@ const vm = require('vm');
|
||||||
|
|
||||||
class RunCode {
|
class RunCode {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.context = Object.assign({}, {require, console}, global.this);
|
this.context = Object.assign({}, {console, exports, require, module, __filename, __dirname}, global.this);
|
||||||
}
|
}
|
||||||
|
|
||||||
doEval(code) {
|
doEval(code) {
|
||||||
try {
|
try {
|
||||||
return vm.runInNewContext(code, this.context);
|
return vm.runInNewContext(code, this.context);
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
console.log(e.message)
|
console.log(e.message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -156,7 +156,7 @@ __embarkENS.setProvider = function (config) {
|
||||||
web3.eth.net.getId()
|
web3.eth.net.getId()
|
||||||
.then((id) => {
|
.then((id) => {
|
||||||
const registryAddress = self.registryAddresses[id] || config.registryAddress;
|
const registryAddress = self.registryAddresses[id] || config.registryAddress;
|
||||||
self.isAvailable = true;
|
self._isAvailable = true;
|
||||||
self.ens = new EmbarkJS.Contract({abi: config.registryAbi, address: registryAddress});
|
self.ens = new EmbarkJS.Contract({abi: config.registryAbi, address: registryAddress});
|
||||||
self.registrar = new EmbarkJS.Contract({abi: config.registrarAbi, address: config.registrarAddress});
|
self.registrar = new EmbarkJS.Contract({abi: config.registrarAbi, address: config.registrarAddress});
|
||||||
self.resolver = new EmbarkJS.Contract({abi: config.resolverAbi, address: config.resolverAddress});
|
self.resolver = new EmbarkJS.Contract({abi: config.resolverAbi, address: config.resolverAddress});
|
||||||
|
@ -245,5 +245,5 @@ __embarkENS.registerSubDomain = function (name, address, callback) {
|
||||||
};
|
};
|
||||||
|
|
||||||
__embarkENS.isAvailable = function () {
|
__embarkENS.isAvailable = function () {
|
||||||
return Boolean(this.isAvailable);
|
return Boolean(this._isAvailable);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue