stryker
Version:
The extendable JavaScript mutation testing framework
22 lines • 784 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
var esprima_1 = require("esprima");
/**
* Represents a mutator which can remove the content of a BlockStatement.
*/
var BlockStatementMutator = /** @class */ (function () {
function BlockStatementMutator() {
this.name = 'BlockStatement';
this.type = esprima_1.Syntax.BlockStatement;
}
BlockStatementMutator.prototype.applyMutations = function (node, copy) {
if (node.type === this.type && node.body.length > 0) {
var mutatedNode = copy(node);
mutatedNode.body = [];
return mutatedNode;
}
};
return BlockStatementMutator;
}());
exports.default = BlockStatementMutator;
//# sourceMappingURL=BlockStatementMutator.js.map
;