Code coverage report for lib/leaper.js

Statements: 100% (39 / 39)      Branches: 100% (14 / 14)      Functions: 100% (5 / 5)      Lines: 100% (39 / 39)      Ignored: none     

All files » lib/ » leaper.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70  1   1       1 1     1 8857   1 1 3694                 3694 30876 151908   3694 3694 3694   3694 3694 3694   10304 10304   7101 7101 7101   7101 7101 7101   34283 34283   27673 27673 27673   27673 27673   27182 27182 27182   3203       1 8857    
"use strict";
Object.defineProperties(exports, {
  Leaper: {get: function() {
      return Leaper;
    }},
  __esModule: {value: true}
});
var Point = require('./point').Point;
var $__1 = require('./mobility'),
    Mobility = $__1.Mobility,
    quadrants = $__1.quadrants;
var LeaperMobility = function LeaperMobility() {
  $traceurRuntime.defaultSuperCall(this, $LeaperMobility.prototype, arguments);
};
var $LeaperMobility = LeaperMobility;
($traceurRuntime.createClass)(LeaperMobility, {adjacentPoints: $traceurRuntime.initGeneratorFunction(function $__8(position, p0) {
    var $__7,
        m,
        n,
        $__5,
        $__6,
        o,
        $__3,
        $__4,
        p1;
    return $traceurRuntime.createGeneratorInstance(function($ctx) {
      while (true)
        switch ($ctx.state) {
          case 0:
            $__7 = this, m = $__7.m, n = $__7.n;
            $ctx.state = 14;
            break;
          case 14:
            $__5 = [new Point(m, n), new Point(n, m)][$traceurRuntime.toProperty(Symbol.iterator)]();
            $ctx.state = 7;
            break;
          case 7:
            $ctx.state = (!($__6 = $__5.next()).done) ? 9 : -2;
            break;
          case 9:
            o = $__6.value;
            $ctx.state = 10;
            break;
          case 10:
            $__3 = quadrants[$traceurRuntime.toProperty(Symbol.iterator)]();
            $ctx.state = 4;
            break;
          case 4:
            $ctx.state = (!($__4 = $__3.next()).done) ? 5 : 7;
            break;
          case 5:
            p1 = $__4.value;
            $ctx.state = 6;
            break;
          case 6:
            $ctx.state = 2;
            return p0.sum(p1.product(o));
          case 2:
            $ctx.maybeThrow();
            $ctx.state = 4;
            break;
          default:
            return $ctx.end();
        }
    }, $__8, this);
  })}, {}, Mobility);
function Leaper(m, n) {
  this.mobility.push(new LeaperMobility(m, n));
}