refactor: remove redudant extra indexChange event and move logic under callback of the step manager stepChanged event

pull/3094/head
Iuri Matias 6 years ago committed by yann300
parent aaaba3229d
commit b677b00550
  1. 17
      src/app/debugger/debuggerUI.js

@ -29,8 +29,6 @@ var css = csjs`
class DebuggerUI {
constructor (container) {
const self = this
this.registry = globalRegistry
this.event = new EventManager()
@ -48,18 +46,10 @@ class DebuggerUI {
this.startTxBrowser()
this.stepManager = null
this.tx
this.statusMessage = ''
this.view
this.event.register('indexChanged', this, function (index) {
self.debugger.codeManager.resolveStep(index, self.tx)
self.transactionDebugger.step_manager.event.trigger('indexChanged', [index])
self.transactionDebugger.vmDebuggerLogic.event.trigger('indexChanged', [index])
self.transactionDebugger.registerAndHighlightCodeItem(index)
})
container.appendChild(this.render())
this.setEditor()
@ -163,8 +153,11 @@ class DebuggerUI {
this.transactionDebugger.debug(tx, () => {
self.stepManager = new StepManagerUI(this.transactionDebugger.step_manager)
self.stepManager.event.register('stepChanged', this, function (stepIndex) {
self.event.trigger('indexChanged', [stepIndex])
self.transactionDebugger.step_manager.event.register('stepChanged', this, function (stepIndex) {
self.transactionDebugger.debugger.codeManager.resolveStep(stepIndex, self.tx)
self.transactionDebugger.step_manager.event.trigger('indexChanged', [stepIndex])
self.transactionDebugger.vmDebuggerLogic.event.trigger('indexChanged', [stepIndex])
self.transactionDebugger.registerAndHighlightCodeItem(stepIndex)
})
self.vmDebugger = new VmDebugger(this.transactionDebugger.vmDebuggerLogic)

Loading…
Cancel
Save