Stop injecting statement coverage into conditionals

experimental-options
cgewecke 3 years ago
parent 58e039642d
commit ca1e23b2bb
  1. 6
      lib/parse.js

@ -33,16 +33,14 @@ parse.BinaryOperation = function(contract, expression, skipStatementRegistry) {
// Free-floating ternary conditional // Free-floating ternary conditional
if (expression.left && expression.left.type === 'Conditional'){ if (expression.left && expression.left.type === 'Conditional'){
parse[expression.left.type](contract, expression.left, true); parse[expression.left.type](contract, expression.left, true);
register.statement(contract, expression);
// Ternary conditional assignment // Ternary conditional assignment
} else if (expression.right && expression.right.type === 'Conditional'){ } else if (expression.right && expression.right.type === 'Conditional'){
parse[expression.right.type](contract, expression.right, true); parse[expression.right.type](contract, expression.right, true);
register.statement(contract, expression);
// Regular binary operation // Regular binary operation
} else if(!skipStatementRegistry){ } else if(!skipStatementRegistry){
register.statement(contract, expression); // noop
// LogicalOR condition search... // LogicalOR condition search...
} else { } else {
@ -91,7 +89,7 @@ parse.FunctionCall = function(contract, expression, skipStatementRegistry) {
parse.Conditional = function(contract, expression, skipStatementRegistry) { parse.Conditional = function(contract, expression, skipStatementRegistry) {
parse[expression.condition.type] && parse[expression.condition.type] &&
parse[expression.condition.type](contract, expression.condition, skipStatementRegistry); parse[expression.condition.type](contract, expression.condition, true);
register.conditional(contract, expression); register.conditional(contract, expression);
}; };

Loading…
Cancel
Save