Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should work with radiusX and fallback to radius', ->
      # svg = document.createElementNS?(ns, "svg")
      tri = new Polygon
        # ctx:      svg
        radius:   20
        radiusX:  40
      tri._draw()
      d   = tri.el.getAttribute('d')
      d2  = 'M0.0000,-20.0000 L34.6410,10.0000 L-34.6410,10.0000 z'
      isD = d is d2
      isIE9D = d is 'M 0 -20 L 34.641 10 L -34.641 10 Z'
      expect(isD or isIE9D).toBe true

    it 'should work with radiusY and fallback to radius', ->
      # svg = document.createElementNS?(ns, "svg")
      tri = new Polygon
        # ctx:      svg
        radius:   20
        radiusY:  40

      tri._draw()

      d   = tri.el.getAttribute('d')
      d2  = 'M0.0000,-40.0000 L17.3205,20.0000 L-17.3205,20.0000 z'
      isD = d is d2
      isIE9D = d is 'M 0 -40 L 17.3205 20 L -17.3205 20 Z'
      expect(isD or isIE9D).toBe true
    it 'should call super method', ->
      polygon  = new Polygon
      spyOn(Polygon.prototype, '_draw')
      polygon._draw()
      expect(Polygon.prototype._draw).toHaveBeenCalled()

    it 'should not set `d` attribute if nothing changed', ->
      polygon = new Polygon
        radius: 20
        points: 10
      polygon._draw()
      spyOn polygon.el, 'setAttribute'
      polygon._draw()
      expect( polygon.el.setAttribute ).not.toHaveBeenCalled()
```

Response:
it('should work with radiusX and fallback to radius', function() {
  var d, d2, isD, isIE9D, tri;
  // svg = document.createElementNS?(ns, "svg")
  tri = new Polygon({
    // ctx:      svg
    radius: 20,
    radiusX: 40
  });
  tri._draw();
  d = tri.el.getAttribute('d');
  d2 = 'M0.0000,-20.0000 L34.6410,10.0000 L-34.6410,10.0000 z';
  isD = d === d2;
  isIE9D = d === 'M 0 -20 L 34.641 10 L -34.641 10 Z';
  return expect(isD || isIE9D).toBe(true);
});

it('should work with radiusY and fallback to radius', function() {
  var d, d2, isD, isIE9D, tri;
  // svg = document.createElementNS?(ns, "svg")
  tri = new Polygon({
    // ctx:      svg
    radius: 20,
    radiusY: 40
  });
  tri._draw();
  d = tri.el.getAttribute('d');
  d2 = 'M0.0000,-40.0000 L17.3205,20.0000 L-17.3205,20.0000 z';
  isD = d === d2;
  isIE9D = d === 'M 0 -40 L 17.3205 20 L -17.3205 20 Z';
  return expect(isD || isIE9D).toBe(true);
});

it('should call super method', function() {
  var polygon;
  polygon = new Polygon();
  spyOn(Polygon.prototype, '_draw');
  polygon._draw();
  return expect(Polygon.prototype._draw).toHaveBeenCalled();
});

it('should not set `d` attribute if nothing changed', function() {
  var polygon;
  polygon = new Polygon({
    radius: 20,
    points: 10
  });
  polygon._draw();
  spyOn(polygon.el, 'setAttribute');
  polygon._draw();
  return expect(polygon.el.setAttribute).not.toHaveBeenCalled();
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
it('should work with radiusX and fallback to radius', function() {
  var d, d2, isD, isIE9D, tri;
  // svg = document.createElementNS?(ns, "svg")
  tri = new Polygon({
    // ctx:      svg
    radius: 20,
    radiusX: 40
  });
  tri._draw();
  d = tri.el.getAttribute('d');
  d2 = 'M0.0000,-20.0000 L34.6410,10.0000 L-34.6410,10.0000 z';
  isD = d === d2;
  isIE9D = d === 'M 0 -20 L 34.641 10 L -34.641 10 Z';
  return expect(isD || isIE9D).toBe(true);
});

it('should work with radiusY and fallback to radius', function() {
  var d, d2, isD, isIE9D, tri;
  // svg = document.createElementNS?(ns, "svg")
  tri = new Polygon({
    // ctx:      svg
    radius: 20,
    radiusY: 40
  });
  tri._draw();
  d = tri.el.getAttribute('d');
  d2 = 'M0.0000,-40.0000 L17.3205,20.0000 L-17.3205,20.0000 z';
  isD = d === d2;
  isIE9D = d === 'M 0 -40 L 17.3205 20 L -17.3205 20 Z';
  return expect(isD || isIE9D).toBe(true);
});

it('should call super method', function() {
  var polygon;
  polygon = new Polygon();
  spyOn(Polygon.prototype, '_draw');
  polygon._draw();
  return expect(Polygon.prototype._draw).toHaveBeenCalled();
});

it('should not set `d` attribute if nothing changed', function() {
  var polygon;
  polygon = new Polygon({
    radius: 20,
    points: 10
  });
  polygon._draw();
  spyOn(polygon.el, 'setAttribute');
  polygon._draw();
  return expect(polygon.el.setAttribute).not.toHaveBeenCalled();
});
```

Response:
it 'should work with radiusX and fallback to radius', ->
      # svg = document.createElementNS?(ns, "svg")
      tri = new Polygon
        # ctx:      svg
        radius:   20
        radiusX:  40
      tri._draw()
      d   = tri.el.getAttribute('d')
      d2  = 'M0.0000,-20.0000 L34.6410,10.0000 L-34.6410,10.0000 z'
      isD = d is d2
      isIE9D = d is 'M 0 -20 L 34.641 10 L -34.641 10 Z'
      expect(isD or isIE9D).toBe true

    it 'should work with radiusY and fallback to radius', ->
      # svg = document.createElementNS?(ns, "svg")
      tri = new Polygon
        # ctx:      svg
        radius:   20
        radiusY:  40

      tri._draw()

      d   = tri.el.getAttribute('d')
      d2  = 'M0.0000,-40.0000 L17.3205,20.0000 L-17.3205,20.0000 z'
      isD = d is d2
      isIE9D = d is 'M 0 -40 L 17.3205 20 L -17.3205 20 Z'
      expect(isD or isIE9D).toBe true
    it 'should call super method', ->
      polygon  = new Polygon
      spyOn(Polygon.prototype, '_draw')
      polygon._draw()
      expect(Polygon.prototype._draw).toHaveBeenCalled()

    it 'should not set `d` attribute if nothing changed', ->
      polygon = new Polygon
        radius: 20
        points: 10
      polygon._draw()
      spyOn polygon.el, 'setAttribute'
      polygon._draw()
      expect( polygon.el.setAttribute ).not.toHaveBeenCalled()


Prompt:
it 'should work with radiusX and fallback to radius', ->
      # svg = document.createElementNS?(ns, "svg")
      tri = new Polygon
        # ctx:      svg
        radius:   20
        radiusX:  40
      tri._draw()
      d   = tri.el.getAttribute('d')
      d2  = 'M0.0000,-20.0000 L34.6410,10.0000 L-34.6410,10.0000 z'
      isD = d is d2
      isIE9D = d is 'M 0 -20 L 34.641 10 L -34.641 10 Z'
      expect(isD or isIE9D).toBe true

    it 'should work with radiusY and fallback to radius', ->
      # svg = document.createElementNS?(ns, "svg")
      tri = new Polygon
        # ctx:      svg
        radius:   20
        radiusY:  40

Response:
tri._draw()

      d   = tri.el.getAttribute('d')
      d2  = 'M0.0000,-40.0000 L17.3205,20.0000 L-17.3205,20.0000 z'
      isD = d is d2
      isIE9D = d is 'M 0 -40 L 17.3205 20 L -17.3205 20 Z'
      expect(isD or isIE9D).toBe true
    it 'should call super method', ->
      polygon  = new Polygon
      spyOn(Polygon.prototype, '_draw')
      polygon._draw()
      expect(Polygon.prototype._draw).toHaveBeenCalled()

    it 'should not set `d` attribute if nothing changed', ->
      polygon = new Polygon
        radius: 20
        points: 10
      polygon._draw()
      spyOn polygon.el, 'setAttribute'
      polygon._draw()
      expect( polygon.el.setAttribute ).not.toHaveBeenCalled()


Response:
it 'should set `d` attribute if `radiusX` changed', ->
      polygon = new Polygon
        radius: 20
        points: 10
      polygon._draw()
      spyOn polygon.el, 'setAttribute'
      polygon._props.radiusX = 30
      polygon._draw()
      expect( polygon.el.setAttribute ).toHaveBeenCalled()

    it 'should set `d` attribute if `radiusY` changed', ->
      polygon = new Polygon
        radius: 20
        points: 10
      polygon._draw()
      spyOn polygon.el, 'setAttribute'
      polygon._props.radiusY = 30
      polygon._draw()
      expect( polygon.el.setAttribute ).toHaveBeenCalled()

    it 'should set `d` attribute if `points` changed', ->
      polygon = new Polygon
        radius: 20
        points: 10
      polygon._draw()
      spyOn polygon.el, 'setAttribute'
      polygon._props.points = 30
      polygon._draw()
      expect( polygon.el.setAttribute ).toHaveBeenCalled()

  describe 'getLength method', ->
    it 'should calculate sum between all points', ->
      polygon  = new Polygon radiusX: 100, radiusY: 200
      polygon._draw()

      expect( polygon._getLength() )
        .toBe polygon._getPointsPerimiter( polygon._radialPoints )

  describe '_pointsDelta method ->', ->
    it 'should return distance between points', ->
      tri = new Polygon


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should set `d` attribute if `radiusX` changed', ->
      polygon = new Polygon
        radius: 20
        points: 10
      polygon._draw()
      spyOn polygon.el, 'setAttribute'
      polygon._props.radiusX = 30
      polygon._draw()
      expect( polygon.el.setAttribute ).toHaveBeenCalled()

    it 'should set `d` attribute if `radiusY` changed', ->
      polygon = new Polygon
        radius: 20
        points: 10
      polygon._draw()
      spyOn polygon.el, 'setAttribute'
      polygon._props.radiusY = 30
      polygon._draw()
      expect( polygon.el.setAttribute ).toHaveBeenCalled()

    it 'should set `d` attribute if `points` changed', ->
      polygon = new Polygon
        radius: 20
        points: 10
      polygon._draw()
      spyOn polygon.el, 'setAttribute'
      polygon._props.points = 30
      polygon._draw()
      expect( polygon.el.setAttribute ).toHaveBeenCalled()

  describe 'getLength method', ->
    it 'should calculate sum between all points', ->
      polygon  = new Polygon radiusX: 100, radiusY: 200
      polygon._draw()

      expect( polygon._getLength() )
        .toBe polygon._getPointsPerimiter( polygon._radialPoints )

  describe '_pointsDelta method ->', ->
    it 'should return distance between points', ->
      tri = new Polygon
```

Response:
it('should set `d` attribute if `radiusX` changed', function() {
  var polygon;
  polygon = new Polygon({
    radius: 20,
    points: 10
  });
  polygon._draw();
  spyOn(polygon.el, 'setAttribute');
  polygon._props.radiusX = 30;
  polygon._draw();
  return expect(polygon.el.setAttribute).toHaveBeenCalled();
});

it('should set `d` attribute if `radiusY` changed', function() {
  var polygon;
  polygon = new Polygon({
    radius: 20,
    points: 10
  });
  polygon._draw();
  spyOn(polygon.el, 'setAttribute');
  polygon._props.radiusY = 30;
  polygon._draw();
  return expect(polygon.el.setAttribute).toHaveBeenCalled();
});

it('should set `d` attribute if `points` changed', function() {
  var polygon;
  polygon = new Polygon({
    radius: 20,
    points: 10
  });
  polygon._draw();
  spyOn(polygon.el, 'setAttribute');
  polygon._props.points = 30;
  polygon._draw();
  return expect(polygon.el.setAttribute).toHaveBeenCalled();
});

describe('getLength method', function() {
  return it('should calculate sum between all points', function() {
    var polygon;
    polygon = new Polygon({
      radiusX: 100,
      radiusY: 200
    });
    polygon._draw();
    return expect(polygon._getLength()).toBe(polygon._getPointsPerimiter(polygon._radialPoints));
  });
});

describe('_pointsDelta method ->', function() {
  return it('should return distance between points', function() {
    var tri;
    return tri = new Polygon();
  });
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
it('should set `d` attribute if `radiusX` changed', function() {
  var polygon;
  polygon = new Polygon({
    radius: 20,
    points: 10
  });
  polygon._draw();
  spyOn(polygon.el, 'setAttribute');
  polygon._props.radiusX = 30;
  polygon._draw();
  return expect(polygon.el.setAttribute).toHaveBeenCalled();
});

it('should set `d` attribute if `radiusY` changed', function() {
  var polygon;
  polygon = new Polygon({
    radius: 20,
    points: 10
  });
  polygon._draw();
  spyOn(polygon.el, 'setAttribute');
  polygon._props.radiusY = 30;
  polygon._draw();
  return expect(polygon.el.setAttribute).toHaveBeenCalled();
});

it('should set `d` attribute if `points` changed', function() {
  var polygon;
  polygon = new Polygon({
    radius: 20,
    points: 10
  });
  polygon._draw();
  spyOn(polygon.el, 'setAttribute');
  polygon._props.points = 30;
  polygon._draw();
  return expect(polygon.el.setAttribute).toHaveBeenCalled();
});

describe('getLength method', function() {
  return it('should calculate sum between all points', function() {
    var polygon;
    polygon = new Polygon({
      radiusX: 100,
      radiusY: 200
    });
    polygon._draw();
    return expect(polygon._getLength()).toBe(polygon._getPointsPerimiter(polygon._radialPoints));
  });
});

describe('_pointsDelta method ->', function() {
  return it('should return distance between points', function() {
    var tri;
    return tri = new Polygon();
  });
});
```

Response:
it 'should set `d` attribute if `radiusX` changed', ->
      polygon = new Polygon
        radius: 20
        points: 10
      polygon._draw()
      spyOn polygon.el, 'setAttribute'
      polygon._props.radiusX = 30
      polygon._draw()
      expect( polygon.el.setAttribute ).toHaveBeenCalled()

    it 'should set `d` attribute if `radiusY` changed', ->
      polygon = new Polygon
        radius: 20
        points: 10
      polygon._draw()
      spyOn polygon.el, 'setAttribute'
      polygon._props.radiusY = 30
      polygon._draw()
      expect( polygon.el.setAttribute ).toHaveBeenCalled()

    it 'should set `d` attribute if `points` changed', ->
      polygon = new Polygon
        radius: 20
        points: 10
      polygon._draw()
      spyOn polygon.el, 'setAttribute'
      polygon._props.points = 30
      polygon._draw()
      expect( polygon.el.setAttribute ).toHaveBeenCalled()

  describe 'getLength method', ->
    it 'should calculate sum between all points', ->
      polygon  = new Polygon radiusX: 100, radiusY: 200
      polygon._draw()

      expect( polygon._getLength() )
        .toBe polygon._getPointsPerimiter( polygon._radialPoints )

  describe '_pointsDelta method ->', ->
    it 'should return distance between points', ->
      tri = new Polygon


Prompt:
it 'should set `d` attribute if `radiusX` changed', ->
      polygon = new Polygon
        radius: 20
        points: 10
      polygon._draw()
      spyOn polygon.el, 'setAttribute'
      polygon._props.radiusX = 30
      polygon._draw()
      expect( polygon.el.setAttribute ).toHaveBeenCalled()

    it 'should set `d` attribute if `radiusY` changed', ->
      polygon = new Polygon
        radius: 20
        points: 10
      polygon._draw()
      spyOn polygon.el, 'setAttribute'
      polygon._props.radiusY = 30
      polygon._draw()
      expect( polygon.el.setAttribute ).toHaveBeenCalled()

Response:
it 'should set `d` attribute if `points` changed', ->
      polygon = new Polygon
        radius: 20
        points: 10
      polygon._draw()
      spyOn polygon.el, 'setAttribute'
      polygon._props.points = 30
      polygon._draw()
      expect( polygon.el.setAttribute ).toHaveBeenCalled()

  describe 'getLength method', ->
    it 'should calculate sum between all points', ->
      polygon  = new Polygon radiusX: 100, radiusY: 200
      polygon._draw()

      expect( polygon._getLength() )
        .toBe polygon._getPointsPerimiter( polygon._radialPoints )

  describe '_pointsDelta method ->', ->
    it 'should return distance between points', ->
      tri = new Polygon


Response:
for i in [ 0...50 ]
        point1 = { x: 20*i, y: 120+i }
        point2 = { x: 200+i, y: -120*i }
        dx = Math.abs( point1.x - point2.x )
        dy = Math.abs( point1.y - point2.y )
        expect( tri._pointsDelta( point1, point2 ) )
          .toBe Math.sqrt( dx*dx + dy*dy )

  describe '_getPointsPerimiter method', ->
    it 'should calculate sum between all points', ->
      tri  = new Polygon
      # create points for test
      points = []
      for i in [1...20]
        points.push( {  x: 100*Math.random(), y: 100*Math.random() }  )

      sum = 0
      for i in [1...points.length]
        sum += tri._pointsDelta points[i-1], points[i]

      sum += tri._pointsDelta points[0], mojs.h.getLastItem points

      expect( tri._getPointsPerimiter( points ) ).toBe sum


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
for i in [ 0...50 ]
        point1 = { x: 20*i, y: 120+i }
        point2 = { x: 200+i, y: -120*i }
        dx = Math.abs( point1.x - point2.x )
        dy = Math.abs( point1.y - point2.y )
        expect( tri._pointsDelta( point1, point2 ) )
          .toBe Math.sqrt( dx*dx + dy*dy )

  describe '_getPointsPerimiter method', ->
    it 'should calculate sum between all points', ->
      tri  = new Polygon
      # create points for test
      points = []
      for i in [1...20]
        points.push( {  x: 100*Math.random(), y: 100*Math.random() }  )

      sum = 0
      for i in [1...points.length]
        sum += tri._pointsDelta points[i-1], points[i]

      sum += tri._pointsDelta points[0], mojs.h.getLastItem points

      expect( tri._getPointsPerimiter( points ) ).toBe sum
```

Response:
var dx, dy, i, j, point1, point2;

for (i = j = 0; j < 50; i = ++j) {
  point1 = {
    x: 20 * i,
    y: 120 + i
  };
  point2 = {
    x: 200 + i,
    y: -120 * i
  };
  dx = Math.abs(point1.x - point2.x);
  dy = Math.abs(point1.y - point2.y);
  expect(tri._pointsDelta(point1, point2)).toBe(Math.sqrt(dx * dx + dy * dy));
}

describe('_getPointsPerimiter method', function() {
  return it('should calculate sum between all points', function() {
    var k, l, points, ref, sum, tri;
    tri = new Polygon();
    // create points for test
    points = [];
    for (i = k = 1; k < 20; i = ++k) {
      points.push({
        x: 100 * Math.random(),
        y: 100 * Math.random()
      });
    }
    sum = 0;
    for (i = l = 1, ref = points.length; (1 <= ref ? l < ref : l > ref); i = 1 <= ref ? ++l : --l) {
      sum += tri._pointsDelta(points[i - 1], points[i]);
    }
    sum += tri._pointsDelta(points[0], mojs.h.getLastItem(points));
    return expect(tri._getPointsPerimiter(points)).toBe(sum);
  });
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var dx, dy, i, j, point1, point2;

for (i = j = 0; j < 50; i = ++j) {
  point1 = {
    x: 20 * i,
    y: 120 + i
  };
  point2 = {
    x: 200 + i,
    y: -120 * i
  };
  dx = Math.abs(point1.x - point2.x);
  dy = Math.abs(point1.y - point2.y);
  expect(tri._pointsDelta(point1, point2)).toBe(Math.sqrt(dx * dx + dy * dy));
}

describe('_getPointsPerimiter method', function() {
  return it('should calculate sum between all points', function() {
    var k, l, points, ref, sum, tri;
    tri = new Polygon();
    // create points for test
    points = [];
    for (i = k = 1; k < 20; i = ++k) {
      points.push({
        x: 100 * Math.random(),
        y: 100 * Math.random()
      });
    }
    sum = 0;
    for (i = l = 1, ref = points.length; (1 <= ref ? l < ref : l > ref); i = 1 <= ref ? ++l : --l) {
      sum += tri._pointsDelta(points[i - 1], points[i]);
    }
    sum += tri._pointsDelta(points[0], mojs.h.getLastItem(points));
    return expect(tri._getPointsPerimiter(points)).toBe(sum);
  });
});
```

Response:
for i in [ 0...50 ]
        point1 = { x: 20*i, y: 120+i }
        point2 = { x: 200+i, y: -120*i }
        dx = Math.abs( point1.x - point2.x )
        dy = Math.abs( point1.y - point2.y )
        expect( tri._pointsDelta( point1, point2 ) )
          .toBe Math.sqrt( dx*dx + dy*dy )

  describe '_getPointsPerimiter method', ->
    it 'should calculate sum between all points', ->
      tri  = new Polygon
      # create points for test
      points = []
      for i in [1...20]
        points.push( {  x: 100*Math.random(), y: 100*Math.random() }  )

      sum = 0
      for i in [1...points.length]
        sum += tri._pointsDelta points[i-1], points[i]

      sum += tri._pointsDelta points[0], mojs.h.getLastItem points

      expect( tri._getPointsPerimiter( points ) ).toBe sum


Prompt:
for i in [ 0...50 ]
        point1 = { x: 20*i, y: 120+i }
        point2 = { x: 200+i, y: -120*i }
        dx = Math.abs( point1.x - point2.x )
        dy = Math.abs( point1.y - point2.y )
        expect( tri._pointsDelta( point1, point2 ) )
          .toBe Math.sqrt( dx*dx + dy*dy )

  describe '_getPointsPerimiter method', ->
    it 'should calculate sum between all points', ->
      tri  = new Polygon

Response:
# create points for test
      points = []
      for i in [1...20]
        points.push( {  x: 100*Math.random(), y: 100*Math.random() }  )

      sum = 0
      for i in [1...points.length]
        sum += tri._pointsDelta points[i-1], points[i]

      sum += tri._pointsDelta points[0], mojs.h.getLastItem points

      expect( tri._getPointsPerimiter( points ) ).toBe sum


Response:
it 'should work with radiusX and fallback to radius', ->
      # svg = document.createElementNS?(ns, "svg")
      tri = new Polygon
        # ctx:      svg
        radius:   20
        radiusX:  40
      tri._draw()
      d   = tri.el.getAttribute('d')
      d2  = 'M0.0000,-20.0000 L34.6410,10.0000 L-34.6410,10.0000 z'
      isD = d is d2
      isIE9D = d is 'M 0 -20 L 34.641 10 L -34.641 10 Z'
      expect(isD or isIE9D).toBe true

    it 'should work with radiusY and fallback to radius', ->
      # svg = document.createElementNS?(ns, "svg")
      tri = new Polygon
        # ctx:      svg
        radius:   20
        radiusY:  40

      tri._draw()

      d   = tri.el.getAttribute('d')
      d2  = 'M0.0000,-40.0000 L17.3205,20.0000 L-17.3205,20.0000 z'
      isD = d is d2
      isIE9D = d is 'M 0 -40 L 17.3205 20 L -17.3205 20 Z'
      expect(isD or isIE9D).toBe true
    it 'should call super method', ->
      polygon  = new Polygon
      spyOn(Polygon.__super__, '_draw')
      polygon._draw()
      expect(Polygon.__super__._draw).toHaveBeenCalled()

    it 'should not set `d` attribute if nothing changed', ->
      polygon = new Polygon
        radius: 20
        points: 10
      polygon._draw()
      spyOn polygon.el, 'setAttribute'
      polygon._draw()
      expect( polygon.el.setAttribute ).not.toHaveBeenCalled()


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should work with radiusX and fallback to radius', ->
      # svg = document.createElementNS?(ns, "svg")
      tri = new Polygon
        # ctx:      svg
        radius:   20
        radiusX:  40
      tri._draw()
      d   = tri.el.getAttribute('d')
      d2  = 'M0.0000,-20.0000 L34.6410,10.0000 L-34.6410,10.0000 z'
      isD = d is d2
      isIE9D = d is 'M 0 -20 L 34.641 10 L -34.641 10 Z'
      expect(isD or isIE9D).toBe true

    it 'should work with radiusY and fallback to radius', ->
      # svg = document.createElementNS?(ns, "svg")
      tri = new Polygon
        # ctx:      svg
        radius:   20
        radiusY:  40

      tri._draw()

      d   = tri.el.getAttribute('d')
      d2  = 'M0.0000,-40.0000 L17.3205,20.0000 L-17.3205,20.0000 z'
      isD = d is d2
      isIE9D = d is 'M 0 -40 L 17.3205 20 L -17.3205 20 Z'
      expect(isD or isIE9D).toBe true
    it 'should call super method', ->
      polygon  = new Polygon
      spyOn(Polygon.__super__, '_draw')
      polygon._draw()
      expect(Polygon.__super__._draw).toHaveBeenCalled()

    it 'should not set `d` attribute if nothing changed', ->
      polygon = new Polygon
        radius: 20
        points: 10
      polygon._draw()
      spyOn polygon.el, 'setAttribute'
      polygon._draw()
      expect( polygon.el.setAttribute ).not.toHaveBeenCalled()
```

Response:
it('should work with radiusX and fallback to radius', function() {
  var d, d2, isD, isIE9D, tri;
  // svg = document.createElementNS?(ns, "svg")
  tri = new Polygon({
    // ctx:      svg
    radius: 20,
    radiusX: 40
  });
  tri._draw();
  d = tri.el.getAttribute('d');
  d2 = 'M0.0000,-20.0000 L34.6410,10.0000 L-34.6410,10.0000 z';
  isD = d === d2;
  isIE9D = d === 'M 0 -20 L 34.641 10 L -34.641 10 Z';
  return expect(isD || isIE9D).toBe(true);
});

it('should work with radiusY and fallback to radius', function() {
  var d, d2, isD, isIE9D, tri;
  // svg = document.createElementNS?(ns, "svg")
  tri = new Polygon({
    // ctx:      svg
    radius: 20,
    radiusY: 40
  });
  tri._draw();
  d = tri.el.getAttribute('d');
  d2 = 'M0.0000,-40.0000 L17.3205,20.0000 L-17.3205,20.0000 z';
  isD = d === d2;
  isIE9D = d === 'M 0 -40 L 17.3205 20 L -17.3205 20 Z';
  return expect(isD || isIE9D).toBe(true);
});

it('should call super method', function() {
  var polygon;
  polygon = new Polygon();
  spyOn(Polygon.__super__, '_draw');
  polygon._draw();
  return expect(Polygon.__super__._draw).toHaveBeenCalled();
});

it('should not set `d` attribute if nothing changed', function() {
  var polygon;
  polygon = new Polygon({
    radius: 20,
    points: 10
  });
  polygon._draw();
  spyOn(polygon.el, 'setAttribute');
  polygon._draw();
  return expect(polygon.el.setAttribute).not.toHaveBeenCalled();
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
it('should work with radiusX and fallback to radius', function() {
  var d, d2, isD, isIE9D, tri;
  // svg = document.createElementNS?(ns, "svg")
  tri = new Polygon({
    // ctx:      svg
    radius: 20,
    radiusX: 40
  });
  tri._draw();
  d = tri.el.getAttribute('d');
  d2 = 'M0.0000,-20.0000 L34.6410,10.0000 L-34.6410,10.0000 z';
  isD = d === d2;
  isIE9D = d === 'M 0 -20 L 34.641 10 L -34.641 10 Z';
  return expect(isD || isIE9D).toBe(true);
});

it('should work with radiusY and fallback to radius', function() {
  var d, d2, isD, isIE9D, tri;
  // svg = document.createElementNS?(ns, "svg")
  tri = new Polygon({
    // ctx:      svg
    radius: 20,
    radiusY: 40
  });
  tri._draw();
  d = tri.el.getAttribute('d');
  d2 = 'M0.0000,-40.0000 L17.3205,20.0000 L-17.3205,20.0000 z';
  isD = d === d2;
  isIE9D = d === 'M 0 -40 L 17.3205 20 L -17.3205 20 Z';
  return expect(isD || isIE9D).toBe(true);
});

it('should call super method', function() {
  var polygon;
  polygon = new Polygon();
  spyOn(Polygon.__super__, '_draw');
  polygon._draw();
  return expect(Polygon.__super__._draw).toHaveBeenCalled();
});

it('should not set `d` attribute if nothing changed', function() {
  var polygon;
  polygon = new Polygon({
    radius: 20,
    points: 10
  });
  polygon._draw();
  spyOn(polygon.el, 'setAttribute');
  polygon._draw();
  return expect(polygon.el.setAttribute).not.toHaveBeenCalled();
});
```

Response:
it 'should work with radiusX and fallback to radius', ->
      # svg = document.createElementNS?(ns, "svg")
      tri = new Polygon
        # ctx:      svg
        radius:   20
        radiusX:  40
      tri._draw()
      d   = tri.el.getAttribute('d')
      d2  = 'M0.0000,-20.0000 L34.6410,10.0000 L-34.6410,10.0000 z'
      isD = d is d2
      isIE9D = d is 'M 0 -20 L 34.641 10 L -34.641 10 Z'
      expect(isD or isIE9D).toBe true

    it 'should work with radiusY and fallback to radius', ->
      # svg = document.createElementNS?(ns, "svg")
      tri = new Polygon
        # ctx:      svg
        radius:   20
        radiusY:  40

      tri._draw()

      d   = tri.el.getAttribute('d')
      d2  = 'M0.0000,-40.0000 L17.3205,20.0000 L-17.3205,20.0000 z'
      isD = d is d2
      isIE9D = d is 'M 0 -40 L 17.3205 20 L -17.3205 20 Z'
      expect(isD or isIE9D).toBe true
    it 'should call super method', ->
      polygon  = new Polygon
      spyOn(Polygon.__super__, '_draw')
      polygon._draw()
      expect(Polygon.__super__._draw).toHaveBeenCalled()

    it 'should not set `d` attribute if nothing changed', ->
      polygon = new Polygon
        radius: 20
        points: 10
      polygon._draw()
      spyOn polygon.el, 'setAttribute'
      polygon._draw()
      expect( polygon.el.setAttribute ).not.toHaveBeenCalled()


Prompt:
it 'should work with radiusX and fallback to radius', ->
      # svg = document.createElementNS?(ns, "svg")
      tri = new Polygon
        # ctx:      svg
        radius:   20
        radiusX:  40
      tri._draw()
      d   = tri.el.getAttribute('d')
      d2  = 'M0.0000,-20.0000 L34.6410,10.0000 L-34.6410,10.0000 z'
      isD = d is d2
      isIE9D = d is 'M 0 -20 L 34.641 10 L -34.641 10 Z'
      expect(isD or isIE9D).toBe true

    it 'should work with radiusY and fallback to radius', ->
      # svg = document.createElementNS?(ns, "svg")
      tri = new Polygon
        # ctx:      svg
        radius:   20
        radiusY:  40

Response:
tri._draw()

      d   = tri.el.getAttribute('d')
      d2  = 'M0.0000,-40.0000 L17.3205,20.0000 L-17.3205,20.0000 z'
      isD = d is d2
      isIE9D = d is 'M 0 -40 L 17.3205 20 L -17.3205 20 Z'
      expect(isD or isIE9D).toBe true
    it 'should call super method', ->
      polygon  = new Polygon
      spyOn(Polygon.__super__, '_draw')
      polygon._draw()
      expect(Polygon.__super__._draw).toHaveBeenCalled()

    it 'should not set `d` attribute if nothing changed', ->
      polygon = new Polygon
        radius: 20
        points: 10
      polygon._draw()
      spyOn polygon.el, 'setAttribute'
      polygon._draw()
      expect( polygon.el.setAttribute ).not.toHaveBeenCalled()


Response:
Zigzag = mojs.shapesMap.getShape('zigzag')
Bit    = mojs.shapesMap.getShape('bit')
ns     = 'http://www.w3.org/2000/svg'
svg    = document.createElementNS?(ns, 'svg')
document.body.appendChild svg

describe 'Zigzag ->', ->
  it 'should extend Bit', ->
    line = new Zigzag ctx: svg
    expect(line instanceof Bit).toBe(true)
  it 'should add itself to context', ->
    line = new Zigzag ctx: svg
    expect(svg.firstChild).toBeDefined()
  describe '_declareDefaults method ->', ->
    it 'should call super', ->
      zigzag = new Zigzag
      spyOn Bit::, '_declareDefaults'
      zigzag._declareDefaults()
      expect(Bit::_declareDefaults).toHaveBeenCalled()
    it 'should set `shape` to `path`', ->
      zigzag = new Zigzag
      expect(zigzag._defaults.tag).toBe 'path'
    it 'should set `points` to `3`', ->
      zigzag = new Zigzag
      expect(zigzag._defaults.points).toBe 3
  describe 'methods ->', ->
    describe '_draw method ->', ->
      it 'should add properties to el', ->
        zigzag = new Zigzag
          # ctx:    document.createElementNS?(ns, "svg")
          radius: 20
      it 'should define points', ->
        zigzag = new Zigzag
          # ctx:    document.createElementNS?(ns, "svg")
          radius: 20
        zigzag._draw()
        expect(zigzag.el.getAttribute('d')).toBeTruthy()
      it 'should not work with 0 points', ->
        zigzag = new Zigzag
          # ctx:    document.createElementNS?(ns, "svg")
          radius: 20
          points: 0
        expect(zigzag.el.getAttribute('d')).toBeFalsy()
      it 'should calculate path length', ->
        zigzag = new Zigzag
          # ctx:    document.createElementNS?(ns, "svg")
          radius: 20
          points: 10
        zigzag._draw()
        expect(zigzag._length).toBeCloseTo 184.390, 2


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
Zigzag = mojs.shapesMap.getShape('zigzag')
Bit    = mojs.shapesMap.getShape('bit')
ns     = 'http://www.w3.org/2000/svg'
svg    = document.createElementNS?(ns, 'svg')
document.body.appendChild svg

describe 'Zigzag ->', ->
  it 'should extend Bit', ->
    line = new Zigzag ctx: svg
    expect(line instanceof Bit).toBe(true)
  it 'should add itself to context', ->
    line = new Zigzag ctx: svg
    expect(svg.firstChild).toBeDefined()
  describe '_declareDefaults method ->', ->
    it 'should call super', ->
      zigzag = new Zigzag
      spyOn Bit::, '_declareDefaults'
      zigzag._declareDefaults()
      expect(Bit::_declareDefaults).toHaveBeenCalled()
    it 'should set `shape` to `path`', ->
      zigzag = new Zigzag
      expect(zigzag._defaults.tag).toBe 'path'
    it 'should set `points` to `3`', ->
      zigzag = new Zigzag
      expect(zigzag._defaults.points).toBe 3
  describe 'methods ->', ->
    describe '_draw method ->', ->
      it 'should add properties to el', ->
        zigzag = new Zigzag
          # ctx:    document.createElementNS?(ns, "svg")
          radius: 20
      it 'should define points', ->
        zigzag = new Zigzag
          # ctx:    document.createElementNS?(ns, "svg")
          radius: 20
        zigzag._draw()
        expect(zigzag.el.getAttribute('d')).toBeTruthy()
      it 'should not work with 0 points', ->
        zigzag = new Zigzag
          # ctx:    document.createElementNS?(ns, "svg")
          radius: 20
          points: 0
        expect(zigzag.el.getAttribute('d')).toBeFalsy()
      it 'should calculate path length', ->
        zigzag = new Zigzag
          # ctx:    document.createElementNS?(ns, "svg")
          radius: 20
          points: 10
        zigzag._draw()
        expect(zigzag._length).toBeCloseTo 184.390, 2
```

Response:
var Bit, Zigzag, ns, svg;

Zigzag = mojs.shapesMap.getShape('zigzag');

Bit = mojs.shapesMap.getShape('bit');

ns = 'http://www.w3.org/2000/svg';

svg = typeof document.createElementNS === "function" ? document.createElementNS(ns, 'svg') : void 0;

document.body.appendChild(svg);

describe('Zigzag ->', function() {
  it('should extend Bit', function() {
    var line;
    line = new Zigzag({
      ctx: svg
    });
    return expect(line instanceof Bit).toBe(true);
  });
  it('should add itself to context', function() {
    var line;
    line = new Zigzag({
      ctx: svg
    });
    return expect(svg.firstChild).toBeDefined();
  });
  describe('_declareDefaults method ->', function() {
    it('should call super', function() {
      var zigzag;
      zigzag = new Zigzag();
      spyOn(Bit.prototype, '_declareDefaults');
      zigzag._declareDefaults();
      return expect(Bit.prototype._declareDefaults).toHaveBeenCalled();
    });
    it('should set `shape` to `path`', function() {
      var zigzag;
      zigzag = new Zigzag();
      return expect(zigzag._defaults.tag).toBe('path');
    });
    return it('should set `points` to `3`', function() {
      var zigzag;
      zigzag = new Zigzag();
      return expect(zigzag._defaults.points).toBe(3);
    });
  });
  return describe('methods ->', function() {
    return describe('_draw method ->', function() {
      it('should add properties to el', function() {
        var zigzag;
        return zigzag = new Zigzag({
          // ctx:    document.createElementNS?(ns, "svg")
          radius: 20
        });
      });
      it('should define points', function() {
        var zigzag;
        zigzag = new Zigzag({
          // ctx:    document.createElementNS?(ns, "svg")
          radius: 20
        });
        zigzag._draw();
        return expect(zigzag.el.getAttribute('d')).toBeTruthy();
      });
      it('should not work with 0 points', function() {
        var zigzag;
        zigzag = new Zigzag({
          // ctx:    document.createElementNS?(ns, "svg")
          radius: 20,
          points: 0
        });
        return expect(zigzag.el.getAttribute('d')).toBeFalsy();
      });
      return it('should calculate path length', function() {
        var zigzag;
        zigzag = new Zigzag({
          // ctx:    document.createElementNS?(ns, "svg")
          radius: 20,
          points: 10
        });
        zigzag._draw();
        return expect(zigzag._length).toBeCloseTo(184.390, 2);
      });
    });
  });
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var Bit, Zigzag, ns, svg;

Zigzag = mojs.shapesMap.getShape('zigzag');

Bit = mojs.shapesMap.getShape('bit');

ns = 'http://www.w3.org/2000/svg';

svg = typeof document.createElementNS === "function" ? document.createElementNS(ns, 'svg') : void 0;

document.body.appendChild(svg);

describe('Zigzag ->', function() {
  it('should extend Bit', function() {
    var line;
    line = new Zigzag({
      ctx: svg
    });
    return expect(line instanceof Bit).toBe(true);
  });
  it('should add itself to context', function() {
    var line;
    line = new Zigzag({
      ctx: svg
    });
    return expect(svg.firstChild).toBeDefined();
  });
  describe('_declareDefaults method ->', function() {
    it('should call super', function() {
      var zigzag;
      zigzag = new Zigzag();
      spyOn(Bit.prototype, '_declareDefaults');
      zigzag._declareDefaults();
      return expect(Bit.prototype._declareDefaults).toHaveBeenCalled();
    });
    it('should set `shape` to `path`', function() {
      var zigzag;
      zigzag = new Zigzag();
      return expect(zigzag._defaults.tag).toBe('path');
    });
    return it('should set `points` to `3`', function() {
      var zigzag;
      zigzag = new Zigzag();
      return expect(zigzag._defaults.points).toBe(3);
    });
  });
  return describe('methods ->', function() {
    return describe('_draw method ->', function() {
      it('should add properties to el', function() {
        var zigzag;
        return zigzag = new Zigzag({
          // ctx:    document.createElementNS?(ns, "svg")
          radius: 20
        });
      });
      it('should define points', function() {
        var zigzag;
        zigzag = new Zigzag({
          // ctx:    document.createElementNS?(ns, "svg")
          radius: 20
        });
        zigzag._draw();
        return expect(zigzag.el.getAttribute('d')).toBeTruthy();
      });
      it('should not work with 0 points', function() {
        var zigzag;
        zigzag = new Zigzag({
          // ctx:    document.createElementNS?(ns, "svg")
          radius: 20,
          points: 0
        });
        return expect(zigzag.el.getAttribute('d')).toBeFalsy();
      });
      return it('should calculate path length', function() {
        var zigzag;
        zigzag = new Zigzag({
          // ctx:    document.createElementNS?(ns, "svg")
          radius: 20,
          points: 10
        });
        zigzag._draw();
        return expect(zigzag._length).toBeCloseTo(184.390, 2);
      });
    });
  });
});
```

Response:
Zigzag = mojs.shapesMap.getShape('zigzag')
Bit    = mojs.shapesMap.getShape('bit')
ns     = 'http://www.w3.org/2000/svg'
svg    = document.createElementNS?(ns, 'svg')
document.body.appendChild svg

describe 'Zigzag ->', ->
  it 'should extend Bit', ->
    line = new Zigzag ctx: svg
    expect(line instanceof Bit).toBe(true)
  it 'should add itself to context', ->
    line = new Zigzag ctx: svg
    expect(svg.firstChild).toBeDefined()
  describe '_declareDefaults method ->', ->
    it 'should call super', ->
      zigzag = new Zigzag
      spyOn Bit::, '_declareDefaults'
      zigzag._declareDefaults()
      expect(Bit::_declareDefaults).toHaveBeenCalled()
    it 'should set `shape` to `path`', ->
      zigzag = new Zigzag
      expect(zigzag._defaults.tag).toBe 'path'
    it 'should set `points` to `3`', ->
      zigzag = new Zigzag
      expect(zigzag._defaults.points).toBe 3
  describe 'methods ->', ->
    describe '_draw method ->', ->
      it 'should add properties to el', ->
        zigzag = new Zigzag
          # ctx:    document.createElementNS?(ns, "svg")
          radius: 20
      it 'should define points', ->
        zigzag = new Zigzag
          # ctx:    document.createElementNS?(ns, "svg")
          radius: 20
        zigzag._draw()
        expect(zigzag.el.getAttribute('d')).toBeTruthy()
      it 'should not work with 0 points', ->
        zigzag = new Zigzag
          # ctx:    document.createElementNS?(ns, "svg")
          radius: 20
          points: 0
        expect(zigzag.el.getAttribute('d')).toBeFalsy()
      it 'should calculate path length', ->
        zigzag = new Zigzag
          # ctx:    document.createElementNS?(ns, "svg")
          radius: 20
          points: 10
        zigzag._draw()
        expect(zigzag._length).toBeCloseTo 184.390, 2


Prompt:
Zigzag = mojs.shapesMap.getShape('zigzag')
Bit    = mojs.shapesMap.getShape('bit')
ns     = 'http://www.w3.org/2000/svg'
svg    = document.createElementNS?(ns, 'svg')
document.body.appendChild svg

describe 'Zigzag ->', ->
  it 'should extend Bit', ->
    line = new Zigzag ctx: svg
    expect(line instanceof Bit).toBe(true)
  it 'should add itself to context', ->
    line = new Zigzag ctx: svg
    expect(svg.firstChild).toBeDefined()
  describe '_declareDefaults method ->', ->
    it 'should call super', ->
      zigzag = new Zigzag
      spyOn Bit::, '_declareDefaults'
      zigzag._declareDefaults()
      expect(Bit::_declareDefaults).toHaveBeenCalled()
    it 'should set `shape` to `path`', ->
      zigzag = new Zigzag
      expect(zigzag._defaults.tag).toBe 'path'
    it 'should set `points` to `3`', ->
      zigzag = new Zigzag
      expect(zigzag._defaults.points).toBe 3

Response:
describe 'methods ->', ->
    describe '_draw method ->', ->
      it 'should add properties to el', ->
        zigzag = new Zigzag
          # ctx:    document.createElementNS?(ns, "svg")
          radius: 20
      it 'should define points', ->
        zigzag = new Zigzag
          # ctx:    document.createElementNS?(ns, "svg")
          radius: 20
        zigzag._draw()
        expect(zigzag.el.getAttribute('d')).toBeTruthy()
      it 'should not work with 0 points', ->
        zigzag = new Zigzag
          # ctx:    document.createElementNS?(ns, "svg")
          radius: 20
          points: 0
        expect(zigzag.el.getAttribute('d')).toBeFalsy()
      it 'should calculate path length', ->
        zigzag = new Zigzag
          # ctx:    document.createElementNS?(ns, "svg")
          radius: 20
          points: 10
        zigzag._draw()
        expect(zigzag._length).toBeCloseTo 184.390, 2


Response:
it 'should set `d` attribute', ->
        zigzag = new Zigzag
          # ctx:    document.createElementNS?(ns, "svg")
          radius: 20
          points: 10
        zigzag._draw()

        p = zigzag._props

        radiusX = if p.radiusX? then p.radiusX else p.radius
        radiusY = if p.radiusY? then p.radiusY else p.radius

        x = p.width/2
        y = p.height/2

        currentX = x-radiusX
        currentY = y
        stepX    = (2*radiusX) / (p.points-1)
        yFlip    = -1

        delta = Math.sqrt(stepX*stepX + radiusY*radiusY)
        length = -delta

        points = "M#{currentX}, #{y} "
        for i in [0...p.points]
          points   += "L#{currentX}, #{currentY} "
          currentX += stepX
          length   += delta

          currentY = if yFlip is -1 then y-radiusY else y
          yFlip    = -yFlip

        isP1 = zigzag.el.getAttribute( 'd' ) is points
        isP2 = zigzag.el.getAttribute( 'd' ) is 'M -20 0 L -20 0 L -15.5556 -20 L -11.1111 0 L -6.66667 -20 L -2.22222 0 L 2.22222 -20 L 6.66667 0 L 11.1111 -20 L 15.5556 0 L 20 -20'

        expect( isP1 or isP2 ).toBe true
        expect( zigzag._prevRadiusX ).toBe radiusX
        expect( zigzag._prevRadiusY ).toBe radiusY
        expect( zigzag._prevPoints ).toBe p.points


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should set `d` attribute', ->
        zigzag = new Zigzag
          # ctx:    document.createElementNS?(ns, "svg")
          radius: 20
          points: 10
        zigzag._draw()

        p = zigzag._props

        radiusX = if p.radiusX? then p.radiusX else p.radius
        radiusY = if p.radiusY? then p.radiusY else p.radius

        x = p.width/2
        y = p.height/2

        currentX = x-radiusX
        currentY = y
        stepX    = (2*radiusX) / (p.points-1)
        yFlip    = -1

        delta = Math.sqrt(stepX*stepX + radiusY*radiusY)
        length = -delta

        points = "M#{currentX}, #{y} "
        for i in [0...p.points]
          points   += "L#{currentX}, #{currentY} "
          currentX += stepX
          length   += delta

          currentY = if yFlip is -1 then y-radiusY else y
          yFlip    = -yFlip

        isP1 = zigzag.el.getAttribute( 'd' ) is points
        isP2 = zigzag.el.getAttribute( 'd' ) is 'M -20 0 L -20 0 L -15.5556 -20 L -11.1111 0 L -6.66667 -20 L -2.22222 0 L 2.22222 -20 L 6.66667 0 L 11.1111 -20 L 15.5556 0 L 20 -20'

        expect( isP1 or isP2 ).toBe true
        expect( zigzag._prevRadiusX ).toBe radiusX
        expect( zigzag._prevRadiusY ).toBe radiusY
        expect( zigzag._prevPoints ).toBe p.points
```

Response:
it('should set `d` attribute', function() {
  var currentX, currentY, delta, i, isP1, isP2, j, length, p, points, radiusX, radiusY, ref, stepX, x, y, yFlip, zigzag;
  zigzag = new Zigzag({
    // ctx:    document.createElementNS?(ns, "svg")
    radius: 20,
    points: 10
  });
  zigzag._draw();
  p = zigzag._props;
  radiusX = p.radiusX != null ? p.radiusX : p.radius;
  radiusY = p.radiusY != null ? p.radiusY : p.radius;
  x = p.width / 2;
  y = p.height / 2;
  currentX = x - radiusX;
  currentY = y;
  stepX = (2 * radiusX) / (p.points - 1);
  yFlip = -1;
  delta = Math.sqrt(stepX * stepX + radiusY * radiusY);
  length = -delta;
  points = `M${currentX}, ${y} `;
  for (i = j = 0, ref = p.points; (0 <= ref ? j < ref : j > ref); i = 0 <= ref ? ++j : --j) {
    points += `L${currentX}, ${currentY} `;
    currentX += stepX;
    length += delta;
    currentY = yFlip === -1 ? y - radiusY : y;
    yFlip = -yFlip;
  }
  isP1 = zigzag.el.getAttribute('d') === points;
  isP2 = zigzag.el.getAttribute('d') === 'M -20 0 L -20 0 L -15.5556 -20 L -11.1111 0 L -6.66667 -20 L -2.22222 0 L 2.22222 -20 L 6.66667 0 L 11.1111 -20 L 15.5556 0 L 20 -20';
  expect(isP1 || isP2).toBe(true);
  expect(zigzag._prevRadiusX).toBe(radiusX);
  expect(zigzag._prevRadiusY).toBe(radiusY);
  return expect(zigzag._prevPoints).toBe(p.points);
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
it('should set `d` attribute', function() {
  var currentX, currentY, delta, i, isP1, isP2, j, length, p, points, radiusX, radiusY, ref, stepX, x, y, yFlip, zigzag;
  zigzag = new Zigzag({
    // ctx:    document.createElementNS?(ns, "svg")
    radius: 20,
    points: 10
  });
  zigzag._draw();
  p = zigzag._props;
  radiusX = p.radiusX != null ? p.radiusX : p.radius;
  radiusY = p.radiusY != null ? p.radiusY : p.radius;
  x = p.width / 2;
  y = p.height / 2;
  currentX = x - radiusX;
  currentY = y;
  stepX = (2 * radiusX) / (p.points - 1);
  yFlip = -1;
  delta = Math.sqrt(stepX * stepX + radiusY * radiusY);
  length = -delta;
  points = `M${currentX}, ${y} `;
  for (i = j = 0, ref = p.points; (0 <= ref ? j < ref : j > ref); i = 0 <= ref ? ++j : --j) {
    points += `L${currentX}, ${currentY} `;
    currentX += stepX;
    length += delta;
    currentY = yFlip === -1 ? y - radiusY : y;
    yFlip = -yFlip;
  }
  isP1 = zigzag.el.getAttribute('d') === points;
  isP2 = zigzag.el.getAttribute('d') === 'M -20 0 L -20 0 L -15.5556 -20 L -11.1111 0 L -6.66667 -20 L -2.22222 0 L 2.22222 -20 L 6.66667 0 L 11.1111 -20 L 15.5556 0 L 20 -20';
  expect(isP1 || isP2).toBe(true);
  expect(zigzag._prevRadiusX).toBe(radiusX);
  expect(zigzag._prevRadiusY).toBe(radiusY);
  return expect(zigzag._prevPoints).toBe(p.points);
});
```

Response:
it 'should set `d` attribute', ->
        zigzag = new Zigzag
          # ctx:    document.createElementNS?(ns, "svg")
          radius: 20
          points: 10
        zigzag._draw()

        p = zigzag._props

        radiusX = if p.radiusX? then p.radiusX else p.radius
        radiusY = if p.radiusY? then p.radiusY else p.radius

        x = p.width/2
        y = p.height/2

        currentX = x-radiusX
        currentY = y
        stepX    = (2*radiusX) / (p.points-1)
        yFlip    = -1

        delta = Math.sqrt(stepX*stepX + radiusY*radiusY)
        length = -delta

        points = "M#{currentX}, #{y} "
        for i in [0...p.points]
          points   += "L#{currentX}, #{currentY} "
          currentX += stepX
          length   += delta

          currentY = if yFlip is -1 then y-radiusY else y
          yFlip    = -yFlip

        isP1 = zigzag.el.getAttribute( 'd' ) is points
        isP2 = zigzag.el.getAttribute( 'd' ) is 'M -20 0 L -20 0 L -15.5556 -20 L -11.1111 0 L -6.66667 -20 L -2.22222 0 L 2.22222 -20 L 6.66667 0 L 11.1111 -20 L 15.5556 0 L 20 -20'

        expect( isP1 or isP2 ).toBe true
        expect( zigzag._prevRadiusX ).toBe radiusX
        expect( zigzag._prevRadiusY ).toBe radiusY
        expect( zigzag._prevPoints ).toBe p.points


Prompt:
it 'should set `d` attribute', ->
        zigzag = new Zigzag
          # ctx:    document.createElementNS?(ns, "svg")
          radius: 20
          points: 10
        zigzag._draw()

        p = zigzag._props

        radiusX = if p.radiusX? then p.radiusX else p.radius
        radiusY = if p.radiusY? then p.radiusY else p.radius

        x = p.width/2
        y = p.height/2

        currentX = x-radiusX
        currentY = y
        stepX    = (2*radiusX) / (p.points-1)
        yFlip    = -1

Response:
delta = Math.sqrt(stepX*stepX + radiusY*radiusY)
        length = -delta

        points = "M#{currentX}, #{y} "
        for i in [0...p.points]
          points   += "L#{currentX}, #{currentY} "
          currentX += stepX
          length   += delta

          currentY = if yFlip is -1 then y-radiusY else y
          yFlip    = -yFlip

        isP1 = zigzag.el.getAttribute( 'd' ) is points
        isP2 = zigzag.el.getAttribute( 'd' ) is 'M -20 0 L -20 0 L -15.5556 -20 L -11.1111 0 L -6.66667 -20 L -2.22222 0 L 2.22222 -20 L 6.66667 0 L 11.1111 -20 L 15.5556 0 L 20 -20'

        expect( isP1 or isP2 ).toBe true
        expect( zigzag._prevRadiusX ).toBe radiusX
        expect( zigzag._prevRadiusY ).toBe radiusY
        expect( zigzag._prevPoints ).toBe p.points


Response:
it 'should not set `d` attribute if nothing changed', ->
        zigzag = new Zigzag
          ctx:    document.createElementNS?(ns, "svg")
          radius: 20
          points: 10
        zigzag._draw()
        spyOn zigzag.el, 'setAttribute'
        zigzag._draw()
        expect( zigzag.el.setAttribute ).not.toHaveBeenCalled()

      it 'should set `d` attribute if `radiusX` changed', ->
        zigzag = new Zigzag
          ctx:    document.createElementNS?(ns, "svg")
          radius: 20
          points: 10
        zigzag._draw()
        spyOn zigzag.el, 'setAttribute'
        zigzag._props.radiusX = 30
        zigzag._draw()
        expect( zigzag.el.setAttribute ).toHaveBeenCalled()

      it 'should set `d` attribute if `radiusY` changed', ->
        zigzag = new Zigzag
          ctx:    document.createElementNS?(ns, "svg")
          radius: 20
          points: 10
        zigzag._draw()
        spyOn zigzag.el, 'setAttribute'
        zigzag._props.radiusY = 30
        zigzag._draw()
        expect( zigzag.el.setAttribute ).toHaveBeenCalled()

      it 'should set `d` attribute if `points` changed', ->
        zigzag = new Zigzag
          ctx:    document.createElementNS?(ns, "svg")
          radius: 20
          points: 10
        zigzag._draw()
        spyOn zigzag.el, 'setAttribute'
        zigzag._props.points = 30
        zigzag._draw()
        expect( zigzag.el.setAttribute ).toHaveBeenCalled()


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should not set `d` attribute if nothing changed', ->
        zigzag = new Zigzag
          ctx:    document.createElementNS?(ns, "svg")
          radius: 20
          points: 10
        zigzag._draw()
        spyOn zigzag.el, 'setAttribute'
        zigzag._draw()
        expect( zigzag.el.setAttribute ).not.toHaveBeenCalled()

      it 'should set `d` attribute if `radiusX` changed', ->
        zigzag = new Zigzag
          ctx:    document.createElementNS?(ns, "svg")
          radius: 20
          points: 10
        zigzag._draw()
        spyOn zigzag.el, 'setAttribute'
        zigzag._props.radiusX = 30
        zigzag._draw()
        expect( zigzag.el.setAttribute ).toHaveBeenCalled()

      it 'should set `d` attribute if `radiusY` changed', ->
        zigzag = new Zigzag
          ctx:    document.createElementNS?(ns, "svg")
          radius: 20
          points: 10
        zigzag._draw()
        spyOn zigzag.el, 'setAttribute'
        zigzag._props.radiusY = 30
        zigzag._draw()
        expect( zigzag.el.setAttribute ).toHaveBeenCalled()

      it 'should set `d` attribute if `points` changed', ->
        zigzag = new Zigzag
          ctx:    document.createElementNS?(ns, "svg")
          radius: 20
          points: 10
        zigzag._draw()
        spyOn zigzag.el, 'setAttribute'
        zigzag._props.points = 30
        zigzag._draw()
        expect( zigzag.el.setAttribute ).toHaveBeenCalled()
```

Response:
it('should not set `d` attribute if nothing changed', function() {
  var zigzag;
  zigzag = new Zigzag({
    ctx: typeof document.createElementNS === "function" ? document.createElementNS(ns, "svg") : void 0,
    radius: 20,
    points: 10
  });
  zigzag._draw();
  spyOn(zigzag.el, 'setAttribute');
  zigzag._draw();
  return expect(zigzag.el.setAttribute).not.toHaveBeenCalled();
});

it('should set `d` attribute if `radiusX` changed', function() {
  var zigzag;
  zigzag = new Zigzag({
    ctx: typeof document.createElementNS === "function" ? document.createElementNS(ns, "svg") : void 0,
    radius: 20,
    points: 10
  });
  zigzag._draw();
  spyOn(zigzag.el, 'setAttribute');
  zigzag._props.radiusX = 30;
  zigzag._draw();
  return expect(zigzag.el.setAttribute).toHaveBeenCalled();
});

it('should set `d` attribute if `radiusY` changed', function() {
  var zigzag;
  zigzag = new Zigzag({
    ctx: typeof document.createElementNS === "function" ? document.createElementNS(ns, "svg") : void 0,
    radius: 20,
    points: 10
  });
  zigzag._draw();
  spyOn(zigzag.el, 'setAttribute');
  zigzag._props.radiusY = 30;
  zigzag._draw();
  return expect(zigzag.el.setAttribute).toHaveBeenCalled();
});

it('should set `d` attribute if `points` changed', function() {
  var zigzag;
  zigzag = new Zigzag({
    ctx: typeof document.createElementNS === "function" ? document.createElementNS(ns, "svg") : void 0,
    radius: 20,
    points: 10
  });
  zigzag._draw();
  spyOn(zigzag.el, 'setAttribute');
  zigzag._props.points = 30;
  zigzag._draw();
  return expect(zigzag.el.setAttribute).toHaveBeenCalled();
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
it('should not set `d` attribute if nothing changed', function() {
  var zigzag;
  zigzag = new Zigzag({
    ctx: typeof document.createElementNS === "function" ? document.createElementNS(ns, "svg") : void 0,
    radius: 20,
    points: 10
  });
  zigzag._draw();
  spyOn(zigzag.el, 'setAttribute');
  zigzag._draw();
  return expect(zigzag.el.setAttribute).not.toHaveBeenCalled();
});

it('should set `d` attribute if `radiusX` changed', function() {
  var zigzag;
  zigzag = new Zigzag({
    ctx: typeof document.createElementNS === "function" ? document.createElementNS(ns, "svg") : void 0,
    radius: 20,
    points: 10
  });
  zigzag._draw();
  spyOn(zigzag.el, 'setAttribute');
  zigzag._props.radiusX = 30;
  zigzag._draw();
  return expect(zigzag.el.setAttribute).toHaveBeenCalled();
});

it('should set `d` attribute if `radiusY` changed', function() {
  var zigzag;
  zigzag = new Zigzag({
    ctx: typeof document.createElementNS === "function" ? document.createElementNS(ns, "svg") : void 0,
    radius: 20,
    points: 10
  });
  zigzag._draw();
  spyOn(zigzag.el, 'setAttribute');
  zigzag._props.radiusY = 30;
  zigzag._draw();
  return expect(zigzag.el.setAttribute).toHaveBeenCalled();
});

it('should set `d` attribute if `points` changed', function() {
  var zigzag;
  zigzag = new Zigzag({
    ctx: typeof document.createElementNS === "function" ? document.createElementNS(ns, "svg") : void 0,
    radius: 20,
    points: 10
  });
  zigzag._draw();
  spyOn(zigzag.el, 'setAttribute');
  zigzag._props.points = 30;
  zigzag._draw();
  return expect(zigzag.el.setAttribute).toHaveBeenCalled();
});
```

Response:
it 'should not set `d` attribute if nothing changed', ->
        zigzag = new Zigzag
          ctx:    document.createElementNS?(ns, "svg")
          radius: 20
          points: 10
        zigzag._draw()
        spyOn zigzag.el, 'setAttribute'
        zigzag._draw()
        expect( zigzag.el.setAttribute ).not.toHaveBeenCalled()

      it 'should set `d` attribute if `radiusX` changed', ->
        zigzag = new Zigzag
          ctx:    document.createElementNS?(ns, "svg")
          radius: 20
          points: 10
        zigzag._draw()
        spyOn zigzag.el, 'setAttribute'
        zigzag._props.radiusX = 30
        zigzag._draw()
        expect( zigzag.el.setAttribute ).toHaveBeenCalled()

      it 'should set `d` attribute if `radiusY` changed', ->
        zigzag = new Zigzag
          ctx:    document.createElementNS?(ns, "svg")
          radius: 20
          points: 10
        zigzag._draw()
        spyOn zigzag.el, 'setAttribute'
        zigzag._props.radiusY = 30
        zigzag._draw()
        expect( zigzag.el.setAttribute ).toHaveBeenCalled()

      it 'should set `d` attribute if `points` changed', ->
        zigzag = new Zigzag
          ctx:    document.createElementNS?(ns, "svg")
          radius: 20
          points: 10
        zigzag._draw()
        spyOn zigzag.el, 'setAttribute'
        zigzag._props.points = 30
        zigzag._draw()
        expect( zigzag.el.setAttribute ).toHaveBeenCalled()


Prompt:
it 'should not set `d` attribute if nothing changed', ->
        zigzag = new Zigzag
          ctx:    document.createElementNS?(ns, "svg")
          radius: 20
          points: 10
        zigzag._draw()
        spyOn zigzag.el, 'setAttribute'
        zigzag._draw()
        expect( zigzag.el.setAttribute ).not.toHaveBeenCalled()

      it 'should set `d` attribute if `radiusX` changed', ->
        zigzag = new Zigzag
          ctx:    document.createElementNS?(ns, "svg")
          radius: 20
          points: 10
        zigzag._draw()
        spyOn zigzag.el, 'setAttribute'
        zigzag._props.radiusX = 30
        zigzag._draw()
        expect( zigzag.el.setAttribute ).toHaveBeenCalled()

Response:
it 'should set `d` attribute if `radiusY` changed', ->
        zigzag = new Zigzag
          ctx:    document.createElementNS?(ns, "svg")
          radius: 20
          points: 10
        zigzag._draw()
        spyOn zigzag.el, 'setAttribute'
        zigzag._props.radiusY = 30
        zigzag._draw()
        expect( zigzag.el.setAttribute ).toHaveBeenCalled()

      it 'should set `d` attribute if `points` changed', ->
        zigzag = new Zigzag
          ctx:    document.createElementNS?(ns, "svg")
          radius: 20
          points: 10
        zigzag._draw()
        spyOn zigzag.el, 'setAttribute'
        zigzag._props.points = 30
        zigzag._draw()
        expect( zigzag.el.setAttribute ).toHaveBeenCalled()


Response:
describe 'getLength method ->', ->
    it 'should calculate total length of the path', ->
      bit = new Zigzag
        ctx:    document.createElementNS ns, 'svg'
        radiusX: 100
        radiusY: 550

      bit._draw()

      expect( bit._getLength() ).toBe bit._length


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
describe 'getLength method ->', ->
    it 'should calculate total length of the path', ->
      bit = new Zigzag
        ctx:    document.createElementNS ns, 'svg'
        radiusX: 100
        radiusY: 550

      bit._draw()

      expect( bit._getLength() ).toBe bit._length
```

Response:
describe('getLength method ->', function() {
  return it('should calculate total length of the path', function() {
    var bit;
    bit = new Zigzag({
      ctx: document.createElementNS(ns, 'svg'),
      radiusX: 100,
      radiusY: 550
    });
    bit._draw();
    return expect(bit._getLength()).toBe(bit._length);
  });
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
describe('getLength method ->', function() {
  return it('should calculate total length of the path', function() {
    var bit;
    bit = new Zigzag({
      ctx: document.createElementNS(ns, 'svg'),
      radiusX: 100,
      radiusY: 550
    });
    bit._draw();
    return expect(bit._getLength()).toBe(bit._length);
  });
});
```

Response:
describe 'getLength method ->', ->
    it 'should calculate total length of the path', ->
      bit = new Zigzag
        ctx:    document.createElementNS ns, 'svg'
        radiusX: 100
        radiusY: 550

      bit._draw()

      expect( bit._getLength() ).toBe bit._length


Prompt:
describe 'getLength method ->', ->
    it 'should calculate total length of the path', ->
      bit = new Zigzag
        ctx:    document.createElementNS ns, 'svg'
        radiusX: 100

Response:
radiusY: 550

      bit._draw()

      expect( bit._getLength() ).toBe bit._length


Response:
# Item manipulation methods.
# --------------------------

addItem = (id, quantity = 1, properties = {}) ->
  data = wrapKeys(properties, 'properties')
  data.id = id
  data.quantity = quantity
  enqueue '/cart/add.js', data
  return

updateItem = (line, quantity = 1, properties = {}) ->
  data = wrapKeys(properties, 'properties')
  data.line = line
  data.quantity = quantity
  enqueue '/cart/change.js', data
  return

removeItem = (line) ->
  updateItem line, 0
  return

clearItems = () ->
  enqueue '/cart/clear.js'
  return


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
# Item manipulation methods.
# --------------------------

addItem = (id, quantity = 1, properties = {}) ->
  data = wrapKeys(properties, 'properties')
  data.id = id
  data.quantity = quantity
  enqueue '/cart/add.js', data
  return

updateItem = (line, quantity = 1, properties = {}) ->
  data = wrapKeys(properties, 'properties')
  data.line = line
  data.quantity = quantity
  enqueue '/cart/change.js', data
  return

removeItem = (line) ->
  updateItem line, 0
  return

clearItems = () ->
  enqueue '/cart/clear.js'
  return
```

Response:
// Item manipulation methods.
// --------------------------
var addItem, clearItems, removeItem, updateItem;

addItem = function(id, quantity = 1, properties = {}) {
  var data;
  data = wrapKeys(properties, 'properties');
  data.id = id;
  data.quantity = quantity;
  enqueue('/cart/add.js', data);
};

updateItem = function(line, quantity = 1, properties = {}) {
  var data;
  data = wrapKeys(properties, 'properties');
  data.line = line;
  data.quantity = quantity;
  enqueue('/cart/change.js', data);
};

removeItem = function(line) {
  updateItem(line, 0);
};

clearItems = function() {
  enqueue('/cart/clear.js');
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
// Item manipulation methods.
// --------------------------
var addItem, clearItems, removeItem, updateItem;

addItem = function(id, quantity = 1, properties = {}) {
  var data;
  data = wrapKeys(properties, 'properties');
  data.id = id;
  data.quantity = quantity;
  enqueue('/cart/add.js', data);
};

updateItem = function(line, quantity = 1, properties = {}) {
  var data;
  data = wrapKeys(properties, 'properties');
  data.line = line;
  data.quantity = quantity;
  enqueue('/cart/change.js', data);
};

removeItem = function(line) {
  updateItem(line, 0);
};

clearItems = function() {
  enqueue('/cart/clear.js');
};
```

Response:
# Item manipulation methods.
# --------------------------

addItem = (id, quantity = 1, properties = {}) ->
  data = wrapKeys(properties, 'properties')
  data.id = id
  data.quantity = quantity
  enqueue '/cart/add.js', data
  return

updateItem = (line, quantity = 1, properties = {}) ->
  data = wrapKeys(properties, 'properties')
  data.line = line
  data.quantity = quantity
  enqueue '/cart/change.js', data
  return

removeItem = (line) ->
  updateItem line, 0
  return

clearItems = () ->
  enqueue '/cart/clear.js'
  return


Prompt:
# Item manipulation methods.
# --------------------------

addItem = (id, quantity = 1, properties = {}) ->
  data = wrapKeys(properties, 'properties')
  data.id = id
  data.quantity = quantity
  enqueue '/cart/add.js', data
  return

updateItem = (line, quantity = 1, properties = {}) ->
  data = wrapKeys(properties, 'properties')

Response:
data.line = line
  data.quantity = quantity
  enqueue '/cart/change.js', data
  return

removeItem = (line) ->
  updateItem line, 0
  return

clearItems = () ->
  enqueue '/cart/clear.js'
  return


Response:
# Item manipulation methods.
# --------------------------

Cart.addItem = (id, quantity = 1, properties = {}) ->
  data = Cart.wrapKeys(properties, 'properties')
  data.id = id
  data.quantity = quantity
  enqueue '/cart/add.js', data

Cart.updateItem = (line, quantity = 1, properties = {}) ->
  data = Cart.wrapKeys(properties, 'properties')
  data.line = line
  data.quantity = quantity
  enqueue '/cart/change.js', data

Cart.removeItem = (line) ->
  Cart.updateItem line, 0

Cart.clearItems = () ->
  enqueue '/cart/clear.js'


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
# Item manipulation methods.
# --------------------------

Cart.addItem = (id, quantity = 1, properties = {}) ->
  data = Cart.wrapKeys(properties, 'properties')
  data.id = id
  data.quantity = quantity
  enqueue '/cart/add.js', data

Cart.updateItem = (line, quantity = 1, properties = {}) ->
  data = Cart.wrapKeys(properties, 'properties')
  data.line = line
  data.quantity = quantity
  enqueue '/cart/change.js', data

Cart.removeItem = (line) ->
  Cart.updateItem line, 0

Cart.clearItems = () ->
  enqueue '/cart/clear.js'
```

Response:
// Item manipulation methods.
// --------------------------
Cart.addItem = function(id, quantity = 1, properties = {}) {
  var data;
  data = Cart.wrapKeys(properties, 'properties');
  data.id = id;
  data.quantity = quantity;
  return enqueue('/cart/add.js', data);
};

Cart.updateItem = function(line, quantity = 1, properties = {}) {
  var data;
  data = Cart.wrapKeys(properties, 'properties');
  data.line = line;
  data.quantity = quantity;
  return enqueue('/cart/change.js', data);
};

Cart.removeItem = function(line) {
  return Cart.updateItem(line, 0);
};

Cart.clearItems = function() {
  return enqueue('/cart/clear.js');
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
// Item manipulation methods.
// --------------------------
Cart.addItem = function(id, quantity = 1, properties = {}) {
  var data;
  data = Cart.wrapKeys(properties, 'properties');
  data.id = id;
  data.quantity = quantity;
  return enqueue('/cart/add.js', data);
};

Cart.updateItem = function(line, quantity = 1, properties = {}) {
  var data;
  data = Cart.wrapKeys(properties, 'properties');
  data.line = line;
  data.quantity = quantity;
  return enqueue('/cart/change.js', data);
};

Cart.removeItem = function(line) {
  return Cart.updateItem(line, 0);
};

Cart.clearItems = function() {
  return enqueue('/cart/clear.js');
};
```

Response:
# Item manipulation methods.
# --------------------------

Cart.addItem = (id, quantity = 1, properties = {}) ->
  data = Cart.wrapKeys(properties, 'properties')
  data.id = id
  data.quantity = quantity
  enqueue '/cart/add.js', data

Cart.updateItem = (line, quantity = 1, properties = {}) ->
  data = Cart.wrapKeys(properties, 'properties')
  data.line = line
  data.quantity = quantity
  enqueue '/cart/change.js', data

Cart.removeItem = (line) ->
  Cart.updateItem line, 0

Cart.clearItems = () ->
  enqueue '/cart/clear.js'


Prompt:
# Item manipulation methods.
# --------------------------

Cart.addItem = (id, quantity = 1, properties = {}) ->
  data = Cart.wrapKeys(properties, 'properties')
  data.id = id
  data.quantity = quantity
  enqueue '/cart/add.js', data

Cart.updateItem = (line, quantity = 1, properties = {}) ->

Response:
data = Cart.wrapKeys(properties, 'properties')
  data.line = line
  data.quantity = quantity
  enqueue '/cart/change.js', data

Cart.removeItem = (line) ->
  Cart.updateItem line, 0

Cart.clearItems = () ->
  enqueue '/cart/clear.js'


Response:
_ = require 'lodash'
Err = require 'err1st'
Promise = require 'bluebird'
request = require 'request'

limbo = require 'limbo'

{
  TeamModel
  UserModel
} = limbo.use 'talk'

tbAccountUrl = 'https://account.teambition.com'
tbApiUrl = 'https://www.teambition.com/api'

module.exports = teambition =

  getTeams: (union, callback) ->
    options =
      method: 'GET'
      url: tbApiUrl + '/organizations'
      json: true
      headers: Authorization: "OAuth2 #{union.accessToken}"
    request options, (err, res, orgs = []) ->
      return callback(new Err('REQUEST_FAILD')) unless res?.statusCode is 200
      teams = orgs.map (orgz) ->
        return false if not orgz or orgz.isDeleted
        team = name: orgz.name, sourceId: orgz._id
      .filter (team) -> team
      callback err, teams

  getTeam: (sourceId, union, callback) ->
    options =
      method: 'GET'
      url: tbApiUrl + '/organizations/' + sourceId
      json: true
      headers: Authorization: "OAuth2 #{union.accessToken}"

    request options, (err, res, orgz) ->
      return callback(new Err('REQUEST_FAILD')) unless res?.statusCode is 200 and orgz?.name and not orgz.isDeleted
      callback null, name: orgz.name, sourceId: orgz._id

  getTeamMembers: (union, team, callback) ->
    options =
      method: 'GET'
      url: tbApiUrl + "/v2/organizations/#{team.sourceId}/members"
      json: true
      headers: Authorization: "OAuth2 #{union.accessToken}"

    request options, (err, res, tbMembers = []) ->


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
Err = require 'err1st'
Promise = require 'bluebird'
request = require 'request'

limbo = require 'limbo'

{
  TeamModel
  UserModel
} = limbo.use 'talk'

tbAccountUrl = 'https://account.teambition.com'
tbApiUrl = 'https://www.teambition.com/api'

module.exports = teambition =

  getTeams: (union, callback) ->
    options =
      method: 'GET'
      url: tbApiUrl + '/organizations'
      json: true
      headers: Authorization: "OAuth2 #{union.accessToken}"
    request options, (err, res, orgs = []) ->
      return callback(new Err('REQUEST_FAILD')) unless res?.statusCode is 200
      teams = orgs.map (orgz) ->
        return false if not orgz or orgz.isDeleted
        team = name: orgz.name, sourceId: orgz._id
      .filter (team) -> team
      callback err, teams

  getTeam: (sourceId, union, callback) ->
    options =
      method: 'GET'
      url: tbApiUrl + '/organizations/' + sourceId
      json: true
      headers: Authorization: "OAuth2 #{union.accessToken}"

    request options, (err, res, orgz) ->
      return callback(new Err('REQUEST_FAILD')) unless res?.statusCode is 200 and orgz?.name and not orgz.isDeleted
      callback null, name: orgz.name, sourceId: orgz._id

  getTeamMembers: (union, team, callback) ->
    options =
      method: 'GET'
      url: tbApiUrl + "/v2/organizations/#{team.sourceId}/members"
      json: true
      headers: Authorization: "OAuth2 #{union.accessToken}"

    request options, (err, res, tbMembers = []) ->
```

Response:
var Err, Promise, TeamModel, UserModel, _, limbo, request, tbAccountUrl, tbApiUrl, teambition;

_ = require('lodash');

Err = require('err1st');

Promise = require('bluebird');

request = require('request');

limbo = require('limbo');

({TeamModel, UserModel} = limbo.use('talk'));

tbAccountUrl = 'https://account.teambition.com';

tbApiUrl = 'https://www.teambition.com/api';

module.exports = teambition = {
  getTeams: function(union, callback) {
    var options;
    options = {
      method: 'GET',
      url: tbApiUrl + '/organizations',
      json: true,
      headers: {
        Authorization: `OAuth2 ${union.accessToken}`
      }
    };
    return request(options, function(err, res, orgs = []) {
      var teams;
      if ((res != null ? res.statusCode : void 0) !== 200) {
        return callback(new Err('REQUEST_FAILD'));
      }
      teams = orgs.map(function(orgz) {
        var team;
        if (!orgz || orgz.isDeleted) {
          return false;
        }
        return team = {
          name: orgz.name,
          sourceId: orgz._id
        };
      }).filter(function(team) {
        return team;
      });
      return callback(err, teams);
    });
  },
  getTeam: function(sourceId, union, callback) {
    var options;
    options = {
      method: 'GET',
      url: tbApiUrl + '/organizations/' + sourceId,
      json: true,
      headers: {
        Authorization: `OAuth2 ${union.accessToken}`
      }
    };
    return request(options, function(err, res, orgz) {
      if (!((res != null ? res.statusCode : void 0) === 200 && (orgz != null ? orgz.name : void 0) && !orgz.isDeleted)) {
        return callback(new Err('REQUEST_FAILD'));
      }
      return callback(null, {
        name: orgz.name,
        sourceId: orgz._id
      });
    });
  },
  getTeamMembers: function(union, team, callback) {
    var options;
    options = {
      method: 'GET',
      url: tbApiUrl + `/v2/organizations/${team.sourceId}/members`,
      json: true,
      headers: {
        Authorization: `OAuth2 ${union.accessToken}`
      }
    };
    return request(options, function(err, res, tbMembers = []) {});
  }
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var Err, Promise, TeamModel, UserModel, _, limbo, request, tbAccountUrl, tbApiUrl, teambition;

_ = require('lodash');

Err = require('err1st');

Promise = require('bluebird');

request = require('request');

limbo = require('limbo');

({TeamModel, UserModel} = limbo.use('talk'));

tbAccountUrl = 'https://account.teambition.com';

tbApiUrl = 'https://www.teambition.com/api';

module.exports = teambition = {
  getTeams: function(union, callback) {
    var options;
    options = {
      method: 'GET',
      url: tbApiUrl + '/organizations',
      json: true,
      headers: {
        Authorization: `OAuth2 ${union.accessToken}`
      }
    };
    return request(options, function(err, res, orgs = []) {
      var teams;
      if ((res != null ? res.statusCode : void 0) !== 200) {
        return callback(new Err('REQUEST_FAILD'));
      }
      teams = orgs.map(function(orgz) {
        var team;
        if (!orgz || orgz.isDeleted) {
          return false;
        }
        return team = {
          name: orgz.name,
          sourceId: orgz._id
        };
      }).filter(function(team) {
        return team;
      });
      return callback(err, teams);
    });
  },
  getTeam: function(sourceId, union, callback) {
    var options;
    options = {
      method: 'GET',
      url: tbApiUrl + '/organizations/' + sourceId,
      json: true,
      headers: {
        Authorization: `OAuth2 ${union.accessToken}`
      }
    };
    return request(options, function(err, res, orgz) {
      if (!((res != null ? res.statusCode : void 0) === 200 && (orgz != null ? orgz.name : void 0) && !orgz.isDeleted)) {
        return callback(new Err('REQUEST_FAILD'));
      }
      return callback(null, {
        name: orgz.name,
        sourceId: orgz._id
      });
    });
  },
  getTeamMembers: function(union, team, callback) {
    var options;
    options = {
      method: 'GET',
      url: tbApiUrl + `/v2/organizations/${team.sourceId}/members`,
      json: true,
      headers: {
        Authorization: `OAuth2 ${union.accessToken}`
      }
    };
    return request(options, function(err, res, tbMembers = []) {});
  }
};
```

Response:
_ = require 'lodash'
Err = require 'err1st'
Promise = require 'bluebird'
request = require 'request'

limbo = require 'limbo'

{
  TeamModel
  UserModel
} = limbo.use 'talk'

tbAccountUrl = 'https://account.teambition.com'
tbApiUrl = 'https://www.teambition.com/api'

module.exports = teambition =

  getTeams: (union, callback) ->
    options =
      method: 'GET'
      url: tbApiUrl + '/organizations'
      json: true
      headers: Authorization: "OAuth2 #{union.accessToken}"
    request options, (err, res, orgs = []) ->
      return callback(new Err('REQUEST_FAILD')) unless res?.statusCode is 200
      teams = orgs.map (orgz) ->
        return false if not orgz or orgz.isDeleted
        team = name: orgz.name, sourceId: orgz._id
      .filter (team) -> team
      callback err, teams

  getTeam: (sourceId, union, callback) ->
    options =
      method: 'GET'
      url: tbApiUrl + '/organizations/' + sourceId
      json: true
      headers: Authorization: "OAuth2 #{union.accessToken}"

    request options, (err, res, orgz) ->
      return callback(new Err('REQUEST_FAILD')) unless res?.statusCode is 200 and orgz?.name and not orgz.isDeleted
      callback null, name: orgz.name, sourceId: orgz._id

  getTeamMembers: (union, team, callback) ->
    options =
      method: 'GET'
      url: tbApiUrl + "/v2/organizations/#{team.sourceId}/members"
      json: true
      headers: Authorization: "OAuth2 #{union.accessToken}"

    request options, (err, res, tbMembers = []) ->


Prompt:
_ = require 'lodash'
Err = require 'err1st'
Promise = require 'bluebird'
request = require 'request'

limbo = require 'limbo'

{
  TeamModel
  UserModel
} = limbo.use 'talk'

tbAccountUrl = 'https://account.teambition.com'
tbApiUrl = 'https://www.teambition.com/api'

module.exports = teambition =

  getTeams: (union, callback) ->
    options =
      method: 'GET'
      url: tbApiUrl + '/organizations'
      json: true
      headers: Authorization: "OAuth2 #{union.accessToken}"
    request options, (err, res, orgs = []) ->
      return callback(new Err('REQUEST_FAILD')) unless res?.statusCode is 200

Response:
teams = orgs.map (orgz) ->
        return false if not orgz or orgz.isDeleted
        team = name: orgz.name, sourceId: orgz._id
      .filter (team) -> team
      callback err, teams

  getTeam: (sourceId, union, callback) ->
    options =
      method: 'GET'
      url: tbApiUrl + '/organizations/' + sourceId
      json: true
      headers: Authorization: "OAuth2 #{union.accessToken}"

    request options, (err, res, orgz) ->
      return callback(new Err('REQUEST_FAILD')) unless res?.statusCode is 200 and orgz?.name and not orgz.isDeleted
      callback null, name: orgz.name, sourceId: orgz._id

  getTeamMembers: (union, team, callback) ->
    options =
      method: 'GET'
      url: tbApiUrl + "/v2/organizations/#{team.sourceId}/members"
      json: true
      headers: Authorization: "OAuth2 #{union.accessToken}"

    request options, (err, res, tbMembers = []) ->


Response:
return callback(new Err("REQUEST_FAILD")) unless res?.statusCode is 200
      # Reflect teambition rights to talk teams
      members = tbMembers.map (tbMember) ->
        switch Number(tbMember._roleId)
          when 2 then role = 'owner'
          when 1 then role = 'admin'
          else role = 'member'
        userData =
          openId: tbMember._id
          role: role
          mobile: tbMember.phone
          email: tbMember.email
          name: tbMember.name
          avatarUrl: tbMember.avatarUrl
      callback err, members


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
return callback(new Err("REQUEST_FAILD")) unless res?.statusCode is 200
      # Reflect teambition rights to talk teams
      members = tbMembers.map (tbMember) ->
        switch Number(tbMember._roleId)
          when 2 then role = 'owner'
          when 1 then role = 'admin'
          else role = 'member'
        userData =
          openId: tbMember._id
          role: role
          mobile: tbMember.phone
          email: tbMember.email
          name: tbMember.name
          avatarUrl: tbMember.avatarUrl
      callback err, members
```

Response:
var members;

// Reflect teambition rights to talk teams
return callback(new Err("REQUEST_FAILD"))((typeof res !== "undefined" && res !== null ? res.statusCode : void 0) !== 200 ? (members = tbMembers.map(function(tbMember) {
  var role, userData;
  switch (Number(tbMember._roleId)) {
    case 2:
      role = 'owner';
      break;
    case 1:
      role = 'admin';
      break;
    default:
      role = 'member';
  }
  return userData = {
    openId: tbMember._id,
    role: role,
    mobile: tbMember.phone,
    email: tbMember.email,
    name: tbMember.name,
    avatarUrl: tbMember.avatarUrl
  };
}), callback(err, members)) : void 0);


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var members;

// Reflect teambition rights to talk teams
return callback(new Err("REQUEST_FAILD"))((typeof res !== "undefined" && res !== null ? res.statusCode : void 0) !== 200 ? (members = tbMembers.map(function(tbMember) {
  var role, userData;
  switch (Number(tbMember._roleId)) {
    case 2:
      role = 'owner';
      break;
    case 1:
      role = 'admin';
      break;
    default:
      role = 'member';
  }
  return userData = {
    openId: tbMember._id,
    role: role,
    mobile: tbMember.phone,
    email: tbMember.email,
    name: tbMember.name,
    avatarUrl: tbMember.avatarUrl
  };
}), callback(err, members)) : void 0);
```

Response:
return callback(new Err("REQUEST_FAILD")) unless res?.statusCode is 200
      # Reflect teambition rights to talk teams
      members = tbMembers.map (tbMember) ->
        switch Number(tbMember._roleId)
          when 2 then role = 'owner'
          when 1 then role = 'admin'
          else role = 'member'
        userData =
          openId: tbMember._id
          role: role
          mobile: tbMember.phone
          email: tbMember.email
          name: tbMember.name
          avatarUrl: tbMember.avatarUrl
      callback err, members


Prompt:
return callback(new Err("REQUEST_FAILD")) unless res?.statusCode is 200
      # Reflect teambition rights to talk teams
      members = tbMembers.map (tbMember) ->
        switch Number(tbMember._roleId)
          when 2 then role = 'owner'
          when 1 then role = 'admin'
          else role = 'member'

Response:
userData =
          openId: tbMember._id
          role: role
          mobile: tbMember.phone
          email: tbMember.email
          name: tbMember.name
          avatarUrl: tbMember.avatarUrl
      callback err, members


Response:
return unless require?

{buildCSOptionParser} = require '../lib/coffeescript/command'

optionParser = buildCSOptionParser()

sameOptions = (opts1, opts2, msg) ->
  ownKeys = Object.keys(opts1).sort()
  otherKeys = Object.keys(opts2).sort()
  arrayEq ownKeys, otherKeys, msg
  for k in ownKeys
    arrayEq opts1[k], opts2[k], msg
  yes

test "combined options are still split after initial file name", ->
  argv = ['some-file.coffee', '-bc']
  parsed = optionParser.parse argv
  expected = arguments: ['some-file.coffee', '-b', '-c']
  sameOptions parsed, expected

  argv = ['some-file.litcoffee', '-bc']
  parsed = optionParser.parse argv
  expected = arguments: ['some-file.litcoffee', '-b', '-c']
  sameOptions parsed, expected

  argv = ['-c', 'some-file.coffee', '-bc']
  parsed = optionParser.parse argv
  expected =
    compile: yes
    arguments: ['some-file.coffee', '-b', '-c']
  sameOptions parsed, expected

  argv = ['-bc', 'some-file.coffee', '-bc']
  parsed = optionParser.parse argv
  expected =
    bare: yes
    compile: yes
    arguments: ['some-file.coffee', '-b', '-c']
  sameOptions parsed, expected

test "combined options are not split after a '--'", ->
  argv = ['--', '-bc']
  parsed = optionParser.parse argv
  expected = arguments: ['-bc']
  sameOptions parsed, expected

  argv = ['-bc', '--', '-bc']
  parsed = optionParser.parse argv
  expected =
    bare: yes


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
return unless require?

{buildCSOptionParser} = require '../lib/coffeescript/command'

optionParser = buildCSOptionParser()

sameOptions = (opts1, opts2, msg) ->
  ownKeys = Object.keys(opts1).sort()
  otherKeys = Object.keys(opts2).sort()
  arrayEq ownKeys, otherKeys, msg
  for k in ownKeys
    arrayEq opts1[k], opts2[k], msg
  yes

test "combined options are still split after initial file name", ->
  argv = ['some-file.coffee', '-bc']
  parsed = optionParser.parse argv
  expected = arguments: ['some-file.coffee', '-b', '-c']
  sameOptions parsed, expected

  argv = ['some-file.litcoffee', '-bc']
  parsed = optionParser.parse argv
  expected = arguments: ['some-file.litcoffee', '-b', '-c']
  sameOptions parsed, expected

  argv = ['-c', 'some-file.coffee', '-bc']
  parsed = optionParser.parse argv
  expected =
    compile: yes
    arguments: ['some-file.coffee', '-b', '-c']
  sameOptions parsed, expected

  argv = ['-bc', 'some-file.coffee', '-bc']
  parsed = optionParser.parse argv
  expected =
    bare: yes
    compile: yes
    arguments: ['some-file.coffee', '-b', '-c']
  sameOptions parsed, expected

test "combined options are not split after a '--'", ->
  argv = ['--', '-bc']
  parsed = optionParser.parse argv
  expected = arguments: ['-bc']
  sameOptions parsed, expected

  argv = ['-bc', '--', '-bc']
  parsed = optionParser.parse argv
  expected =
    bare: yes
```

Response:
var buildCSOptionParser, optionParser, sameOptions;

if (typeof require === "undefined" || require === null) {
  return;
}

({buildCSOptionParser} = require('../lib/coffeescript/command'));

optionParser = buildCSOptionParser();

sameOptions = function(opts1, opts2, msg) {
  var i, k, len, otherKeys, ownKeys;
  ownKeys = Object.keys(opts1).sort();
  otherKeys = Object.keys(opts2).sort();
  arrayEq(ownKeys, otherKeys, msg);
  for (i = 0, len = ownKeys.length; i < len; i++) {
    k = ownKeys[i];
    arrayEq(opts1[k], opts2[k], msg);
  }
  return true;
};

test("combined options are still split after initial file name", function() {
  var argv, expected, parsed;
  argv = ['some-file.coffee', '-bc'];
  parsed = optionParser.parse(argv);
  expected = {
    arguments: ['some-file.coffee', '-b', '-c']
  };
  sameOptions(parsed, expected);
  argv = ['some-file.litcoffee', '-bc'];
  parsed = optionParser.parse(argv);
  expected = {
    arguments: ['some-file.litcoffee', '-b', '-c']
  };
  sameOptions(parsed, expected);
  argv = ['-c', 'some-file.coffee', '-bc'];
  parsed = optionParser.parse(argv);
  expected = {
    compile: true,
    arguments: ['some-file.coffee', '-b', '-c']
  };
  sameOptions(parsed, expected);
  argv = ['-bc', 'some-file.coffee', '-bc'];
  parsed = optionParser.parse(argv);
  expected = {
    bare: true,
    compile: true,
    arguments: ['some-file.coffee', '-b', '-c']
  };
  return sameOptions(parsed, expected);
});

test("combined options are not split after a '--'", function() {
  var argv, expected, parsed;
  argv = ['--', '-bc'];
  parsed = optionParser.parse(argv);
  expected = {
    arguments: ['-bc']
  };
  sameOptions(parsed, expected);
  argv = ['-bc', '--', '-bc'];
  parsed = optionParser.parse(argv);
  return expected = {
    bare: true
  };
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var buildCSOptionParser, optionParser, sameOptions;

if (typeof require === "undefined" || require === null) {
  return;
}

({buildCSOptionParser} = require('../lib/coffeescript/command'));

optionParser = buildCSOptionParser();

sameOptions = function(opts1, opts2, msg) {
  var i, k, len, otherKeys, ownKeys;
  ownKeys = Object.keys(opts1).sort();
  otherKeys = Object.keys(opts2).sort();
  arrayEq(ownKeys, otherKeys, msg);
  for (i = 0, len = ownKeys.length; i < len; i++) {
    k = ownKeys[i];
    arrayEq(opts1[k], opts2[k], msg);
  }
  return true;
};

test("combined options are still split after initial file name", function() {
  var argv, expected, parsed;
  argv = ['some-file.coffee', '-bc'];
  parsed = optionParser.parse(argv);
  expected = {
    arguments: ['some-file.coffee', '-b', '-c']
  };
  sameOptions(parsed, expected);
  argv = ['some-file.litcoffee', '-bc'];
  parsed = optionParser.parse(argv);
  expected = {
    arguments: ['some-file.litcoffee', '-b', '-c']
  };
  sameOptions(parsed, expected);
  argv = ['-c', 'some-file.coffee', '-bc'];
  parsed = optionParser.parse(argv);
  expected = {
    compile: true,
    arguments: ['some-file.coffee', '-b', '-c']
  };
  sameOptions(parsed, expected);
  argv = ['-bc', 'some-file.coffee', '-bc'];
  parsed = optionParser.parse(argv);
  expected = {
    bare: true,
    compile: true,
    arguments: ['some-file.coffee', '-b', '-c']
  };
  return sameOptions(parsed, expected);
});

test("combined options are not split after a '--'", function() {
  var argv, expected, parsed;
  argv = ['--', '-bc'];
  parsed = optionParser.parse(argv);
  expected = {
    arguments: ['-bc']
  };
  sameOptions(parsed, expected);
  argv = ['-bc', '--', '-bc'];
  parsed = optionParser.parse(argv);
  return expected = {
    bare: true
  };
});
```

Response:
return unless require?

{buildCSOptionParser} = require '../lib/coffeescript/command'

optionParser = buildCSOptionParser()

sameOptions = (opts1, opts2, msg) ->
  ownKeys = Object.keys(opts1).sort()
  otherKeys = Object.keys(opts2).sort()
  arrayEq ownKeys, otherKeys, msg
  for k in ownKeys
    arrayEq opts1[k], opts2[k], msg
  yes

test "combined options are still split after initial file name", ->
  argv = ['some-file.coffee', '-bc']
  parsed = optionParser.parse argv
  expected = arguments: ['some-file.coffee', '-b', '-c']
  sameOptions parsed, expected

  argv = ['some-file.litcoffee', '-bc']
  parsed = optionParser.parse argv
  expected = arguments: ['some-file.litcoffee', '-b', '-c']
  sameOptions parsed, expected

  argv = ['-c', 'some-file.coffee', '-bc']
  parsed = optionParser.parse argv
  expected =
    compile: yes
    arguments: ['some-file.coffee', '-b', '-c']
  sameOptions parsed, expected

  argv = ['-bc', 'some-file.coffee', '-bc']
  parsed = optionParser.parse argv
  expected =
    bare: yes
    compile: yes
    arguments: ['some-file.coffee', '-b', '-c']
  sameOptions parsed, expected

test "combined options are not split after a '--'", ->
  argv = ['--', '-bc']
  parsed = optionParser.parse argv
  expected = arguments: ['-bc']
  sameOptions parsed, expected

  argv = ['-bc', '--', '-bc']
  parsed = optionParser.parse argv
  expected =
    bare: yes


Prompt:
return unless require?

{buildCSOptionParser} = require '../lib/coffeescript/command'

optionParser = buildCSOptionParser()

sameOptions = (opts1, opts2, msg) ->
  ownKeys = Object.keys(opts1).sort()
  otherKeys = Object.keys(opts2).sort()
  arrayEq ownKeys, otherKeys, msg
  for k in ownKeys
    arrayEq opts1[k], opts2[k], msg
  yes

test "combined options are still split after initial file name", ->
  argv = ['some-file.coffee', '-bc']
  parsed = optionParser.parse argv
  expected = arguments: ['some-file.coffee', '-b', '-c']
  sameOptions parsed, expected

  argv = ['some-file.litcoffee', '-bc']
  parsed = optionParser.parse argv
  expected = arguments: ['some-file.litcoffee', '-b', '-c']
  sameOptions parsed, expected

Response:
argv = ['-c', 'some-file.coffee', '-bc']
  parsed = optionParser.parse argv
  expected =
    compile: yes
    arguments: ['some-file.coffee', '-b', '-c']
  sameOptions parsed, expected

  argv = ['-bc', 'some-file.coffee', '-bc']
  parsed = optionParser.parse argv
  expected =
    bare: yes
    compile: yes
    arguments: ['some-file.coffee', '-b', '-c']
  sameOptions parsed, expected

test "combined options are not split after a '--'", ->
  argv = ['--', '-bc']
  parsed = optionParser.parse argv
  expected = arguments: ['-bc']
  sameOptions parsed, expected

  argv = ['-bc', '--', '-bc']
  parsed = optionParser.parse argv
  expected =
    bare: yes


Response:
compile: yes
    arguments: ['-bc']
  sameOptions parsed, expected

test "options are not split after any '--'", ->
  argv = ['--', '--', '-bc']
  parsed = optionParser.parse argv
  expected = arguments: ['--', '-bc']
  sameOptions parsed, expected

  argv = ['--', 'some-file.coffee', '--', 'arg']
  parsed = optionParser.parse argv
  expected = arguments: ['some-file.coffee', '--', 'arg']
  sameOptions parsed, expected

  argv = ['--', 'arg', 'some-file.coffee', '--', '-bc']
  parsed = optionParser.parse argv
  expected = arguments: ['arg', 'some-file.coffee', '--', '-bc']
  sameOptions parsed, expected

test "later '--' are removed", ->
  argv = ['some-file.coffee', '--', '-bc']
  parsed = optionParser.parse argv
  expected = arguments: ['some-file.coffee', '-bc']
  sameOptions parsed, expected


Prompt:
compile: yes
    arguments: ['-bc']
  sameOptions parsed, expected

test "options are not split after any '--'", ->
  argv = ['--', '--', '-bc']
  parsed = optionParser.parse argv
  expected = arguments: ['--', '-bc']
  sameOptions parsed, expected

  argv = ['--', 'some-file.coffee', '--', 'arg']
  parsed = optionParser.parse argv

Response:
expected = arguments: ['some-file.coffee', '--', 'arg']
  sameOptions parsed, expected

  argv = ['--', 'arg', 'some-file.coffee', '--', '-bc']
  parsed = optionParser.parse argv
  expected = arguments: ['arg', 'some-file.coffee', '--', '-bc']
  sameOptions parsed, expected

test "later '--' are removed", ->
  argv = ['some-file.coffee', '--', '-bc']
  parsed = optionParser.parse argv
  expected = arguments: ['some-file.coffee', '-bc']
  sameOptions parsed, expected


Response:
return unless require?
{buildCSOptionParser} = require '../lib/coffeescript/command'

optionParser = buildCSOptionParser()

sameOptions = (opts1, opts2, msg) ->
  ownKeys = Object.keys(opts1).sort()
  otherKeys = Object.keys(opts2).sort()
  arrayEq ownKeys, otherKeys, msg
  for k in ownKeys
    arrayEq opts1[k], opts2[k], msg
  yes

test "combined options are still split after initial file name", ->
  argv = ['some-file.coffee', '-bc']
  parsed = optionParser.parse argv
  expected = arguments: ['some-file.coffee', '-b', '-c']
  sameOptions parsed, expected

  argv = ['some-file.litcoffee', '-bc']
  parsed = optionParser.parse argv
  expected = arguments: ['some-file.litcoffee', '-b', '-c']
  sameOptions parsed, expected

  argv = ['-c', 'some-file.coffee', '-bc']
  parsed = optionParser.parse argv
  expected =
    compile: yes
    arguments: ['some-file.coffee', '-b', '-c']
  sameOptions parsed, expected

  argv = ['-bc', 'some-file.coffee', '-bc']
  parsed = optionParser.parse argv
  expected =
    bare: yes
    compile: yes
    arguments: ['some-file.coffee', '-b', '-c']
  sameOptions parsed, expected

test "combined options are not split after a '--'", ->
  argv = ['--', '-bc']
  parsed = optionParser.parse argv
  expected = arguments: ['-bc']
  sameOptions parsed, expected

  argv = ['-bc', '--', '-bc']
  parsed = optionParser.parse argv
  expected =
    bare: yes
    compile: yes


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
return unless require?
{buildCSOptionParser} = require '../lib/coffeescript/command'

optionParser = buildCSOptionParser()

sameOptions = (opts1, opts2, msg) ->
  ownKeys = Object.keys(opts1).sort()
  otherKeys = Object.keys(opts2).sort()
  arrayEq ownKeys, otherKeys, msg
  for k in ownKeys
    arrayEq opts1[k], opts2[k], msg
  yes

test "combined options are still split after initial file name", ->
  argv = ['some-file.coffee', '-bc']
  parsed = optionParser.parse argv
  expected = arguments: ['some-file.coffee', '-b', '-c']
  sameOptions parsed, expected

  argv = ['some-file.litcoffee', '-bc']
  parsed = optionParser.parse argv
  expected = arguments: ['some-file.litcoffee', '-b', '-c']
  sameOptions parsed, expected

  argv = ['-c', 'some-file.coffee', '-bc']
  parsed = optionParser.parse argv
  expected =
    compile: yes
    arguments: ['some-file.coffee', '-b', '-c']
  sameOptions parsed, expected

  argv = ['-bc', 'some-file.coffee', '-bc']
  parsed = optionParser.parse argv
  expected =
    bare: yes
    compile: yes
    arguments: ['some-file.coffee', '-b', '-c']
  sameOptions parsed, expected

test "combined options are not split after a '--'", ->
  argv = ['--', '-bc']
  parsed = optionParser.parse argv
  expected = arguments: ['-bc']
  sameOptions parsed, expected

  argv = ['-bc', '--', '-bc']
  parsed = optionParser.parse argv
  expected =
    bare: yes
    compile: yes
```

Response:
var buildCSOptionParser, optionParser, sameOptions;

if (typeof require === "undefined" || require === null) {
  return;
}

({buildCSOptionParser} = require('../lib/coffeescript/command'));

optionParser = buildCSOptionParser();

sameOptions = function(opts1, opts2, msg) {
  var i, k, len, otherKeys, ownKeys;
  ownKeys = Object.keys(opts1).sort();
  otherKeys = Object.keys(opts2).sort();
  arrayEq(ownKeys, otherKeys, msg);
  for (i = 0, len = ownKeys.length; i < len; i++) {
    k = ownKeys[i];
    arrayEq(opts1[k], opts2[k], msg);
  }
  return true;
};

test("combined options are still split after initial file name", function() {
  var argv, expected, parsed;
  argv = ['some-file.coffee', '-bc'];
  parsed = optionParser.parse(argv);
  expected = {
    arguments: ['some-file.coffee', '-b', '-c']
  };
  sameOptions(parsed, expected);
  argv = ['some-file.litcoffee', '-bc'];
  parsed = optionParser.parse(argv);
  expected = {
    arguments: ['some-file.litcoffee', '-b', '-c']
  };
  sameOptions(parsed, expected);
  argv = ['-c', 'some-file.coffee', '-bc'];
  parsed = optionParser.parse(argv);
  expected = {
    compile: true,
    arguments: ['some-file.coffee', '-b', '-c']
  };
  sameOptions(parsed, expected);
  argv = ['-bc', 'some-file.coffee', '-bc'];
  parsed = optionParser.parse(argv);
  expected = {
    bare: true,
    compile: true,
    arguments: ['some-file.coffee', '-b', '-c']
  };
  return sameOptions(parsed, expected);
});

test("combined options are not split after a '--'", function() {
  var argv, expected, parsed;
  argv = ['--', '-bc'];
  parsed = optionParser.parse(argv);
  expected = {
    arguments: ['-bc']
  };
  sameOptions(parsed, expected);
  argv = ['-bc', '--', '-bc'];
  parsed = optionParser.parse(argv);
  return expected = {
    bare: true,
    compile: true
  };
});