simplify code

pull/1/head
Iuri Matias 6 years ago committed by yann300
parent 487e9184cf
commit 92641f1290
  1. 48
      src/app/debugger/debuggerUI/StepManager.js

@ -53,32 +53,28 @@ function StepManager (_parent, _traceManager) {
if (self.buttonNavigator) { if (self.buttonNavigator) {
self.buttonNavigator.resetWarning('') self.buttonNavigator.resetWarning('')
} }
} else { return
self.currentCall = callsPath[callsPath.length - 1] }
if (self.currentCall.reverted) { self.currentCall = callsPath[callsPath.length - 1]
let revertedReason = self.currentCall.outofgas ? 'outofgas' : '' if (self.currentCall.reverted) {
if (self.buttonNavigator) { let revertedReason = self.currentCall.outofgas ? 'outofgas' : ''
self.revertionPoint = self.currentCall.return self.revertionPoint = self.currentCall.return
self.buttonNavigator.resetWarning(revertedReason) if (self.buttonNavigator) {
} self.buttonNavigator.resetWarning(revertedReason)
} else { }
var k = callsPath.length - 2 return
while (k >= 0) { }
var parent = callsPath[k] for (var k = callsPath.length - 2; k >= 0; k--) {
if (parent.reverted) { var parent = callsPath[k]
let revertedReason = parent ? 'parenthasthrown' : '' if (!parent.reverted) continue
if (self.buttonNavigator) { self.revertionPoint = parent.return
self.revertionPoint = parent.return if (self.buttonNavigator) {
self.buttonNavigator.resetWarning(revertedReason) self.buttonNavigator.resetWarning('parenthasthrown')
}
}
k--
}
if (self.buttonNavigator) {
self.buttonNavigator.resetWarning('')
}
} }
} }
if (self.buttonNavigator) {
self.buttonNavigator.resetWarning('')
}
}) })
}) })
@ -134,10 +130,6 @@ StepManager.prototype.init = function () {
this.changeState(0) this.changeState(0)
} }
StepManager.prototype.newTraceAvailable = function () {
this.init()
}
StepManager.prototype.jumpTo = function (step) { StepManager.prototype.jumpTo = function (step) {
if (!this.traceManager.inRange(step)) return if (!this.traceManager.inRange(step)) return
this.slider.setValue(step) this.slider.setValue(step)

Loading…
Cancel
Save