diff --git a/libs/remix-debug/src/Ethdebugger.ts b/libs/remix-debug/src/Ethdebugger.ts index fc508a5bde..7f2ea7667a 100644 --- a/libs/remix-debug/src/Ethdebugger.ts +++ b/libs/remix-debug/src/Ethdebugger.ts @@ -107,8 +107,8 @@ export class Ethdebugger { try { const storageViewer = new StorageViewer({ stepIndex: step, tx: this.tx, address: address }, this.storageResolver, this.traceManager) const locals = await localDecoder.solidityLocals(step, this.callTree, stack, memory, storageViewer, sourceLocation, null) - if (locals.error) { - return callback(locals.error) + if (locals['error']) { + return callback(locals['error']) } return callback(null, locals) } catch (e) { diff --git a/libs/remix-debug/src/cmdline/index.ts b/libs/remix-debug/src/cmdline/index.ts index be25535f3c..c037df1524 100644 --- a/libs/remix-debug/src/cmdline/index.ts +++ b/libs/remix-debug/src/cmdline/index.ts @@ -27,8 +27,8 @@ export class CmdLine { loadCompilationData (inputJson, outputJson) { const data = {} - data.data = outputJson - data.source = { sources: inputJson.sources } + data['data'] = outputJson + data['source'] = { sources: inputJson.sources } this.loadCompilationResult(data) } diff --git a/libs/remix-debug/src/code/codeUtils.ts b/libs/remix-debug/src/code/codeUtils.ts index 0e446367b7..2b438f92b6 100644 --- a/libs/remix-debug/src/code/codeUtils.ts +++ b/libs/remix-debug/src/code/codeUtils.ts @@ -35,11 +35,11 @@ export function parseCode (raw) { const opcode = opcodes(raw[i], true) if (opcode.name.slice(0, 4) === 'PUSH') { const length = raw[i] - 0x5f - opcode.pushData = raw.slice(i + 1, i + length + 1) + opcode['pushData'] = raw.slice(i + 1, i + length + 1) // in case pushdata extends beyond code if (i + 1 + length > raw.length) { - for (let j = opcode.pushData.length; j < length; j++) { - opcode.pushData.push(0) + for (let j = opcode['pushData'].length; j < length; j++) { + opcode['pushData'].push(0) } } i += length diff --git a/libs/remix-debug/src/debugger/solidityLocals.ts b/libs/remix-debug/src/debugger/solidityLocals.ts index f07e21a465..64796a5f50 100644 --- a/libs/remix-debug/src/debugger/solidityLocals.ts +++ b/libs/remix-debug/src/debugger/solidityLocals.ts @@ -74,14 +74,14 @@ export class DebuggerSolidityLocals { var storageViewer = new StorageViewer({ stepIndex: this.stepManager.currentStepIndex, tx: this.tx, address: result[2].value }, this.storageResolver, this.traceManager) solidityLocals(this.stepManager.currentStepIndex, this.internalTreeCall, stack, memory, storageViewer, sourceLocation, cursor).then((locals) => { if (!cursor) { - if (!locals.error) { + if (!locals['error']) { this.event.trigger('solidityLocals', [locals]) } if (!Object.keys(locals).length) { this.event.trigger('solidityLocalsMessage', ['no locals']) } } else { - if (!locals.error) { + if (!locals['error']) { this.event.trigger('solidityLocalsLoadMoreCompleted', [locals]) } } diff --git a/libs/remix-debug/src/debugger/solidityState.ts b/libs/remix-debug/src/debugger/solidityState.ts index daa7469840..4a68fa4d02 100644 --- a/libs/remix-debug/src/debugger/solidityState.ts +++ b/libs/remix-debug/src/debugger/solidityState.ts @@ -77,8 +77,8 @@ export class DebuggerSolidityState { const storageViewer = new StorageViewer({ stepIndex: this.stepManager.currentStepIndex, tx: this.tx, address: address }, this.storageResolver, this.traceManager) decodeState(stateVars, storageViewer).then((result) => { this.event.trigger('solidityStateMessage', ['']) - if (result.error) { - return this.event.trigger('solidityStateMessage', [result.error]) + if (result['error']) { + return this.event.trigger('solidityStateMessage', [result['error']]) } this.event.trigger('solidityState', [result]) }) diff --git a/libs/remix-debug/src/solidity-decoder/types/StringType.ts b/libs/remix-debug/src/solidity-decoder/types/StringType.ts index 29340fd168..2c8f4cac60 100644 --- a/libs/remix-debug/src/solidity-decoder/types/StringType.ts +++ b/libs/remix-debug/src/solidity-decoder/types/StringType.ts @@ -43,9 +43,9 @@ function format (decoded) { value = value.replace('0x', '').replace(/(..)/g, '%$1') const ret = { length: decoded.length, raw: decoded.value, type: 'string' } try { - ret.value = decodeURIComponent(value) + ret['value'] = decodeURIComponent(value) } catch (e) { - ret.error = 'Invalid UTF8 encoding' + ret['error'] = 'Invalid UTF8 encoding' ret.raw = decoded.value } return ret diff --git a/libs/remix-debug/src/source/sourceLocationTracker.ts b/libs/remix-debug/src/source/sourceLocationTracker.ts index 78f09376f9..bc6efd1bf8 100644 --- a/libs/remix-debug/src/source/sourceLocationTracker.ts +++ b/libs/remix-debug/src/source/sourceLocationTracker.ts @@ -31,7 +31,7 @@ export class SourceLocationTracker { */ async getSourceLocationFromInstructionIndex (address, index, contracts) { const sourceMap = await this.extractSourceMap(this, this.codeManager, address, contracts) - return atIndex(index, sourceMap.map) + return atIndex(index, sourceMap['map']) } /** @@ -44,7 +44,7 @@ export class SourceLocationTracker { async getSourceLocationFromVMTraceIndex (address, vmtraceStepIndex, contracts) { const sourceMap = await this.extractSourceMap(this, this.codeManager, address, contracts) const index = this.codeManager.getInstructionIndex(address, vmtraceStepIndex) - return atIndex(index, sourceMap.map) + return atIndex(index, sourceMap['map']) } /** diff --git a/libs/remix-debug/src/source/sourceMappingDecoder.ts b/libs/remix-debug/src/source/sourceMappingDecoder.ts index e6df9bce3a..4a26a9f81b 100644 --- a/libs/remix-debug/src/source/sourceMappingDecoder.ts +++ b/libs/remix-debug/src/source/sourceMappingDecoder.ts @@ -183,19 +183,19 @@ export function atIndex (index, mapping) { continue } current = current.split(':') - if (ret.start === undefined && current[0] && current[0] !== '-1' && current[0].length) { - ret.start = parseInt(current[0]) + if (ret['start'] === undefined && current[0] && current[0] !== '-1' && current[0].length) { + ret['start'] = parseInt(current[0]) } - if (ret.length === undefined && current[1] && current[1] !== '-1' && current[1].length) { - ret.length = parseInt(current[1]) + if (ret['length'] === undefined && current[1] && current[1] !== '-1' && current[1].length) { + ret['length'] = parseInt(current[1]) } - if (ret.file === undefined && current[2] && current[2].length) { - ret.file = parseInt(current[2]) + if (ret['file'] === undefined && current[2] && current[2].length) { + ret['file'] = parseInt(current[2]) } - if (ret.jump === undefined && current[3] && current[3].length) { - ret.jump = current[3] + if (ret['jump'] === undefined && current[3] && current[3].length) { + ret['jump'] = current[3] } - if (ret.start !== undefined && ret.length !== undefined && ret.file !== undefined && ret.jump !== undefined) { + if (ret['start'] !== undefined && ret['length'] !== undefined && ret['file'] !== undefined && ret['jump'] !== undefined) { break } } diff --git a/libs/remix-debug/src/trace/traceManager.ts b/libs/remix-debug/src/trace/traceManager.ts index b3f1f567e7..c5fbbc3c3f 100644 --- a/libs/remix-debug/src/trace/traceManager.ts +++ b/libs/remix-debug/src/trace/traceManager.ts @@ -32,10 +32,10 @@ export class TraceManager { try { const result = await this.getTrace(tx.hash) - if (result.structLogs.length > 0) { - this.trace = result.structLogs + if (result['structLogs'].length > 0) { + this.trace = result['structLogs'] - this.traceAnalyser.analyse(result.structLogs, tx) + this.traceAnalyser.analyse(result['structLogs'], tx) this.isLoading = false return true }