@ggflutter/sumo
Advanced tools
Comparing version 2.5.75003779 to 2.5.75003780
{ | ||
"author": "Luigi Allocca", | ||
"name": "@ggflutter/sumo", | ||
"version": "2.5.75003779", | ||
"version": "2.5.75003780", | ||
"description": "A mutation testing tool for Ethereum smart contracts", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -21,8 +21,9 @@ const Mutation = require('../../mutation'); | ||
visit({ | ||
BinaryOperation: (node) => { | ||
const processNode = (node) => { | ||
// Visita i nodi BinaryOperation | ||
if (node.type === 'BinaryOperation' && node.operator === '=' && node.right.type === 'FunctionCall') { | ||
const start = node.range[0]; | ||
const end = node.range[1] + 1; | ||
if (start >= functionStart && end <= functionEnd && node.operator === '=' && node.right.type === 'FunctionCall') { | ||
if (start >= functionStart && end <= functionEnd) { | ||
// Rimuovi l'assegnazione dall'originale | ||
@@ -37,4 +38,12 @@ const original = source.slice(start, end); | ||
} | ||
}); | ||
// Visita i corpi dei blocchi | ||
if (node.type === 'Block') { | ||
node.statements.forEach(processNode); | ||
} | ||
}; | ||
// Processa il corpo della funzione | ||
processNode(functionNode.body); | ||
// Se sono state fatte modifiche, crea una mutazione per l'intera funzione | ||
@@ -55,2 +64,2 @@ if (hasMutations) { | ||
module.exports = UROperator; | ||
module.exports = UROperator; |
370140
7253