Skip to content
This repository has been archived by the owner on Mar 3, 2021. It is now read-only.

Remove duplicated function declaration 'Ethdebugger.prototype.debug' #1158

Merged

Conversation

nujabes403
Copy link
Contributor

There is dupliacted function declaration, Ethdebugger.prototype.debug in "Ethdebugger.js" file.

First one:

Ethdebugger.prototype.debug = function (tx) {
  this.setCompilationResult(this.opts.compilationResult())
  if (tx instanceof Object) {
    this.txBrowser.load(tx.hash)
  } else if (tx instanceof String) {
    this.txBrowser.load(tx)
  }
}

Second one:

Ethdebugger.prototype.debug = function (tx) {
  if (this.traceManager.isLoading) {
    return
  }
  if (!tx.to) {
    tx.to = traceHelper.contractCreationToken('0')
  }
  this.setCompilationResult(this.opts.compilationResult())
  this.tx = tx
  var self = this
  this.traceManager.resolveTrace(tx, function (error, result) {
    if (result) {
      self.event.trigger('newTraceLoaded', [self.traceManager.trace])
      if (self.breakpointManager && self.breakpointManager.hasBreakpoint()) {
        self.breakpointManager.jumpNextBreakpoint(false)
      }
      self.storageResolver = new StorageResolver({web3: self.traceManager.web3})
    } else {
      self.statusMessage = error ? error.message : 'Trace not loaded'
    }
  })
}

It seems only second one is used currently, so that it would be ok to remove first one.

@yann300 yann300 merged commit d05ce19 into ethereum:master May 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants