remove unneeded console logs; prevent crash when step is out of bounds

pull/7/head
Iuri Matias 6 years ago
parent c4267d4394
commit 8b8943fc35
  1. 8
      remix-debug/src/cmdline/index.js
  2. 4
      remix-debug/src/debugger/debugger.js
  3. 2
      remix-debug/src/debugger/solidityLocals.js
  4. 4
      remix-debug/src/debugger/solidityState.js

@ -42,10 +42,6 @@ class CmdLine {
getSource() {
const self = this
console.dir("getSource")
console.dir(this.lineColumnPos)
console.dir(this.filename)
let lineColumnPos = this.lineColumnPos
if (!lineColumnPos || !lineColumnPos.start) return;
@ -111,10 +107,6 @@ class CmdLine {
displayGlobals () {
console.dir("= displayGlobals")
console.dir(this.solidityState)
if (this.solidityState && this.solidityState.voters) {
console.dir(this.solidityState.voters)
console.dir(this.solidityState.voters.value)
}
}
}

@ -115,6 +115,10 @@ Debugger.prototype.debugTx = function (tx, loadingCb) {
this.vmDebuggerLogic.start()
this.step_manager.event.register('stepChanged', this, function (stepIndex) {
if (!stepIndex) {
return self.event.trigger("endDebug")
}
self.debugger.codeManager.resolveStep(stepIndex, tx)
self.step_manager.event.trigger('indexChanged', [stepIndex])
self.vmDebuggerLogic.event.trigger('indexChanged', [stepIndex])

@ -40,7 +40,7 @@ class DebuggerSolidityLocals {
self.stepManager.currentStepIndex,
(error, result) => {
if (error) {
return console.log(error)
return error;
}
var stack = result[0].value
var memory = result[1].value

@ -53,11 +53,7 @@ class DebuggerSolidityState {
decode (index) {
const self = this
console.dir("currentStepIndex")
console.dir(self.stepManager.currentStepIndex)
self.traceManager.getCurrentCalledAddressAt(self.stepManager.currentStepIndex, function (error, address) {
console.dir(error)
console.dir(address)
if (error) {
return self.event.trigger('solidityState', [{}])
}

Loading…
Cancel
Save