Update codeManager.ts

pull/5623/head
maradini77 1 month ago committed by Aniket
parent 8df5225c95
commit 876b981aed
  1. 14
      libs/remix-debug/src/code/codeManager.ts

@ -134,25 +134,25 @@ export class CodeManager {
return findNodeAtInstructionIndex('FunctionDefinition', instIndex, sourceMap, ast) return findNodeAtInstructionIndex('FunctionDefinition', instIndex, sourceMap, ast)
} }
private retrieveCodeAndTrigger (codeMananger, address, stepIndex, tx) { private retrieveCodeAndTrigger (codeManager, address, stepIndex, tx) {
codeMananger.getCode(address).then((result) => { codeManager.getCode(address).then((result) => {
this.retrieveIndexAndTrigger(codeMananger, address, stepIndex, result.instructions) this.retrieveIndexAndTrigger(codeManager, address, stepIndex, result.instructions)
}).catch((error) => { }).catch((error) => {
return console.log(error) return console.log(error)
}) })
} }
private async retrieveIndexAndTrigger (codeMananger, address, step, code) { private async retrieveIndexAndTrigger (codeManager, address, step, code) {
let result let result
const next = [] const next = []
const returnInstructionIndexes = [] const returnInstructionIndexes = []
const outOfGasInstructionIndexes = [] const outOfGasInstructionIndexes = []
try { try {
result = codeMananger.getInstructionIndex(address, step) result = codeManager.getInstructionIndex(address, step)
for (let i = 1; i < 6; i++) { for (let i = 1; i < 6; i++) {
if (this.traceManager.inRange(step + i)) { if (this.traceManager.inRange(step + i)) {
next.push(codeMananger.getInstructionIndex(address, step + i)) next.push(codeManager.getInstructionIndex(address, step + i))
} }
} }
@ -177,7 +177,7 @@ export class CodeManager {
return console.log(error) return console.log(error)
} }
try { try {
codeMananger.event.trigger('changed', [code, address, result, next, returnInstructionIndexes, outOfGasInstructionIndexes]) codeManager.event.trigger('changed', [code, address, result, next, returnInstructionIndexes, outOfGasInstructionIndexes])
} catch (e) { } catch (e) {
console.log('dispatching event failed', e) console.log('dispatching event failed', e)
} }

Loading…
Cancel
Save