warn if compilation result not provided

pull/7/head
yann300 8 years ago
parent 48611de363
commit 5ea84f979f
  1. 3
      src/solidity/localDecoder.js
  2. 10
      src/util/internalCallTree.js

@ -2,6 +2,9 @@
function solidityLocals (vmtraceIndex, internalTreeCall, stack, memory) {
var scope = internalTreeCall.findScope(vmtraceIndex)
if (!scope) {
return { 'error': 'Can\'t display locals. reason: compilation result might not have been provided' }
}
var locals = {}
for (var local in scope.locals) {
let variable = scope.locals[local]

@ -20,8 +20,12 @@ class InternalCallTree {
}
buildTree (trace) {
if (!this.solidityProxy.loaded()) {
console.log('compilation result not loaded. Cannot build internal call tree')
} else {
buildTree(this, 0, '', trace)
}
}
reset () {
this.scopes = {}
@ -31,7 +35,11 @@ class InternalCallTree {
}
findScope (vmtraceIndex) {
var scopeId = util.findLowerBoundValue(vmtraceIndex, Object.keys(this.scopeStarts))
var scopes = Object.keys(this.scopeStarts)
if (!scopes.length) {
return null
}
var scopeId = util.findLowerBoundValue(vmtraceIndex, scopes)
scopeId = this.scopeStarts[scopeId]
var scope = this.scopes[scopeId]
var reg = /(.\d|\d)$/

Loading…
Cancel
Save