Commit ecbfbf1b authored by yann300's avatar yann300

rename lastPropertyChange

parent da22990a
...@@ -45,7 +45,6 @@ module.exports = React.createClass({ ...@@ -45,7 +45,6 @@ module.exports = React.createClass({
}, },
componentWillReceiveProps: function (nextProps) { componentWillReceiveProps: function (nextProps) {
console.log('new prop asmCode')
if (nextProps.currentStepIndex < 0) return if (nextProps.currentStepIndex < 0) return
codeResolver.setWeb3(this.context.web3) codeResolver.setWeb3(this.context.web3)
var self = this var self = this
......
...@@ -145,7 +145,7 @@ module.exports = { ...@@ -145,7 +145,7 @@ module.exports = {
}, },
getStorageAt: function (stepIndex, callback) { getStorageAt: function (stepIndex, callback) {
var stoChange = this.lastPropertyChange(stepIndex, this.vmTraceChangesRef) var stoChange = this.findLowerBound(stepIndex, this.vmTraceChangesRef)
if (!stoChange) { if (!stoChange) {
return {} return {}
} }
...@@ -169,13 +169,13 @@ module.exports = { ...@@ -169,13 +169,13 @@ module.exports = {
}, },
getCallDataAt: function (stepIndex, callback) { getCallDataAt: function (stepIndex, callback) {
var callDataChange = this.lastPropertyChange(stepIndex, this.callDataChanges) var callDataChange = this.findLowerBound(stepIndex, this.callDataChanges)
if (!callDataChange) return [''] if (!callDataChange) return ['']
callback([this.trace[callDataChange].calldata]) callback([this.trace[callDataChange].calldata])
}, },
getCallStackAt: function (stepIndex, callback) { getCallStackAt: function (stepIndex, callback) {
var callStackChange = this.lastPropertyChange(stepIndex, this.depthChanges) var callStackChange = this.findLowerBound(stepIndex, this.depthChanges)
if (!callStackChange) return '' if (!callStackChange) return ''
callback(this.callStack[callStackChange].stack) callback(this.callStack[callStackChange].stack)
}, },
...@@ -190,7 +190,7 @@ module.exports = { ...@@ -190,7 +190,7 @@ module.exports = {
}, },
getLastDepthIndexChangeSince: function (stepIndex, callback) { getLastDepthIndexChangeSince: function (stepIndex, callback) {
var depthIndex = this.lastPropertyChange(stepIndex, this.depthChanges) var depthIndex = this.findLowerBound(stepIndex, this.depthChanges)
callback(depthIndex) callback(depthIndex)
}, },
...@@ -202,7 +202,7 @@ module.exports = { ...@@ -202,7 +202,7 @@ module.exports = {
}, },
getMemoryAt: function (stepIndex, callback) { getMemoryAt: function (stepIndex, callback) {
var lastChanges = this.lastPropertyChange(stepIndex, this.memoryChanges) var lastChanges = this.findLowerBound(stepIndex, this.memoryChanges)
if (!lastChanges) return '' if (!lastChanges) return ''
callback(this.trace[lastChanges].memory) callback(this.trace[lastChanges].memory)
}, },
...@@ -289,7 +289,7 @@ module.exports = { ...@@ -289,7 +289,7 @@ module.exports = {
}, },
// util section // util section
lastPropertyChange: function (target, changes) { findLowerBound: function (target, changes) {
if (changes.length === 1) { if (changes.length === 1) {
if (changes[0] > target) { if (changes[0] > target) {
// we only a closest maximum, returning 0 // we only a closest maximum, returning 0
...@@ -301,9 +301,9 @@ module.exports = { ...@@ -301,9 +301,9 @@ module.exports = {
var middle = Math.floor(changes.length / 2) var middle = Math.floor(changes.length / 2)
if (changes[middle] > target) { if (changes[middle] > target) {
return this.lastPropertyChange(target, changes.slice(0, middle)) return this.findLowerBound(target, changes.slice(0, middle))
} else if (changes[middle] < target) { } else if (changes[middle] < target) {
return this.lastPropertyChange(target, changes.slice(middle, changes.length)) return this.findLowerBound(target, changes.slice(middle, changes.length))
} else { } else {
return changes[middle] return changes[middle]
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment