|
|
|
@ -55,8 +55,21 @@ parse.ContractOrLibraryStatement = function(contract, expression) { |
|
|
|
|
// We need to define a method to pass coverage hashes into at top of each contract.
|
|
|
|
|
// This lets us get a fresh stack for the hash and avoid stack-too-deep errors.
|
|
|
|
|
if (expression.kind !== 'interface'){ |
|
|
|
|
const start = expression.range[0]; |
|
|
|
|
const end = contract.instrumented.slice(expression.range[0]).indexOf('{') + 1; |
|
|
|
|
let start = 0; |
|
|
|
|
|
|
|
|
|
// It's possible a base contract will have constructor string arg
|
|
|
|
|
// which contains an open curly brace. Skip ahead pass the bases...
|
|
|
|
|
if (expression.baseContracts && expression.baseContracts.length){ |
|
|
|
|
for (let base of expression.baseContracts ){ |
|
|
|
|
if (base.range[1] > start){ |
|
|
|
|
start = base.range[1]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
start = expression.range[0]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const end = contract.instrumented.slice(start).indexOf('{') + 1; |
|
|
|
|
const loc = start + end;; |
|
|
|
|
|
|
|
|
|
(contract.injectionPoints[loc]) |
|
|
|
|