diff --git a/src/app/debugger/debuggerUI/VmDebugger.js b/src/app/debugger/debuggerUI/VmDebugger.js index 2bbf584a04..7bd079b308 100644 --- a/src/app/debugger/debuggerUI/VmDebugger.js +++ b/src/app/debugger/debuggerUI/VmDebugger.js @@ -31,7 +31,13 @@ function VmDebugger (_parentUI, _traceManager, _codeManager, _solidityProxy, _ca let _parent = _parentUI.debugger var self = this this.view - this.asmCode = new CodeListView(_parent, _codeManager) + + this.asmCode = new CodeListView() + _codeManager.event.register('changed', this.asmCode.changed.bind(this.asmCode)) + _parent.event.register('traceUnloaded', this, function () { + self.asmCode.changed([], '', -1) + }) + this.stackPanel = new StackPanel(_parentUI, _traceManager) this.storagePanel = new StoragePanel(_parentUI, _traceManager) this.memoryPanel = new MemoryPanel(_parentUI, _traceManager) diff --git a/src/app/debugger/debuggerUI/vmDebugger/CodeListView.js b/src/app/debugger/debuggerUI/vmDebugger/CodeListView.js index 328bea2f7d..0e7f929134 100644 --- a/src/app/debugger/debuggerUI/vmDebugger/CodeListView.js +++ b/src/app/debugger/debuggerUI/vmDebugger/CodeListView.js @@ -15,10 +15,8 @@ var css = csjs` max-height: 150px; } ` -function CodeListView (_parent, _codeManager) { +function CodeListView () { this.event = new EventManager() - this.parent = _parent - this.codeManager = _codeManager this.code this.address this.codeView @@ -30,21 +28,12 @@ function CodeListView (_parent, _codeManager) { this.basicPanel.event.register('show', () => { this.event.trigger('show', []) }) - this.init() } CodeListView.prototype.render = function () { return yo`
${this.basicPanel.render({height: style.instructionsList.height})}
` } -CodeListView.prototype.init = function () { - var self = this - this.codeManager.event.register('changed', this, this.changed) - this.parent.event.register('traceUnloaded', this, function () { - self.changed([], '', -1) - }) -} - CodeListView.prototype.indexChanged = function (index) { if (index < 0) return if (this.itemSelected) {