ethDebuggerSelectedItem as property instead of global var

pull/7/head
yann300 9 years ago
parent 6657638702
commit c4649812bc
  1. 4
      src/calldataPanel.js
  2. 4
      src/callstackPanel.js
  3. 2
      src/debugger.js
  4. 2
      src/eventManager.js
  5. 4
      src/memoryPanel.js
  6. 4
      src/stackPanel.js
  7. 3
      src/stepManager.js
  8. 4
      src/storagePanel.js

@ -25,12 +25,12 @@ module.exports = React.createClass({
var self = this
this.context.root.register('indexChanged', this, function (index) {
if (index < 0) return
if (window.ethDebuggerSelectedItem !== index) return
if (self.context.root.ethDebuggerSelectedItem !== index) return
self.context.traceManager.getCallDataAt(index, function (error, calldata) {
if (error) {
console.log(error)
} else if (window.ethDebuggerSelectedItem === index) {
} else if (self.context.root.ethDebuggerSelectedItem === index) {
self.setState({
data: self.format(calldata)
})

@ -25,12 +25,12 @@ module.exports = React.createClass({
var self = this
this.context.root.register('indexChanged', this, function (index) {
if (index < 0) return
if (window.ethDebuggerSelectedItem !== index) return
if (self.context.root.ethDebuggerSelectedItem !== index) return
self.context.traceManager.getCallStackAt(index, function (error, callstack) {
if (error) {
console.log(error)
} else if (window.ethDebuggerSelectedItem === index) {
} else if (self.context.root.ethDebuggerSelectedItem === index) {
self.setState({
data: self.format(callstack)
})

@ -8,6 +8,8 @@ var util = require('./util')
var EventManager = require('./eventManager')
module.exports = React.createClass({
ethDebuggerSelectedItem: -1,
getInitialState: function () {
return {
currentStepIndex: -1, // index of the selected item in the vmtrace

@ -9,7 +9,7 @@ EventManager.prototype.unregister = function (eventName, obj) {
this.registered[eventName].splice(reg, 1)
return
}
}
}
}
EventManager.prototype.register = function (eventName, obj, func) {

@ -26,12 +26,12 @@ module.exports = React.createClass({
var self = this
this.context.root.register('indexChanged', this, function (index) {
if (index < 0) return
if (window.ethDebuggerSelectedItem !== index) return
if (self.context.root.ethDebuggerSelectedItem !== index) return
self.context.traceManager.getMemoryAt(index, function (error, memory) {
if (error) {
console.log(error)
} else if (window.ethDebuggerSelectedItem === index) {
} else if (self.context.root.ethDebuggerSelectedItem === index) {
self.setState({
data: self.formatMemory(memory, 16)
})

@ -25,12 +25,12 @@ module.exports = React.createClass({
var self = this
this.context.root.register('indexChanged', this, function (index) {
if (index < 0) return
if (window.ethDebuggerSelectedItem !== index) return
if (self.context.root.ethDebuggerSelectedItem !== index) return
self.context.traceManager.getStackAt(index, function (error, stack) {
if (error) {
console.log(error)
} else if (window.ethDebuggerSelectedItem === index) {
} else if (self.context.root.ethDebuggerSelectedItem === index) {
self.setState({
data: self.format(stack)
})

@ -50,7 +50,7 @@ module.exports = React.createClass({
},
updateGlobalSelectedItem: function (value) {
window.ethDebuggerSelectedItem = value
this.context.root.ethDebuggerSelectedItem = value
},
init: function () {
@ -108,7 +108,6 @@ module.exports = React.createClass({
var step = this.context.traceManager.findStepOverForward(this.state.currentStepIndex)
this.refs.slider.setValue(step)
this.changeState(step)
},
stepOverBack: function () {

@ -26,12 +26,12 @@ module.exports = React.createClass({
var self = this
this.context.root.register('indexChanged', this, function (index) {
if (index < 0) return
if (window.ethDebuggerSelectedItem !== index) return
if (self.context.root.ethDebuggerSelectedItem !== index) return
self.context.traceManager.getStorageAt(index, self.context.tx, function (error, storage) {
if (error) {
console.log(error)
} else if (window.ethDebuggerSelectedItem === index) {
} else if (self.context.root.ethDebuggerSelectedItem === index) {
self.setState({
data: self.formatStorage(storage)
})

Loading…
Cancel
Save