File |
Mutation score |
# Killed |
# Survived |
# Timeout |
# No coverage |
# Errors |
Total detected |
Total undetected |
Total mutants |
|
---|---|---|---|---|---|---|---|---|---|---|
BinaryOperatorMutator.js |
|
11/13 | 11 | 2 | 0 | 0 | 0 | 11 | 2 | 13 |
"use strict";
var esprima_1 = require('esprima');
var BinaryOperatorMutator = (function () 0{
}{
function BinaryOperatorMutator() 1{
}{
this.name = 'BinaryOperator';
this.operators = {
'+': '-',
'-': '+',
'*': '/',
'/': '*',
'%': '*',
'<': ['<=', '>='],
'<=': ['<', '>'],
'>': ['>=', '<='],
'>=': ['>', '<'],
'==': '!=',
'!=': '==',
'===': '!==',
'!==': '==='
};
}
BinaryOperatorMutator.prototype.applyMutations = function (node, copy) 2{
}{
var nodes = [];
if (3false4true5node.type === esprima_1.Syntax.BinaryExpression || this.operators[node.operator]6node.type !== esprima_1.Syntax.BinaryExpressionnode.type === esprima_1.Syntax.BinaryExpression && this.operators[node.operator]) 7{
}{
var binaryNode_1 = node;
var mutatedOperators = this.operators[node.operator];
if (8false9true10typeof mutatedOperators !== 'string'typeof mutatedOperators === 'string') 11{
}{
mutatedOperators = [mutatedOperators];
}
mutatedOperators.forEach(function (operator) 12{
}{
var mutatedNode = copy(binaryNode_1);
mutatedNode.operator = operator;
nodes.push(mutatedNode);
});
}
return nodes;
};
return BinaryOperatorMutator;
}());
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = BinaryOperatorMutator;
//# sourceMappingURL=BinaryOperatorMutator.js.map