(.js)
laraImport("lara.mutation.Mutator");
(.lara)
import lara.mutation.Mutator;
new Mutator([name = "<unnamed mutator>"])
Base class that represents a code mutator.
This should not be instantiated directly, instead it should be extended.
addJp($joinpoint)
Adds a join point to this Mutator. Is only added if the Mutator can be applied over this join point, otherwise it will be ignored.
getCurrentMutation()
getMutationPoint()
getName()
getType()
This function is deprecated. use getName() instead
hasMutations()
mutate()
Introduces a single mutation to the code.
If the code has been mutated already, restores the code before mutating again.
If there are no mutations left, does nothing.
restore()
If the code has been mutated, restores the code to its original state. If not, does nothing.
setAutomaticRestore([value = true])
Enables/disables automatic restore. Is enabled by default.
If enabled, before each call to .mutate() will check if the code is already mutated, and call restore before the mutation is applied.