diff --git a/lib/instrumenter.js b/lib/instrumenter.js index 1d533af..0b72120 100644 --- a/lib/instrumenter.js +++ b/lib/instrumenter.js @@ -160,7 +160,6 @@ instrumenter.instrumentFunctionDeclaration = function instrumentFunctionDeclarat const startcol = expression.start - contract.instrumented.slice(0, expression.start).lastIndexOf('\n') - 1; const endlineDelta = contract.instrumented.slice(expression.start).indexOf('{'); const functionDefinition = contract.instrumented.slice(expression.start, expression.start + endlineDelta); - const lastChar = contract.instrumented.slice(expression.start, expression.start + endlineDelta + 1).slice(-1); const endline = startline + (functionDefinition.match(/\n/g) || []).length; const endcol = functionDefinition.length - functionDefinition.lastIndexOf('\n'); contract.fnMap[contract.fnId] = { @@ -175,15 +174,9 @@ instrumenter.instrumentFunctionDeclaration = function instrumentFunctionDeclarat }, }, }; - if (lastChar === '}') { - createOrAppendInjectionPoint(contract, expression.start + endlineDelta, { - type: 'callFunctionEvent', fnId: contract.fnId, - }); - } else { - createOrAppendInjectionPoint(contract, expression.start + endlineDelta + 1, { - type: 'callFunctionEvent', fnId: contract.fnId, - }); - } + createOrAppendInjectionPoint(contract, expression.start + endlineDelta + 1, { + type: 'callFunctionEvent', fnId: contract.fnId, + }); }; instrumenter.addNewBranch = function addNewBranch(contract, expression) {