diff --git a/apps/remix-ide/src/app/compiler/compiler-helpers.js b/apps/remix-ide/src/app/compiler/compiler-helpers.js index e8af5f465a..db7d5988f3 100644 --- a/apps/remix-ide/src/app/compiler/compiler-helpers.js +++ b/apps/remix-ide/src/app/compiler/compiler-helpers.js @@ -6,7 +6,7 @@ import CompilerAbstract from './compiler-abstract' export const compile = async (compilationTargets, settings, contentResolverCallback) => { const res = await (() => { return new Promise((resolve, reject) => { - const compiler = new Compiler(contentResolverCallback || (() => {})) + const compiler = new Compiler(contentResolverCallback) compiler.set('evmVersion', settings.evmVersion) compiler.set('optimize', settings.optimize) compiler.set('language', settings.language) diff --git a/apps/remix-ide/src/app/compiler/compiler-imports.js b/apps/remix-ide/src/app/compiler/compiler-imports.js index e13ef36570..1ae0fe740d 100644 --- a/apps/remix-ide/src/app/compiler/compiler-imports.js +++ b/apps/remix-ide/src/app/compiler/compiler-imports.js @@ -106,12 +106,8 @@ module.exports = class CompilerImports extends Plugin { } isExternalUrl (url) { - for (const handler of this.handlers()) { - if (handler.match.exec(url)) { - return true - } - } - return false + const handlers = this.handlers() + return handlers.some(handler => handler.match.exec(url)) } /** diff --git a/apps/remix-ide/src/app/tabs/debugger-tab.js b/apps/remix-ide/src/app/tabs/debugger-tab.js index 88fe682d84..b471ecb320 100644 --- a/apps/remix-ide/src/app/tabs/debugger-tab.js +++ b/apps/remix-ide/src/app/tabs/debugger-tab.js @@ -140,8 +140,8 @@ class DebuggerTab extends ViewPlugin { fetchContractAndCompile (address, receipt) { const target = (address && remixDebug.traceHelper.isContractCreation(address)) ? receipt.contractAddress : address - - return this.call('fetchAndCompile', 'resolve', target || receipt.contractAddress || receipt.to, 'browser/.debug', this.blockchain.web3()) + const targetAddress = target || receipt.contractAddress || receipt.to + return this.call('fetchAndCompile', 'resolve', targetAddress, 'browser/.debug', this.blockchain.web3()) } // debugger () { diff --git a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts index 69bc8af384..eadf59723d 100644 --- a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts +++ b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts @@ -357,9 +357,8 @@ function extractVariableDeclarations (ast, astWalker) { if (node.nodeType === 'VariableDeclaration' || node.nodeType === 'YulVariableDeclaration') { ret[node.src] = [node] } - if (node.initialValue && (node.nodeType === 'VariableDeclarationStatement' || node.nodeType === 'YulVariableDeclarationStatement')) { - ret[node.initialValue.src] = node.declarations - } + const hasChild = node.initialValue && (node.nodeType === 'VariableDeclarationStatement' || node.nodeType === 'YulVariableDeclarationStatement') + if (hasChild) ret[node.initialValue.src] = node.declarations }) return ret } diff --git a/libs/remix-debug/src/trace/traceHelper.ts b/libs/remix-debug/src/trace/traceHelper.ts index cd4fed9637..7de74cd999 100644 --- a/libs/remix-debug/src/trace/traceHelper.ts +++ b/libs/remix-debug/src/trace/traceHelper.ts @@ -15,7 +15,7 @@ export function resolveCalledAddress (vmTraceIndex, trace) { } export function isCallInstruction (step) { - return step.op === 'CALL' || step.op === 'STATICCALL' || step.op === 'CALLCODE' || step.op === 'CREATE' || step.op === 'DELEGATECALL' + return ['CALL', 'STATICCALL', 'CALLCODE', 'CREATE', 'DELEGATECALL'].includes(step.op) } export function isCreateInstruction (step) {