<commit_before>'use strict';

var _ = require('lodash');
var util = require('util');
import BaseMutation from './BaseMutation';
import Mutant from '../Mutant';
import ParserUtils from '../utils/ParserUtils';

abstract class BaseOperatorMutation extends BaseMutation {
  _operators;
  
  /**
   * Represents a base class for all operator based mutations.
   * @class
   * @param {String} name - The name of the mutation.
   * @param {String[]} types - The types of mutation as expected by the parser.
   * @param {Object} operators - The object containing all operators and their counterparts.
   */
  constructor(name: string, types: string[], operators) {
    super(name, types);
    this._typeUtils.expectParameterObject(operators, 'BaseOperatorMutation', 'operators');

    this._operators = operators;
  }

  applyMutation(filename: string, originalCode: string, node, ast) {
    super.applyMutation(filename, originalCode, node, ast);
    var originalOperator = node.operator;
    var mutants = [];
    node.operator = this.getOperator(node.operator);

    var parserUtils = new ParserUtils();
    var lineOfCode = parserUtils.generate(node);
    // Use native indexOf because the operator may be multiple characters.
    var columnNumber = (lineOfCode.indexOf(node.operator) + 1) + node.loc.start.column;
    mutants.push(new Mutant(filename, originalCode, this, ast, node, columnNumber));

    node.operator = originalOperator;

    return mutants;
  }

  canMutate(node) {
    super.canMutate(node);
    return !!(node && _.indexOf(this._types, node.type) >= 0 && this.getOperator(node.operator));
  }
<commit_msg>Fixed a call to the ParserUtils using the wrong parameters<commit_after>'use strict';

var _ = require('lodash');
var util = require('util');
import BaseMutation from './BaseMutation';
import Mutant from '../Mutant';
import ParserUtils from '../utils/ParserUtils';

abstract class BaseOperatorMutation extends BaseMutation {
  _operators;
  
  /**
   * Represents a base class for all operator based mutations.
   * @class
   * @param {String} name - The name of the mutation.
   * @param {String[]} types - The types of mutation as expected by the parser.
   * @param {Object} operators - The object containing all operators and their counterparts.
   */
  constructor(name: string, types: string[], operators) {
    super(name, types);
    this._typeUtils.expectParameterObject(operators, 'BaseOperatorMutation', 'operators');

    this._operators = operators;
  }

  applyMutation(filename: string, originalCode: string, node, ast) {
    super.applyMutation(filename, originalCode, node, ast);
    var originalOperator = node.operator;
    var mutants = [];
    node.operator = this.getOperator(node.operator);

    var parserUtils = new ParserUtils();
    var lineOfCode = parserUtils.generate(node, originalCode);
    // Use native indexOf because the operator may be multiple characters.
    var columnNumber = (lineOfCode.indexOf(node.operator) + 1) + node.loc.start.column;
    mutants.push(new Mutant(filename, originalCode, this, ast, node, columnNumber));

    node.operator = originalOperator;

    return mutants;
  }

  canMutate(node) {
    super.canMutate(node);
    return !!(node && _.indexOf(this._types, node.type) >= 0 && this.getOperator(node.operator));
  }

{'fraction_non_alphanumeric': 0.11777172267635483, 'fraction_numerical': 0.0012110202845897668, 'mean_word_length': 4.0289193302891935, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2122672', 'n_tokens_mistral': 953, 'n_tokens_neox': 924, 'n_words': 282}