Code coverage report for lib/point.js

Statements: 69.23% (36 / 52)      Branches: 62.5% (15 / 24)      Functions: 100% (12 / 12)      Lines: 69.23% (36 / 52)      Ignored: none     

All files » lib/ » point.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 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114  1   20       1 2397824 2397824   1 1   648501     648501     492276     492276     699     699     912622     912622     1     1     1043     1043     667     667     3     3     26                 26 26 104   26 26 26   26 26 26   26 26                                               26          
"use strict";
Object.defineProperties(exports, {
  Point: {get: function() {
      return Point;
    }},
  __esModule: {value: true}
});
var Point = function Point(x, y) {
  this.x = x;
  this.y = y;
};
var $Point = Point;
($traceurRuntime.createClass)(Point, {
  equal: function($__1) {
    var $__2 = $traceurRuntime.assertObject($__1),
        x = $__2.x,
        y = $__2.y;
    return this.x === x && this.y === y;
  },
  sum: function($__1) {
    var $__2 = $traceurRuntime.assertObject($__1),
        x = $__2.x,
        y = $__2.y;
    return new $Point(this.x + x, this.y + y);
  },
  difference: function($__1) {
    var $__2 = $traceurRuntime.assertObject($__1),
        x = $__2.x,
        y = $__2.y;
    return new $Point(this.x - x, this.y - y);
  },
  product: function($__1) {
    var $__2 = $traceurRuntime.assertObject($__1),
        x = $__2.x,
        y = $__2.y;
    return new $Point(this.x * x, this.y * y);
  },
  lt: function($__1) {
    var $__2 = $traceurRuntime.assertObject($__1),
        x = $__2.x,
        y = $__2.y;
    return this.x < x && this.y < y;
  },
  lte: function($__1) {
    var $__2 = $traceurRuntime.assertObject($__1),
        x = $__2.x,
        y = $__2.y;
    return this.x <= x && this.y <= y;
  },
  gt: function($__1) {
    var $__2 = $traceurRuntime.assertObject($__1),
        x = $__2.x,
        y = $__2.y;
    return this.x > x && this.y > y;
  },
  gte: function($__1) {
    var $__2 = $traceurRuntime.assertObject($__1),
        x = $__2.x,
        y = $__2.y;
    return this.x >= x && this.y >= y;
  },
  to: $traceurRuntime.initGeneratorFunction(function $__4(to) {
    var $__1,
        $__2,
        x0,
        x1,
        $__3,
        y0,
        y1,
        i,
        j;
    return $traceurRuntime.createGeneratorInstance(function($ctx) {
      while (true)
        switch ($ctx.state) {
          case 0:
            $__1 = [[Math.min(this.x, to.x), Math.max(this.x, to.x)], [Math.min(this.y, to.y), Math.max(this.y, to.y)]], $__2 = $traceurRuntime.assertObject($__1[0]), x0 = $__2[0], x1 = $__2[1], $__3 = $traceurRuntime.assertObject($__1[1]), y0 = $__3[0], y1 = $__3[1];
            $ctx.state = 12;
            break;
          case 12:
            i = y0;
            $ctx.state = 10;
            break;
          case 10:
            $ctx.state = (i < y1) ? 6 : -2;
            break;
          case 5:
            i++;
            $ctx.state = 10;
            break;
          case 6:
            j = x0;
            $ctx.state = 7;
            break;
          case 7:
            $ctx.state = (j < x1) ? 1 : 5;
            break;
          case 4:
            j++;
            $ctx.state = 7;
            break;
          case 1:
            $ctx.state = 2;
            return new $Point(j, i);
          case 2:
            $ctx.maybeThrow();
            $ctx.state = 4;
            break;
          default:
            return $ctx.end();
        }
    }, $__4, this);
  })
}, {});