diff --git a/src/app/debugger/debuggerUI/VmDebugger.js b/src/app/debugger/debuggerUI/VmDebugger.js index 2089642b19..0126945ca1 100644 --- a/src/app/debugger/debuggerUI/VmDebugger.js +++ b/src/app/debugger/debuggerUI/VmDebugger.js @@ -75,9 +75,7 @@ function VmDebugger (_parentUI, _traceManager, _codeManager, _solidityProxy, _ca this.asmCode = new CodeListView() this.vmDebuggerLogic.event.register('codeManagerChanged', this.asmCode.changed.bind(this.asmCode)) - this.vmDebuggerLogic.event.register('traceUnloaded', function () { - self.asmCode.changed([], '', -1) - }) + this.vmDebuggerLogic.event.register('traceUnloaded', this.asmCode.reset.bind(this.asmCode)) this.calldataPanel = new CalldataPanel() _parentUI.event.register('indexChanged', this, function (index) { diff --git a/src/app/debugger/debuggerUI/vmDebugger/CodeListView.js b/src/app/debugger/debuggerUI/vmDebugger/CodeListView.js index 0e7f929134..01d7e42354 100644 --- a/src/app/debugger/debuggerUI/vmDebugger/CodeListView.js +++ b/src/app/debugger/debuggerUI/vmDebugger/CodeListView.js @@ -52,6 +52,10 @@ CodeListView.prototype.indexChanged = function (index) { this.codeView.scrollTop = this.itemSelected.offsetTop - parseInt(this.codeView.offsetTop) } +CodeListView.prototype.reset = function () { + this.changed([], '', -1) +} + CodeListView.prototype.changed = function (code, address, index) { if (this.address === address) { return this.indexChanged(index)