text: //Translated from executioner.rb using babyruby2js
  'use strict';
  
  var inherits = require('util').inherits;
  var main = require('../../main');
  // Executioner only preys on enemy groups in atari
  var Heuristic = require('./Heuristic');
  
  /** @class */
  function Executioner(player) {
      Heuristic.call(this, player);
  }
  inherits(Executioner, Heuristic);
  module.exports = Executioner;
  
  Executioner.prototype.evalMove = function (i, j) {
      var threat, saving;
      var stone = this.goban.stoneAt(i, j);
      threat = saving = 0;
      for (var g, g_array = stone.uniqueEnemies(this.color), g_ndx = 0; g=g_array[g_ndx], g_ndx < g_array.length; g_ndx++) {
          if (g.lives > 1) { // NB: more than 1 is a job for hunter
              continue;
          }
          threat += g.stones.length;
          for (var ally, ally_array = g.allEnemies(), ally_ndx = 0; ally=ally_array[ally_ndx], ally_ndx < ally_array.length; ally_ndx++) {
              if (ally.lives > 1) {
                  continue;
              }
              saving += ally.stones.length;
          }
      }
      if (threat === 0) {
          return 0;
      }
      if (main.debug) {
          main.log.debug('Executioner heuristic found a threat of ' + threat + ' at ' + i + ',' + j);
      }
      if (main.debug && saving > 0) {
          main.log.debug('...this would also save ' + saving);
      }
      return threat + saving;
  };
  
  