simplify code

pull/1/head
Iuri Matias 6 years ago committed by yann300
parent 487e9184cf
commit 92641f1290
  1. 26
      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] self.currentCall = callsPath[callsPath.length - 1]
if (self.currentCall.reverted) { if (self.currentCall.reverted) {
let revertedReason = self.currentCall.outofgas ? 'outofgas' : '' let revertedReason = self.currentCall.outofgas ? 'outofgas' : ''
if (self.buttonNavigator) {
self.revertionPoint = self.currentCall.return self.revertionPoint = self.currentCall.return
if (self.buttonNavigator) {
self.buttonNavigator.resetWarning(revertedReason) self.buttonNavigator.resetWarning(revertedReason)
} }
} else { return
var k = callsPath.length - 2 }
while (k >= 0) { for (var k = callsPath.length - 2; k >= 0; k--) {
var parent = callsPath[k] var parent = callsPath[k]
if (parent.reverted) { if (!parent.reverted) continue
let revertedReason = parent ? 'parenthasthrown' : ''
if (self.buttonNavigator) {
self.revertionPoint = parent.return self.revertionPoint = parent.return
self.buttonNavigator.resetWarning(revertedReason) if (self.buttonNavigator) {
} self.buttonNavigator.resetWarning('parenthasthrown')
} }
k--
} }
if (self.buttonNavigator) { if (self.buttonNavigator) {
self.buttonNavigator.resetWarning('') 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