Response:
onClickAvatar = (e) =>
      e.stopPropagation()
      @onRemoveMember member.get('_id')

    Tooltip key: member.get('_id'), template: member.get('name'),
      span className: 'cell avatar small round', style: styleAvatar,
        if @props.isEditable and not @isUser member.get '_id'
          Icon name: 'remove', onClick: onClickAvatar

  renderMembers: ->
    _memberIds = if @beyondMaxNum() then @props._memberIds[..@props.maxNum - 2] else @props._memberIds

    @props.contacts
      .filter (contact) ->
        _memberIds.includes(contact.get('_id'))
      .map @renderMember

  renderMore: ->
    if @beyondMaxNum()
      Icon name: 'ellipsis', className: 'muted cell more'

  renderPlus: ->
    if @props.isEditable
      Tooltip template: lang.getText('invite-members'),
        span className: 'plus', onClick: @onClickPlus,
          Icon name: 'plus-circle-solid', size: 30

  render: ->
    classMembersRow = cx 'members-row', 'is-editable': @props.isEditable
    div className: classMembersRow,
      @renderPlus()
      @renderMembers()
      @renderMore()
      @renderRosterManagement()


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
onClickAvatar = (e) =>
      e.stopPropagation()
      @onRemoveMember member.get('_id')

    Tooltip key: member.get('_id'), template: member.get('name'),
      span className: 'cell avatar small round', style: styleAvatar,
        if @props.isEditable and not @isUser member.get '_id'
          Icon name: 'remove', onClick: onClickAvatar

  renderMembers: ->
    _memberIds = if @beyondMaxNum() then @props._memberIds[..@props.maxNum - 2] else @props._memberIds

    @props.contacts
      .filter (contact) ->
        _memberIds.includes(contact.get('_id'))
      .map @renderMember

  renderMore: ->
    if @beyondMaxNum()
      Icon name: 'ellipsis', className: 'muted cell more'

  renderPlus: ->
    if @props.isEditable
      Tooltip template: lang.getText('invite-members'),
        span className: 'plus', onClick: @onClickPlus,
          Icon name: 'plus-circle-solid', size: 30

  render: ->
    classMembersRow = cx 'members-row', 'is-editable': @props.isEditable
    div className: classMembersRow,
      @renderPlus()
      @renderMembers()
      @renderMore()
      @renderRosterManagement()
```

Response:
var onClickAvatar;

onClickAvatar = (e) => {
  e.stopPropagation();
  return this.onRemoveMember(member.get('_id'));
};

Tooltip({
  key: member.get('_id'),
  template: member.get('name')
}, span({
  className: 'cell avatar small round',
  style: styleAvatar
}, this.props.isEditable && !this.isUser(member.get('_id')) ? Icon({
  name: 'remove',
  onClick: onClickAvatar
}) : void 0));

({
  renderMembers: function() {
    var _memberIds;
    _memberIds = this.beyondMaxNum() ? this.props._memberIds.slice(0, +(this.props.maxNum - 2) + 1 || 9e9) : this.props._memberIds;
    return this.props.contacts.filter(function(contact) {
      return _memberIds.includes(contact.get('_id'));
    }).map(this.renderMember);
  },
  renderMore: function() {
    if (this.beyondMaxNum()) {
      return Icon({
        name: 'ellipsis',
        className: 'muted cell more'
      });
    }
  },
  renderPlus: function() {
    if (this.props.isEditable) {
      return Tooltip({
        template: lang.getText('invite-members')
      }, span({
        className: 'plus',
        onClick: this.onClickPlus
      }, Icon({
        name: 'plus-circle-solid',
        size: 30
      })));
    }
  },
  render: function() {
    var classMembersRow;
    classMembersRow = cx('members-row', {
      'is-editable': this.props.isEditable
    });
    return div({
      className: classMembersRow
    }, this.renderPlus(), this.renderMembers(), this.renderMore(), this.renderRosterManagement());
  }
});


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

onClickAvatar = (e) => {
  e.stopPropagation();
  return this.onRemoveMember(member.get('_id'));
};

Tooltip({
  key: member.get('_id'),
  template: member.get('name')
}, span({
  className: 'cell avatar small round',
  style: styleAvatar
}, this.props.isEditable && !this.isUser(member.get('_id')) ? Icon({
  name: 'remove',
  onClick: onClickAvatar
}) : void 0));

({
  renderMembers: function() {
    var _memberIds;
    _memberIds = this.beyondMaxNum() ? this.props._memberIds.slice(0, +(this.props.maxNum - 2) + 1 || 9e9) : this.props._memberIds;
    return this.props.contacts.filter(function(contact) {
      return _memberIds.includes(contact.get('_id'));
    }).map(this.renderMember);
  },
  renderMore: function() {
    if (this.beyondMaxNum()) {
      return Icon({
        name: 'ellipsis',
        className: 'muted cell more'
      });
    }
  },
  renderPlus: function() {
    if (this.props.isEditable) {
      return Tooltip({
        template: lang.getText('invite-members')
      }, span({
        className: 'plus',
        onClick: this.onClickPlus
      }, Icon({
        name: 'plus-circle-solid',
        size: 30
      })));
    }
  },
  render: function() {
    var classMembersRow;
    classMembersRow = cx('members-row', {
      'is-editable': this.props.isEditable
    });
    return div({
      className: classMembersRow
    }, this.renderPlus(), this.renderMembers(), this.renderMore(), this.renderRosterManagement());
  }
});
```

Response:
onClickAvatar = (e) =>
      e.stopPropagation()
      @onRemoveMember member.get('_id')

    Tooltip key: member.get('_id'), template: member.get('name'),
      span className: 'cell avatar small round', style: styleAvatar,
        if @props.isEditable and not @isUser member.get '_id'
          Icon name: 'remove', onClick: onClickAvatar

  renderMembers: ->
    _memberIds = if @beyondMaxNum() then @props._memberIds[..@props.maxNum - 2] else @props._memberIds

    @props.contacts
      .filter (contact) ->
        _memberIds.includes(contact.get('_id'))
      .map @renderMember

  renderMore: ->
    if @beyondMaxNum()
      Icon name: 'ellipsis', className: 'muted cell more'

  renderPlus: ->
    if @props.isEditable
      Tooltip template: lang.getText('invite-members'),
        span className: 'plus', onClick: @onClickPlus,
          Icon name: 'plus-circle-solid', size: 30

  render: ->
    classMembersRow = cx 'members-row', 'is-editable': @props.isEditable
    div className: classMembersRow,
      @renderPlus()
      @renderMembers()
      @renderMore()
      @renderRosterManagement()


Prompt:
onClickAvatar = (e) =>
      e.stopPropagation()
      @onRemoveMember member.get('_id')

    Tooltip key: member.get('_id'), template: member.get('name'),
      span className: 'cell avatar small round', style: styleAvatar,
        if @props.isEditable and not @isUser member.get '_id'
          Icon name: 'remove', onClick: onClickAvatar

  renderMembers: ->
    _memberIds = if @beyondMaxNum() then @props._memberIds[..@props.maxNum - 2] else @props._memberIds

    @props.contacts
      .filter (contact) ->
        _memberIds.includes(contact.get('_id'))
      .map @renderMember

Response:
renderMore: ->
    if @beyondMaxNum()
      Icon name: 'ellipsis', className: 'muted cell more'

  renderPlus: ->
    if @props.isEditable
      Tooltip template: lang.getText('invite-members'),
        span className: 'plus', onClick: @onClickPlus,
          Icon name: 'plus-circle-solid', size: 30

  render: ->
    classMembersRow = cx 'members-row', 'is-editable': @props.isEditable
    div className: classMembersRow,
      @renderPlus()
      @renderMembers()
      @renderMore()
      @renderRosterManagement()


Response:
###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
###

describe 'Unit: _.jsExec', ->
    beforeEach ->
        jasmine.addMatchers {
            toBeFunction: ->
                return {
                    compare: (actual) ->
                        return {
                            pass: _.isFunction actual
                        }
                }
        }

    it 'should return undefined if given undefined', ->
        expect(_.jsExec(undefined)).toBeUndefined()

    it 'should return null if given null', ->
        expect(_.jsExec(null)).toBeNull()

    it 'should return a number if given a number', ->
        expect(_.jsExec(99, {})).toBe 99

    it 'should return a boolean if given a boolean', ->
        expect(_.jsExec(true, {})).toBeTrue()


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
###

describe 'Unit: _.jsExec', ->
    beforeEach ->
        jasmine.addMatchers {
            toBeFunction: ->
                return {
                    compare: (actual) ->
                        return {
                            pass: _.isFunction actual
                        }
                }
        }

    it 'should return undefined if given undefined', ->
        expect(_.jsExec(undefined)).toBeUndefined()

    it 'should return null if given null', ->
        expect(_.jsExec(null)).toBeNull()

    it 'should return a number if given a number', ->
        expect(_.jsExec(99, {})).toBe 99

    it 'should return a boolean if given a boolean', ->
        expect(_.jsExec(true, {})).toBeTrue()
```

Response:
/*
 * Copyright (c) 2013-2018 the original author or authors.
 *
 * Licensed under the MIT License (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.opensource.org/licenses/mit-license.php
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific
 * language governing permissions and limitations under the License.
 */
describe('Unit: _.jsExec', function() {
  beforeEach(function() {
    return jasmine.addMatchers({
      toBeFunction: function() {
        return {
          compare: function(actual) {
            return {
              pass: _.isFunction(actual)
            };
          }
        };
      }
    });
  });
  it('should return undefined if given undefined', function() {
    return expect(_.jsExec(void 0)).toBeUndefined();
  });
  it('should return null if given null', function() {
    return expect(_.jsExec(null)).toBeNull();
  });
  it('should return a number if given a number', function() {
    return expect(_.jsExec(99, {})).toBe(99);
  });
  return it('should return a boolean if given a boolean', function() {
    return expect(_.jsExec(true, {})).toBeTrue();
  });
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
/*
 * Copyright (c) 2013-2018 the original author or authors.
 *
 * Licensed under the MIT License (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.opensource.org/licenses/mit-license.php
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific
 * language governing permissions and limitations under the License.
 */
describe('Unit: _.jsExec', function() {
  beforeEach(function() {
    return jasmine.addMatchers({
      toBeFunction: function() {
        return {
          compare: function(actual) {
            return {
              pass: _.isFunction(actual)
            };
          }
        };
      }
    });
  });
  it('should return undefined if given undefined', function() {
    return expect(_.jsExec(void 0)).toBeUndefined();
  });
  it('should return null if given null', function() {
    return expect(_.jsExec(null)).toBeNull();
  });
  it('should return a number if given a number', function() {
    return expect(_.jsExec(99, {})).toBe(99);
  });
  return it('should return a boolean if given a boolean', function() {
    return expect(_.jsExec(true, {})).toBeTrue();
  });
});
```

Response:
###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
###

describe 'Unit: _.jsExec', ->
    beforeEach ->
        jasmine.addMatchers {
            toBeFunction: ->
                return {
                    compare: (actual) ->
                        return {
                            pass: _.isFunction actual
                        }
                }
        }

    it 'should return undefined if given undefined', ->
        expect(_.jsExec(undefined)).toBeUndefined()

    it 'should return null if given null', ->
        expect(_.jsExec(null)).toBeNull()

    it 'should return a number if given a number', ->
        expect(_.jsExec(99, {})).toBe 99

    it 'should return a boolean if given a boolean', ->
        expect(_.jsExec(true, {})).toBeTrue()


Prompt:
###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
###

describe 'Unit: _.jsExec', ->
    beforeEach ->
        jasmine.addMatchers {

Response:
toBeFunction: ->
                return {
                    compare: (actual) ->
                        return {
                            pass: _.isFunction actual
                        }
                }
        }

    it 'should return undefined if given undefined', ->
        expect(_.jsExec(undefined)).toBeUndefined()

    it 'should return null if given null', ->
        expect(_.jsExec(null)).toBeNull()

    it 'should return a number if given a number', ->
        expect(_.jsExec(99, {})).toBe 99

    it 'should return a boolean if given a boolean', ->
        expect(_.jsExec(true, {})).toBeTrue()


Response:
it 'should return empty string if given an empty string', ->
        expect(_.jsExec('', {})).toBeEmptyString()

    it 'should return empty string if given an empty inline JS string', ->
        expect(_.jsExec('hello ${}there', {})).toBe 'hello there'

    it 'should return an unchanged string if no inline JS is found', ->
        expect(_.jsExec('hello there')).toBe 'hello there'

    it 'should perform simple arithmetic', ->
        expect(_.jsExec('The Answer: ${1+1}')).toBe 'The Answer: 2'

    it 'should return booleans', ->
        expect(_.jsExec('The Answer: ${true}')).toBe 'The Answer: true'

    it 'should replace the entire string with a boolean', ->
        expect(_.jsExec('${true}')).toBeTrue()

    it 'should replace the entire string with a number', ->
        expect(_.jsExec('${99.12}')).toBe 99.12

    it 'should replace the entire string with a function', ->
        fn = _.jsExec('${function(){return true;}}')
        expect(_.isFunction(fn)).toBeTrue()
        expect(fn()).toBeTrue()

    it 'should calculate boolean expressions', ->
        expect(_.jsExec('The Answer: ${2+2==4}')).toBe 'The Answer: true'

    it 'should perform string manipulations', ->
        expect(_.jsExec('${"foo" + "bar"}')).toBe 'foobar'

    it 'should allow moment.js expressions', ->
        expect(_.jsExec('${moment.utc([2011, 0, 1, 8]).format("YYYY-MM-DD")}')).toBe '2011-01-01'

    it 'should allow javascript functions', ->
        val = _.jsExec('${function (a) { return a+1; }}')
        expect(val).toBeFunction()

    it 'should allow javascript functions defined as variables', ->
        val = _.jsExec('${fn = function (a) { return a+1; }}')
        expect(val).toBeFunction()
        expect(val(4)).toBe 5


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should return empty string if given an empty string', ->
        expect(_.jsExec('', {})).toBeEmptyString()

    it 'should return empty string if given an empty inline JS string', ->
        expect(_.jsExec('hello ${}there', {})).toBe 'hello there'

    it 'should return an unchanged string if no inline JS is found', ->
        expect(_.jsExec('hello there')).toBe 'hello there'

    it 'should perform simple arithmetic', ->
        expect(_.jsExec('The Answer: ${1+1}')).toBe 'The Answer: 2'

    it 'should return booleans', ->
        expect(_.jsExec('The Answer: ${true}')).toBe 'The Answer: true'

    it 'should replace the entire string with a boolean', ->
        expect(_.jsExec('${true}')).toBeTrue()

    it 'should replace the entire string with a number', ->
        expect(_.jsExec('${99.12}')).toBe 99.12

    it 'should replace the entire string with a function', ->
        fn = _.jsExec('${function(){return true;}}')
        expect(_.isFunction(fn)).toBeTrue()
        expect(fn()).toBeTrue()

    it 'should calculate boolean expressions', ->
        expect(_.jsExec('The Answer: ${2+2==4}')).toBe 'The Answer: true'

    it 'should perform string manipulations', ->
        expect(_.jsExec('${"foo" + "bar"}')).toBe 'foobar'

    it 'should allow moment.js expressions', ->
        expect(_.jsExec('${moment.utc([2011, 0, 1, 8]).format("YYYY-MM-DD")}')).toBe '2011-01-01'

    it 'should allow javascript functions', ->
        val = _.jsExec('${function (a) { return a+1; }}')
        expect(val).toBeFunction()

    it 'should allow javascript functions defined as variables', ->
        val = _.jsExec('${fn = function (a) { return a+1; }}')
        expect(val).toBeFunction()
        expect(val(4)).toBe 5
```

Response:
it('should return empty string if given an empty string', function() {
  return expect(_.jsExec('', {})).toBeEmptyString();
});

it('should return empty string if given an empty inline JS string', function() {
  return expect(_.jsExec('hello ${}there', {})).toBe('hello there');
});

it('should return an unchanged string if no inline JS is found', function() {
  return expect(_.jsExec('hello there')).toBe('hello there');
});

it('should perform simple arithmetic', function() {
  return expect(_.jsExec('The Answer: ${1+1}')).toBe('The Answer: 2');
});

it('should return booleans', function() {
  return expect(_.jsExec('The Answer: ${true}')).toBe('The Answer: true');
});

it('should replace the entire string with a boolean', function() {
  return expect(_.jsExec('${true}')).toBeTrue();
});

it('should replace the entire string with a number', function() {
  return expect(_.jsExec('${99.12}')).toBe(99.12);
});

it('should replace the entire string with a function', function() {
  var fn;
  fn = _.jsExec('${function(){return true;}}');
  expect(_.isFunction(fn)).toBeTrue();
  return expect(fn()).toBeTrue();
});

it('should calculate boolean expressions', function() {
  return expect(_.jsExec('The Answer: ${2+2==4}')).toBe('The Answer: true');
});

it('should perform string manipulations', function() {
  return expect(_.jsExec('${"foo" + "bar"}')).toBe('foobar');
});

it('should allow moment.js expressions', function() {
  return expect(_.jsExec('${moment.utc([2011, 0, 1, 8]).format("YYYY-MM-DD")}')).toBe('2011-01-01');
});

it('should allow javascript functions', function() {
  var val;
  val = _.jsExec('${function (a) { return a+1; }}');
  return expect(val).toBeFunction();
});

it('should allow javascript functions defined as variables', function() {
  var val;
  val = _.jsExec('${fn = function (a) { return a+1; }}');
  expect(val).toBeFunction();
  return expect(val(4)).toBe(5);
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
it('should return empty string if given an empty string', function() {
  return expect(_.jsExec('', {})).toBeEmptyString();
});

it('should return empty string if given an empty inline JS string', function() {
  return expect(_.jsExec('hello ${}there', {})).toBe('hello there');
});

it('should return an unchanged string if no inline JS is found', function() {
  return expect(_.jsExec('hello there')).toBe('hello there');
});

it('should perform simple arithmetic', function() {
  return expect(_.jsExec('The Answer: ${1+1}')).toBe('The Answer: 2');
});

it('should return booleans', function() {
  return expect(_.jsExec('The Answer: ${true}')).toBe('The Answer: true');
});

it('should replace the entire string with a boolean', function() {
  return expect(_.jsExec('${true}')).toBeTrue();
});

it('should replace the entire string with a number', function() {
  return expect(_.jsExec('${99.12}')).toBe(99.12);
});

it('should replace the entire string with a function', function() {
  var fn;
  fn = _.jsExec('${function(){return true;}}');
  expect(_.isFunction(fn)).toBeTrue();
  return expect(fn()).toBeTrue();
});

it('should calculate boolean expressions', function() {
  return expect(_.jsExec('The Answer: ${2+2==4}')).toBe('The Answer: true');
});

it('should perform string manipulations', function() {
  return expect(_.jsExec('${"foo" + "bar"}')).toBe('foobar');
});

it('should allow moment.js expressions', function() {
  return expect(_.jsExec('${moment.utc([2011, 0, 1, 8]).format("YYYY-MM-DD")}')).toBe('2011-01-01');
});

it('should allow javascript functions', function() {
  var val;
  val = _.jsExec('${function (a) { return a+1; }}');
  return expect(val).toBeFunction();
});

it('should allow javascript functions defined as variables', function() {
  var val;
  val = _.jsExec('${fn = function (a) { return a+1; }}');
  expect(val).toBeFunction();
  return expect(val(4)).toBe(5);
});
```

Response:
it 'should return empty string if given an empty string', ->
        expect(_.jsExec('', {})).toBeEmptyString()

    it 'should return empty string if given an empty inline JS string', ->
        expect(_.jsExec('hello ${}there', {})).toBe 'hello there'

    it 'should return an unchanged string if no inline JS is found', ->
        expect(_.jsExec('hello there')).toBe 'hello there'

    it 'should perform simple arithmetic', ->
        expect(_.jsExec('The Answer: ${1+1}')).toBe 'The Answer: 2'

    it 'should return booleans', ->
        expect(_.jsExec('The Answer: ${true}')).toBe 'The Answer: true'

    it 'should replace the entire string with a boolean', ->
        expect(_.jsExec('${true}')).toBeTrue()

    it 'should replace the entire string with a number', ->
        expect(_.jsExec('${99.12}')).toBe 99.12

    it 'should replace the entire string with a function', ->
        fn = _.jsExec('${function(){return true;}}')
        expect(_.isFunction(fn)).toBeTrue()
        expect(fn()).toBeTrue()

    it 'should calculate boolean expressions', ->
        expect(_.jsExec('The Answer: ${2+2==4}')).toBe 'The Answer: true'

    it 'should perform string manipulations', ->
        expect(_.jsExec('${"foo" + "bar"}')).toBe 'foobar'

    it 'should allow moment.js expressions', ->
        expect(_.jsExec('${moment.utc([2011, 0, 1, 8]).format("YYYY-MM-DD")}')).toBe '2011-01-01'

    it 'should allow javascript functions', ->
        val = _.jsExec('${function (a) { return a+1; }}')
        expect(val).toBeFunction()

    it 'should allow javascript functions defined as variables', ->
        val = _.jsExec('${fn = function (a) { return a+1; }}')
        expect(val).toBeFunction()
        expect(val(4)).toBe 5


Prompt:
it 'should return empty string if given an empty string', ->
        expect(_.jsExec('', {})).toBeEmptyString()

    it 'should return empty string if given an empty inline JS string', ->
        expect(_.jsExec('hello ${}there', {})).toBe 'hello there'

    it 'should return an unchanged string if no inline JS is found', ->
        expect(_.jsExec('hello there')).toBe 'hello there'

    it 'should perform simple arithmetic', ->
        expect(_.jsExec('The Answer: ${1+1}')).toBe 'The Answer: 2'

    it 'should return booleans', ->
        expect(_.jsExec('The Answer: ${true}')).toBe 'The Answer: true'

    it 'should replace the entire string with a boolean', ->
        expect(_.jsExec('${true}')).toBeTrue()

    it 'should replace the entire string with a number', ->
        expect(_.jsExec('${99.12}')).toBe 99.12

Response:
it 'should replace the entire string with a function', ->
        fn = _.jsExec('${function(){return true;}}')
        expect(_.isFunction(fn)).toBeTrue()
        expect(fn()).toBeTrue()

    it 'should calculate boolean expressions', ->
        expect(_.jsExec('The Answer: ${2+2==4}')).toBe 'The Answer: true'

    it 'should perform string manipulations', ->
        expect(_.jsExec('${"foo" + "bar"}')).toBe 'foobar'

    it 'should allow moment.js expressions', ->
        expect(_.jsExec('${moment.utc([2011, 0, 1, 8]).format("YYYY-MM-DD")}')).toBe '2011-01-01'

    it 'should allow javascript functions', ->
        val = _.jsExec('${function (a) { return a+1; }}')
        expect(val).toBeFunction()

    it 'should allow javascript functions defined as variables', ->
        val = _.jsExec('${fn = function (a) { return a+1; }}')
        expect(val).toBeFunction()
        expect(val(4)).toBe 5


Response:
LayerInfo = require '../layer_info.coffee'

module.exports = class UnicodeName extends LayerInfo
  @shouldParse: (key) -> key is 'luni'

  parse: ->
    pos = @file.tell()
    @data = @file.readUnicodeString()

    @file.seek pos + @length
    return @


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
LayerInfo = require '../layer_info.coffee'

module.exports = class UnicodeName extends LayerInfo
  @shouldParse: (key) -> key is 'luni'

  parse: ->
    pos = @file.tell()
    @data = @file.readUnicodeString()

    @file.seek pos + @length
    return @
```

Response:
var LayerInfo, UnicodeName;

LayerInfo = require('../layer_info.coffee');

module.exports = UnicodeName = class UnicodeName extends LayerInfo {
  static shouldParse(key) {
    return key === 'luni';
  }

  parse() {
    var pos;
    pos = this.file.tell();
    this.data = this.file.readUnicodeString();
    this.file.seek(pos + this.length);
    return this;
  }

};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var LayerInfo, UnicodeName;

LayerInfo = require('../layer_info.coffee');

module.exports = UnicodeName = class UnicodeName extends LayerInfo {
  static shouldParse(key) {
    return key === 'luni';
  }

  parse() {
    var pos;
    pos = this.file.tell();
    this.data = this.file.readUnicodeString();
    this.file.seek(pos + this.length);
    return this;
  }

};
```

Response:
LayerInfo = require '../layer_info.coffee'

module.exports = class UnicodeName extends LayerInfo
  @shouldParse: (key) -> key is 'luni'

  parse: ->
    pos = @file.tell()
    @data = @file.readUnicodeString()

    @file.seek pos + @length
    return @


Prompt:
LayerInfo = require '../layer_info.coffee'

module.exports = class UnicodeName extends LayerInfo
  @shouldParse: (key) -> key is 'luni'

Response:
parse: ->
    pos = @file.tell()
    @data = @file.readUnicodeString()

    @file.seek pos + @length
    return @


Response:
Authenticator = require '../../src/models/authenticator'
JobManager = require 'meshblu-core-job-manager'
async = require 'async'
redis = require 'fakeredis'
_ = require 'lodash'
uuid = require 'uuid'

describe 'Authenticator', ->
  beforeEach ->
    @redis = redis.createClient uuid.v1()
    @redis = _.bindAll @redis

  beforeEach ->
    @uuid = v1: sinon.stub()
    @sut = new Authenticator {namespace: 'test', timeoutSeconds: 1, client: @redis}, uuid: @uuid
    @jobManager = new JobManager namespace: 'test', client: @redis

  describe '->authenticate', ->
    describe 'when redis replies with true', ->
      beforeEach (done) ->
        @uuid.v1.returns 'some-uuid'

        metadata =
          code: 200

        data =
          authenticated: true

        @jobManager.createResponse responseId: 'some-uuid', metadata: metadata, data: data, done

      beforeEach (done) ->
        @sut.authenticate 'uuid', 'token', (@error, @isAuthenticated) => done()

      it 'should no error', ->
        expect(@error).not.to.exist

      it 'should yield true', ->
        expect(@isAuthenticated).to.be.true

      it 'should have added a request reference to the request queue', (done) ->
        @redis.lindex 'test:request:queue', 0, (error, result) =>
          return done error if error?


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
Authenticator = require '../../src/models/authenticator'
JobManager = require 'meshblu-core-job-manager'
async = require 'async'
redis = require 'fakeredis'
_ = require 'lodash'
uuid = require 'uuid'

describe 'Authenticator', ->
  beforeEach ->
    @redis = redis.createClient uuid.v1()
    @redis = _.bindAll @redis

  beforeEach ->
    @uuid = v1: sinon.stub()
    @sut = new Authenticator {namespace: 'test', timeoutSeconds: 1, client: @redis}, uuid: @uuid
    @jobManager = new JobManager namespace: 'test', client: @redis

  describe '->authenticate', ->
    describe 'when redis replies with true', ->
      beforeEach (done) ->
        @uuid.v1.returns 'some-uuid'

        metadata =
          code: 200

        data =
          authenticated: true

        @jobManager.createResponse responseId: 'some-uuid', metadata: metadata, data: data, done

      beforeEach (done) ->
        @sut.authenticate 'uuid', 'token', (@error, @isAuthenticated) => done()

      it 'should no error', ->
        expect(@error).not.to.exist

      it 'should yield true', ->
        expect(@isAuthenticated).to.be.true

      it 'should have added a request reference to the request queue', (done) ->
        @redis.lindex 'test:request:queue', 0, (error, result) =>
          return done error if error?
```

Response:
var Authenticator, JobManager, _, async, redis, uuid;

Authenticator = require('../../src/models/authenticator');

JobManager = require('meshblu-core-job-manager');

async = require('async');

redis = require('fakeredis');

_ = require('lodash');

uuid = require('uuid');

describe('Authenticator', function() {
  beforeEach(function() {
    this.redis = redis.createClient(uuid.v1());
    return this.redis = _.bindAll(this.redis);
  });
  beforeEach(function() {
    this.uuid = {
      v1: sinon.stub()
    };
    this.sut = new Authenticator({
      namespace: 'test',
      timeoutSeconds: 1,
      client: this.redis
    }, {
      uuid: this.uuid
    });
    return this.jobManager = new JobManager({
      namespace: 'test',
      client: this.redis
    });
  });
  return describe('->authenticate', function() {
    return describe('when redis replies with true', function() {
      beforeEach(function(done) {
        var data, metadata;
        this.uuid.v1.returns('some-uuid');
        metadata = {
          code: 200
        };
        data = {
          authenticated: true
        };
        return this.jobManager.createResponse({
          responseId: 'some-uuid',
          metadata: metadata,
          data: data
        }, done);
      });
      beforeEach(function(done) {
        return this.sut.authenticate('uuid', 'token', (error1, isAuthenticated) => {
          this.error = error1;
          this.isAuthenticated = isAuthenticated;
          return done();
        });
      });
      it('should no error', function() {
        return expect(this.error).not.to.exist;
      });
      it('should yield true', function() {
        return expect(this.isAuthenticated).to.be.true;
      });
      return it('should have added a request reference to the request queue', function(done) {
        return this.redis.lindex('test:request:queue', 0, (error, result) => {
          if (error != null) {
            return done(error);
          }
        });
      });
    });
  });
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var Authenticator, JobManager, _, async, redis, uuid;

Authenticator = require('../../src/models/authenticator');

JobManager = require('meshblu-core-job-manager');

async = require('async');

redis = require('fakeredis');

_ = require('lodash');

uuid = require('uuid');

describe('Authenticator', function() {
  beforeEach(function() {
    this.redis = redis.createClient(uuid.v1());
    return this.redis = _.bindAll(this.redis);
  });
  beforeEach(function() {
    this.uuid = {
      v1: sinon.stub()
    };
    this.sut = new Authenticator({
      namespace: 'test',
      timeoutSeconds: 1,
      client: this.redis
    }, {
      uuid: this.uuid
    });
    return this.jobManager = new JobManager({
      namespace: 'test',
      client: this.redis
    });
  });
  return describe('->authenticate', function() {
    return describe('when redis replies with true', function() {
      beforeEach(function(done) {
        var data, metadata;
        this.uuid.v1.returns('some-uuid');
        metadata = {
          code: 200
        };
        data = {
          authenticated: true
        };
        return this.jobManager.createResponse({
          responseId: 'some-uuid',
          metadata: metadata,
          data: data
        }, done);
      });
      beforeEach(function(done) {
        return this.sut.authenticate('uuid', 'token', (error1, isAuthenticated) => {
          this.error = error1;
          this.isAuthenticated = isAuthenticated;
          return done();
        });
      });
      it('should no error', function() {
        return expect(this.error).not.to.exist;
      });
      it('should yield true', function() {
        return expect(this.isAuthenticated).to.be.true;
      });
      return it('should have added a request reference to the request queue', function(done) {
        return this.redis.lindex('test:request:queue', 0, (error, result) => {
          if (error != null) {
            return done(error);
          }
        });
      });
    });
  });
});
```

Response:
Authenticator = require '../../src/models/authenticator'
JobManager = require 'meshblu-core-job-manager'
async = require 'async'
redis = require 'fakeredis'
_ = require 'lodash'
uuid = require 'uuid'

describe 'Authenticator', ->
  beforeEach ->
    @redis = redis.createClient uuid.v1()
    @redis = _.bindAll @redis

  beforeEach ->
    @uuid = v1: sinon.stub()
    @sut = new Authenticator {namespace: 'test', timeoutSeconds: 1, client: @redis}, uuid: @uuid
    @jobManager = new JobManager namespace: 'test', client: @redis

  describe '->authenticate', ->
    describe 'when redis replies with true', ->
      beforeEach (done) ->
        @uuid.v1.returns 'some-uuid'

        metadata =
          code: 200

        data =
          authenticated: true

        @jobManager.createResponse responseId: 'some-uuid', metadata: metadata, data: data, done

      beforeEach (done) ->
        @sut.authenticate 'uuid', 'token', (@error, @isAuthenticated) => done()

      it 'should no error', ->
        expect(@error).not.to.exist

      it 'should yield true', ->
        expect(@isAuthenticated).to.be.true

      it 'should have added a request reference to the request queue', (done) ->
        @redis.lindex 'test:request:queue', 0, (error, result) =>
          return done error if error?


Prompt:
Authenticator = require '../../src/models/authenticator'
JobManager = require 'meshblu-core-job-manager'
async = require 'async'
redis = require 'fakeredis'
_ = require 'lodash'
uuid = require 'uuid'

describe 'Authenticator', ->
  beforeEach ->
    @redis = redis.createClient uuid.v1()
    @redis = _.bindAll @redis

  beforeEach ->
    @uuid = v1: sinon.stub()
    @sut = new Authenticator {namespace: 'test', timeoutSeconds: 1, client: @redis}, uuid: @uuid
    @jobManager = new JobManager namespace: 'test', client: @redis

  describe '->authenticate', ->
    describe 'when redis replies with true', ->
      beforeEach (done) ->
        @uuid.v1.returns 'some-uuid'

Response:
metadata =
          code: 200

        data =
          authenticated: true

        @jobManager.createResponse responseId: 'some-uuid', metadata: metadata, data: data, done

      beforeEach (done) ->
        @sut.authenticate 'uuid', 'token', (@error, @isAuthenticated) => done()

      it 'should no error', ->
        expect(@error).not.to.exist

      it 'should yield true', ->
        expect(@isAuthenticated).to.be.true

      it 'should have added a request reference to the request queue', (done) ->
        @redis.lindex 'test:request:queue', 0, (error, result) =>
          return done error if error?


Response:
expect(result).to.deep.equal 'test:some-uuid'
          done()

      it 'should have added a request metadata to the request hash set', (done) ->
        @redis.hget 'test:some-uuid', 'request:metadata', (error, metadataStr) =>
          return done error if error?

          metadata = JSON.parse metadataStr

          expect(metadata).to.deep.equal
            auth:
              uuid: "uuid"
              token: "token"
            responseId: "some-uuid"
            jobType: "authenticate"

          done()

    describe 'when the auth worker replies with false', ->
      beforeEach (done) ->
        @uuid.v1.returns 'some-other-uuid'

        metadata =
          code: 200

        data =
          authenticated: false

        @jobManager.createResponse responseId: 'some-other-uuid', metadata: metadata, data: data, done

      beforeEach (done) ->
        @sut.authenticate 'uuid', 'token', (@error, @isAuthenticated) => done()

      it 'should no error', ->
        expect(@error).not.to.exist

      it 'should yield false', ->
        expect(@isAuthenticated).to.be.false

      it 'should have added a job to the request queue', (done) ->
        @redis.lindex 'test:request:queue', 0, (error, requestKey) =>
          return done error if error?
          expect(requestKey).to.deep.equal 'test:some-other-uuid'
          done()


Prompt:
expect(result).to.deep.equal 'test:some-uuid'
          done()

      it 'should have added a request metadata to the request hash set', (done) ->
        @redis.hget 'test:some-uuid', 'request:metadata', (error, metadataStr) =>
          return done error if error?

          metadata = JSON.parse metadataStr

          expect(metadata).to.deep.equal
            auth:
              uuid: "uuid"
              token: "token"
            responseId: "some-uuid"
            jobType: "authenticate"

          done()

    describe 'when the auth worker replies with false', ->
      beforeEach (done) ->
        @uuid.v1.returns 'some-other-uuid'

Response:
metadata =
          code: 200

        data =
          authenticated: false

        @jobManager.createResponse responseId: 'some-other-uuid', metadata: metadata, data: data, done

      beforeEach (done) ->
        @sut.authenticate 'uuid', 'token', (@error, @isAuthenticated) => done()

      it 'should no error', ->
        expect(@error).not.to.exist

      it 'should yield false', ->
        expect(@isAuthenticated).to.be.false

      it 'should have added a job to the request queue', (done) ->
        @redis.lindex 'test:request:queue', 0, (error, requestKey) =>
          return done error if error?
          expect(requestKey).to.deep.equal 'test:some-other-uuid'
          done()


Response:
it 'should have added a request metadata to the request hash set', (done) ->
        @redis.hget 'test:some-other-uuid', 'request:metadata', (error, metadataStr) =>
          return done error if error?

          metadata = JSON.parse metadataStr

          expect(metadata).to.deep.equal
            auth:
              uuid: "uuid"
              token: "token"
            responseId: "some-other-uuid"
            jobType: "authenticate"

          done()

    describe 'when the auth worker replies with an error', ->
      beforeEach (done) ->
        @uuid.v1.returns 'some-uuid'

        metadata =
          code: 500
          status: 'uh oh'

        @jobManager.createResponse responseId: 'some-uuid', metadata: metadata, done

      beforeEach (done) ->
        @sut.authenticate 'uuid', 'token', (@error, @isAuthenticated) => done()

      it 'should error', ->
        expect(@error.code).to.equal 500
        expect(@error.status).to.equal 'uh oh'
        expect(=> throw @error).to.throw '500: uh oh'

    describe 'when the auth worker never replies', ->
      beforeEach (done) ->
        @timeout 3000
        @sut.authenticate 'uuid', 'token', (@error, @isAuthenticated) => done()

      it 'should error', ->
        expect(@isAuthenticated).not.to.exist
        expect(=> throw @error).to.throw 'No response from authenticate worker'


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should have added a request metadata to the request hash set', (done) ->
        @redis.hget 'test:some-other-uuid', 'request:metadata', (error, metadataStr) =>
          return done error if error?

          metadata = JSON.parse metadataStr

          expect(metadata).to.deep.equal
            auth:
              uuid: "uuid"
              token: "token"
            responseId: "some-other-uuid"
            jobType: "authenticate"

          done()

    describe 'when the auth worker replies with an error', ->
      beforeEach (done) ->
        @uuid.v1.returns 'some-uuid'

        metadata =
          code: 500
          status: 'uh oh'

        @jobManager.createResponse responseId: 'some-uuid', metadata: metadata, done

      beforeEach (done) ->
        @sut.authenticate 'uuid', 'token', (@error, @isAuthenticated) => done()

      it 'should error', ->
        expect(@error.code).to.equal 500
        expect(@error.status).to.equal 'uh oh'
        expect(=> throw @error).to.throw '500: uh oh'

    describe 'when the auth worker never replies', ->
      beforeEach (done) ->
        @timeout 3000
        @sut.authenticate 'uuid', 'token', (@error, @isAuthenticated) => done()

      it 'should error', ->
        expect(@isAuthenticated).not.to.exist
        expect(=> throw @error).to.throw 'No response from authenticate worker'
```

Response:
it('should have added a request metadata to the request hash set', function(done) {
  return this.redis.hget('test:some-other-uuid', 'request:metadata', (error, metadataStr) => {
    var metadata;
    if (error != null) {
      return done(error);
    }
    metadata = JSON.parse(metadataStr);
    expect(metadata).to.deep.equal({
      auth: {
        uuid: "uuid",
        token: "token"
      },
      responseId: "some-other-uuid",
      jobType: "authenticate"
    });
    return done();
  });
});

describe('when the auth worker replies with an error', function() {
  beforeEach(function(done) {
    var metadata;
    this.uuid.v1.returns('some-uuid');
    metadata = {
      code: 500,
      status: 'uh oh'
    };
    return this.jobManager.createResponse({
      responseId: 'some-uuid',
      metadata: metadata
    }, done);
  });
  beforeEach(function(done) {
    return this.sut.authenticate('uuid', 'token', (error1, isAuthenticated) => {
      this.error = error1;
      this.isAuthenticated = isAuthenticated;
      return done();
    });
  });
  return it('should error', function() {
    expect(this.error.code).to.equal(500);
    expect(this.error.status).to.equal('uh oh');
    return expect(() => {
      throw this.error;
    }).to.throw('500: uh oh');
  });
});

describe('when the auth worker never replies', function() {
  beforeEach(function(done) {
    this.timeout(3000);
    return this.sut.authenticate('uuid', 'token', (error1, isAuthenticated) => {
      this.error = error1;
      this.isAuthenticated = isAuthenticated;
      return done();
    });
  });
  return it('should error', function() {
    expect(this.isAuthenticated).not.to.exist;
    return expect(() => {
      throw this.error;
    }).to.throw('No response from authenticate worker');
  });
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
it('should have added a request metadata to the request hash set', function(done) {
  return this.redis.hget('test:some-other-uuid', 'request:metadata', (error, metadataStr) => {
    var metadata;
    if (error != null) {
      return done(error);
    }
    metadata = JSON.parse(metadataStr);
    expect(metadata).to.deep.equal({
      auth: {
        uuid: "uuid",
        token: "token"
      },
      responseId: "some-other-uuid",
      jobType: "authenticate"
    });
    return done();
  });
});

describe('when the auth worker replies with an error', function() {
  beforeEach(function(done) {
    var metadata;
    this.uuid.v1.returns('some-uuid');
    metadata = {
      code: 500,
      status: 'uh oh'
    };
    return this.jobManager.createResponse({
      responseId: 'some-uuid',
      metadata: metadata
    }, done);
  });
  beforeEach(function(done) {
    return this.sut.authenticate('uuid', 'token', (error1, isAuthenticated) => {
      this.error = error1;
      this.isAuthenticated = isAuthenticated;
      return done();
    });
  });
  return it('should error', function() {
    expect(this.error.code).to.equal(500);
    expect(this.error.status).to.equal('uh oh');
    return expect(() => {
      throw this.error;
    }).to.throw('500: uh oh');
  });
});

describe('when the auth worker never replies', function() {
  beforeEach(function(done) {
    this.timeout(3000);
    return this.sut.authenticate('uuid', 'token', (error1, isAuthenticated) => {
      this.error = error1;
      this.isAuthenticated = isAuthenticated;
      return done();
    });
  });
  return it('should error', function() {
    expect(this.isAuthenticated).not.to.exist;
    return expect(() => {
      throw this.error;
    }).to.throw('No response from authenticate worker');
  });
});
```

Response:
it 'should have added a request metadata to the request hash set', (done) ->
        @redis.hget 'test:some-other-uuid', 'request:metadata', (error, metadataStr) =>
          return done error if error?

          metadata = JSON.parse metadataStr

          expect(metadata).to.deep.equal
            auth:
              uuid: "uuid"
              token: "token"
            responseId: "some-other-uuid"
            jobType: "authenticate"

          done()

    describe 'when the auth worker replies with an error', ->
      beforeEach (done) ->
        @uuid.v1.returns 'some-uuid'

        metadata =
          code: 500
          status: 'uh oh'

        @jobManager.createResponse responseId: 'some-uuid', metadata: metadata, done

      beforeEach (done) ->
        @sut.authenticate 'uuid', 'token', (@error, @isAuthenticated) => done()

      it 'should error', ->
        expect(@error.code).to.equal 500
        expect(@error.status).to.equal 'uh oh'
        expect(=> throw @error).to.throw '500: uh oh'

    describe 'when the auth worker never replies', ->
      beforeEach (done) ->
        @timeout 3000
        @sut.authenticate 'uuid', 'token', (@error, @isAuthenticated) => done()

      it 'should error', ->
        expect(@isAuthenticated).not.to.exist
        expect(=> throw @error).to.throw 'No response from authenticate worker'


Prompt:
it 'should have added a request metadata to the request hash set', (done) ->
        @redis.hget 'test:some-other-uuid', 'request:metadata', (error, metadataStr) =>
          return done error if error?

          metadata = JSON.parse metadataStr

          expect(metadata).to.deep.equal
            auth:
              uuid: "uuid"
              token: "token"
            responseId: "some-other-uuid"
            jobType: "authenticate"

          done()

    describe 'when the auth worker replies with an error', ->
      beforeEach (done) ->
        @uuid.v1.returns 'some-uuid'

        metadata =

Response:
code: 500
          status: 'uh oh'

        @jobManager.createResponse responseId: 'some-uuid', metadata: metadata, done

      beforeEach (done) ->
        @sut.authenticate 'uuid', 'token', (@error, @isAuthenticated) => done()

      it 'should error', ->
        expect(@error.code).to.equal 500
        expect(@error.status).to.equal 'uh oh'
        expect(=> throw @error).to.throw '500: uh oh'

    describe 'when the auth worker never replies', ->
      beforeEach (done) ->
        @timeout 3000
        @sut.authenticate 'uuid', 'token', (@error, @isAuthenticated) => done()

      it 'should error', ->
        expect(@isAuthenticated).not.to.exist
        expect(=> throw @error).to.throw 'No response from authenticate worker'


Response:
longjohn = require '../lib/longjohn'
assert = require 'assert'

describe 'longjohn', ->
  it 'should work with normal throw', ->
    assert.throws -> throw new Error('foo')

  it 'should work with errors from other modules', (done) ->
    fs = require('fs')

    fs.readFile 'not_there.txt', 'utf8', (err, text) ->
      return done() if err? and err instanceof Error and
      (err.stack is "Error: ENOENT, open 'not_there.txt'" or
       err.stack is "Error: ENOENT, open 'not_there.txt'\n    at Error (native)" or
       err.stack is "Error: ENOENT: no such file or directory, open 'not_there.txt'\n    at Error (native)")
      assert.fail()

  it 'should track frames across setTimeout', (done) ->
    setTimeout ->
      assert.equal(new Error('foobar').stack.split(longjohn.empty_frame).length, 2)
      done()
    , 1

  it 'should work for issue #10', (done) ->
    a = -> b()
    b = ->
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 2);
      done()

    setTimeout(a, 0)

  it 'should work for issue #10-2', (done) ->
    a = -> setTimeout(b, 0)
    b = ->
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 3)
      done()

    setTimeout(a, 0)

  it 'should allow stack size limiting', (done) ->
    longjohn.async_trace_limit = 2


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
longjohn = require '../lib/longjohn'
assert = require 'assert'

describe 'longjohn', ->
  it 'should work with normal throw', ->
    assert.throws -> throw new Error('foo')

  it 'should work with errors from other modules', (done) ->
    fs = require('fs')

    fs.readFile 'not_there.txt', 'utf8', (err, text) ->
      return done() if err? and err instanceof Error and
      (err.stack is "Error: ENOENT, open 'not_there.txt'" or
       err.stack is "Error: ENOENT, open 'not_there.txt'\n    at Error (native)" or
       err.stack is "Error: ENOENT: no such file or directory, open 'not_there.txt'\n    at Error (native)")
      assert.fail()

  it 'should track frames across setTimeout', (done) ->
    setTimeout ->
      assert.equal(new Error('foobar').stack.split(longjohn.empty_frame).length, 2)
      done()
    , 1

  it 'should work for issue #10', (done) ->
    a = -> b()
    b = ->
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 2);
      done()

    setTimeout(a, 0)

  it 'should work for issue #10-2', (done) ->
    a = -> setTimeout(b, 0)
    b = ->
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 3)
      done()

    setTimeout(a, 0)

  it 'should allow stack size limiting', (done) ->
    longjohn.async_trace_limit = 2
```

Response:
var assert, longjohn;

longjohn = require('../lib/longjohn');

assert = require('assert');

describe('longjohn', function() {
  it('should work with normal throw', function() {
    return assert.throws(function() {
      throw new Error('foo');
    });
  });
  it('should work with errors from other modules', function(done) {
    var fs;
    fs = require('fs');
    return fs.readFile('not_there.txt', 'utf8', function(err, text) {
      if ((err != null) && err instanceof Error && (err.stack === "Error: ENOENT, open 'not_there.txt'" || err.stack === "Error: ENOENT, open 'not_there.txt'\n    at Error (native)" || err.stack === "Error: ENOENT: no such file or directory, open 'not_there.txt'\n    at Error (native)")) {
        return done();
      }
      return assert.fail();
    });
  });
  it('should track frames across setTimeout', function(done) {
    return setTimeout(function() {
      assert.equal(new Error('foobar').stack.split(longjohn.empty_frame).length, 2);
      return done();
    }, 1);
  });
  it('should work for issue #10', function(done) {
    var a, b;
    a = function() {
      return b();
    };
    b = function() {
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 2);
      return done();
    };
    return setTimeout(a, 0);
  });
  it('should work for issue #10-2', function(done) {
    var a, b;
    a = function() {
      return setTimeout(b, 0);
    };
    b = function() {
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 3);
      return done();
    };
    return setTimeout(a, 0);
  });
  return it('should allow stack size limiting', function(done) {
    return longjohn.async_trace_limit = 2;
  });
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var assert, longjohn;

longjohn = require('../lib/longjohn');

assert = require('assert');

describe('longjohn', function() {
  it('should work with normal throw', function() {
    return assert.throws(function() {
      throw new Error('foo');
    });
  });
  it('should work with errors from other modules', function(done) {
    var fs;
    fs = require('fs');
    return fs.readFile('not_there.txt', 'utf8', function(err, text) {
      if ((err != null) && err instanceof Error && (err.stack === "Error: ENOENT, open 'not_there.txt'" || err.stack === "Error: ENOENT, open 'not_there.txt'\n    at Error (native)" || err.stack === "Error: ENOENT: no such file or directory, open 'not_there.txt'\n    at Error (native)")) {
        return done();
      }
      return assert.fail();
    });
  });
  it('should track frames across setTimeout', function(done) {
    return setTimeout(function() {
      assert.equal(new Error('foobar').stack.split(longjohn.empty_frame).length, 2);
      return done();
    }, 1);
  });
  it('should work for issue #10', function(done) {
    var a, b;
    a = function() {
      return b();
    };
    b = function() {
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 2);
      return done();
    };
    return setTimeout(a, 0);
  });
  it('should work for issue #10-2', function(done) {
    var a, b;
    a = function() {
      return setTimeout(b, 0);
    };
    b = function() {
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 3);
      return done();
    };
    return setTimeout(a, 0);
  });
  return it('should allow stack size limiting', function(done) {
    return longjohn.async_trace_limit = 2;
  });
});
```

Response:
longjohn = require '../lib/longjohn'
assert = require 'assert'

describe 'longjohn', ->
  it 'should work with normal throw', ->
    assert.throws -> throw new Error('foo')

  it 'should work with errors from other modules', (done) ->
    fs = require('fs')

    fs.readFile 'not_there.txt', 'utf8', (err, text) ->
      return done() if err? and err instanceof Error and
      (err.stack is "Error: ENOENT, open 'not_there.txt'" or
       err.stack is "Error: ENOENT, open 'not_there.txt'\n    at Error (native)" or
       err.stack is "Error: ENOENT: no such file or directory, open 'not_there.txt'\n    at Error (native)")
      assert.fail()

  it 'should track frames across setTimeout', (done) ->
    setTimeout ->
      assert.equal(new Error('foobar').stack.split(longjohn.empty_frame).length, 2)
      done()
    , 1

  it 'should work for issue #10', (done) ->
    a = -> b()
    b = ->
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 2);
      done()

    setTimeout(a, 0)

  it 'should work for issue #10-2', (done) ->
    a = -> setTimeout(b, 0)
    b = ->
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 3)
      done()

    setTimeout(a, 0)

  it 'should allow stack size limiting', (done) ->
    longjohn.async_trace_limit = 2


Prompt:
longjohn = require '../lib/longjohn'
assert = require 'assert'

describe 'longjohn', ->
  it 'should work with normal throw', ->
    assert.throws -> throw new Error('foo')

  it 'should work with errors from other modules', (done) ->
    fs = require('fs')

    fs.readFile 'not_there.txt', 'utf8', (err, text) ->
      return done() if err? and err instanceof Error and
      (err.stack is "Error: ENOENT, open 'not_there.txt'" or
       err.stack is "Error: ENOENT, open 'not_there.txt'\n    at Error (native)" or
       err.stack is "Error: ENOENT: no such file or directory, open 'not_there.txt'\n    at Error (native)")
      assert.fail()

  it 'should track frames across setTimeout', (done) ->
    setTimeout ->
      assert.equal(new Error('foobar').stack.split(longjohn.empty_frame).length, 2)

Response:
done()
    , 1

  it 'should work for issue #10', (done) ->
    a = -> b()
    b = ->
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 2);
      done()

    setTimeout(a, 0)

  it 'should work for issue #10-2', (done) ->
    a = -> setTimeout(b, 0)
    b = ->
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 3)
      done()

    setTimeout(a, 0)

  it 'should allow stack size limiting', (done) ->
    longjohn.async_trace_limit = 2


Response:
counter = 0
    foo = ->
      if ++counter > 3
        assert.equal(new Error('foo').stack.split(longjohn.empty_frame).length, 2)
        return done()
      setTimeout(foo, 1)

    foo()

  it 'should work with on/emit', ->
    {EventEmitter} = require 'events'

    count = 0
    foo = -> ++count

    emitter = new EventEmitter()

    emitter.on('foo', foo)
    emitter.on('foo', foo)
    emitter.on('foo', foo)

    emitter.emit('foo')

    assert.equal(count, 3)

  it 'should work with on/removeListener', ->
    {EventEmitter} = require 'events'

    count = 0
    foo = -> ++count

    emitter = new EventEmitter()

    emitter.on('foo', foo)
    emitter.on('foo', foo)

    emitter.removeListener('foo', foo)

    emitter.emit('foo')


Prompt:
counter = 0
    foo = ->
      if ++counter > 3
        assert.equal(new Error('foo').stack.split(longjohn.empty_frame).length, 2)
        return done()
      setTimeout(foo, 1)

    foo()

  it 'should work with on/emit', ->
    {EventEmitter} = require 'events'

    count = 0
    foo = -> ++count

    emitter = new EventEmitter()

    emitter.on('foo', foo)
    emitter.on('foo', foo)

Response:
emitter.on('foo', foo)

    emitter.emit('foo')

    assert.equal(count, 3)

  it 'should work with on/removeListener', ->
    {EventEmitter} = require 'events'

    count = 0
    foo = -> ++count

    emitter = new EventEmitter()

    emitter.on('foo', foo)
    emitter.on('foo', foo)

    emitter.removeListener('foo', foo)

    emitter.emit('foo')


Response:
assert.equal(count, 1)

  it 'should work with on/removeAllListeners (issue #32)', ->
    {EventEmitter} = require 'events'

    count = 0
    foo = -> ++count

    emitter = new EventEmitter()

    emitter.on('removeListener', foo)
    emitter.on('dummy', foo)

    emitter.removeAllListeners('dummy')

    assert.equal(count, 1)

  it 'should work with once/emit', ->
    {EventEmitter} = require 'events'

    count = 0
    foo = -> ++count

    emitter = new EventEmitter()

    emitter.once('foo', foo)

    emitter.emit('foo')
    emitter.emit('foo')
    emitter.emit('foo')

    assert.equal(count, 1)

  it 'should work with once/removeListener', ->
    {EventEmitter} = require 'events'

    count = 0
    foo = -> ++count

    emitter = new EventEmitter()


Prompt:
assert.equal(count, 1)

  it 'should work with on/removeAllListeners (issue #32)', ->
    {EventEmitter} = require 'events'

    count = 0
    foo = -> ++count

    emitter = new EventEmitter()

    emitter.on('removeListener', foo)
    emitter.on('dummy', foo)

    emitter.removeAllListeners('dummy')

    assert.equal(count, 1)

  it 'should work with once/emit', ->
    {EventEmitter} = require 'events'

Response:
count = 0
    foo = -> ++count

    emitter = new EventEmitter()

    emitter.once('foo', foo)

    emitter.emit('foo')
    emitter.emit('foo')
    emitter.emit('foo')

    assert.equal(count, 1)

  it 'should work with once/removeListener', ->
    {EventEmitter} = require 'events'

    count = 0
    foo = -> ++count

    emitter = new EventEmitter()


Response:
emitter.once('foo', foo)
    emitter.once('foo', foo)

    emitter.removeListener('foo', foo)

    emitter.emit('foo')
    emitter.emit('foo')
    assert.equal(count, 1)

  it 'should work with once/removeAllListeners', ->
    {EventEmitter} = require 'events'

    count = 0
    foo = -> ++count

    emitter = new EventEmitter()

    emitter.once('removeListener', foo)

    emitter.on('dummy', foo)
    emitter.removeAllListeners('dummy')
    emitter.on('dummy', foo)
    emitter.removeAllListeners('dummy')

    assert.equal(count, 1)

  it 'should work with setTimeout', (done) ->
    setTimeout ->
      assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
      done()
    , 1, 1, 2, 3

  it 'should work with setInterval', (done) ->
    interval_id = setInterval ->
      assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
      clearInterval(interval_id)
      done()
    , 1, 1, 2, 3


Prompt:
emitter.once('foo', foo)
    emitter.once('foo', foo)

    emitter.removeListener('foo', foo)

    emitter.emit('foo')
    emitter.emit('foo')
    assert.equal(count, 1)

  it 'should work with once/removeAllListeners', ->
    {EventEmitter} = require 'events'

    count = 0
    foo = -> ++count

    emitter = new EventEmitter()

    emitter.once('removeListener', foo)

Response:
emitter.on('dummy', foo)
    emitter.removeAllListeners('dummy')
    emitter.on('dummy', foo)
    emitter.removeAllListeners('dummy')

    assert.equal(count, 1)

  it 'should work with setTimeout', (done) ->
    setTimeout ->
      assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
      done()
    , 1, 1, 2, 3

  it 'should work with setInterval', (done) ->
    interval_id = setInterval ->
      assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
      clearInterval(interval_id)
      done()
    , 1, 1, 2, 3


Response:
if setImmediate?
    it 'should work with setImmediate', (done) ->
      immediate_id = setImmediate ->
        assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
        clearImmediate(immediate_id)
        done()
      , 1, 2, 3

  it 'once should call overriden on', (done) ->
    Transform = require('stream').Transform

    emitter = new Transform()

    emitter.once('data', () -> )
    emitter.once('end', done)

    emitter.push(null)


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
if setImmediate?
    it 'should work with setImmediate', (done) ->
      immediate_id = setImmediate ->
        assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
        clearImmediate(immediate_id)
        done()
      , 1, 2, 3

  it 'once should call overriden on', (done) ->
    Transform = require('stream').Transform

    emitter = new Transform()

    emitter.once('data', () -> )
    emitter.once('end', done)

    emitter.push(null)
```

Response:
if (typeof setImmediate !== "undefined" && setImmediate !== null) {
  it('should work with setImmediate', function(done) {
    var immediate_id;
    return immediate_id = setImmediate(function() {
      assert.deepEqual(Array.prototype.slice.call(arguments), [1, 2, 3]);
      clearImmediate(immediate_id);
      return done();
    }, 1, 2, 3);
  });
}

it('once should call overriden on', function(done) {
  var Transform, emitter;
  Transform = require('stream').Transform;
  emitter = new Transform();
  emitter.once('data', function() {});
  emitter.once('end', done);
  return emitter.push(null);
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
if (typeof setImmediate !== "undefined" && setImmediate !== null) {
  it('should work with setImmediate', function(done) {
    var immediate_id;
    return immediate_id = setImmediate(function() {
      assert.deepEqual(Array.prototype.slice.call(arguments), [1, 2, 3]);
      clearImmediate(immediate_id);
      return done();
    }, 1, 2, 3);
  });
}

it('once should call overriden on', function(done) {
  var Transform, emitter;
  Transform = require('stream').Transform;
  emitter = new Transform();
  emitter.once('data', function() {});
  emitter.once('end', done);
  return emitter.push(null);
});
```

Response:
if setImmediate?
    it 'should work with setImmediate', (done) ->
      immediate_id = setImmediate ->
        assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
        clearImmediate(immediate_id)
        done()
      , 1, 2, 3

  it 'once should call overriden on', (done) ->
    Transform = require('stream').Transform

    emitter = new Transform()

    emitter.once('data', () -> )
    emitter.once('end', done)

    emitter.push(null)


Prompt:
if setImmediate?
    it 'should work with setImmediate', (done) ->
      immediate_id = setImmediate ->
        assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
        clearImmediate(immediate_id)
        done()
      , 1, 2, 3

Response:
it 'once should call overriden on', (done) ->
    Transform = require('stream').Transform

    emitter = new Transform()

    emitter.once('data', () -> )
    emitter.once('end', done)

    emitter.push(null)


Response:
if setImmediate?
    it 'should work with setImmediate', (done) ->
      immediate_id = setImmediate ->
        assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
        clearImmediate(immediate_id)
        done()
      , 1, 2, 3


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
if setImmediate?
    it 'should work with setImmediate', (done) ->
      immediate_id = setImmediate ->
        assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
        clearImmediate(immediate_id)
        done()
      , 1, 2, 3
```

Response:
if (typeof setImmediate !== "undefined" && setImmediate !== null) {
  it('should work with setImmediate', function(done) {
    var immediate_id;
    return immediate_id = setImmediate(function() {
      assert.deepEqual(Array.prototype.slice.call(arguments), [1, 2, 3]);
      clearImmediate(immediate_id);
      return done();
    }, 1, 2, 3);
  });
}


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
if (typeof setImmediate !== "undefined" && setImmediate !== null) {
  it('should work with setImmediate', function(done) {
    var immediate_id;
    return immediate_id = setImmediate(function() {
      assert.deepEqual(Array.prototype.slice.call(arguments), [1, 2, 3]);
      clearImmediate(immediate_id);
      return done();
    }, 1, 2, 3);
  });
}
```

Response:
if setImmediate?
    it 'should work with setImmediate', (done) ->
      immediate_id = setImmediate ->
        assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
        clearImmediate(immediate_id)
        done()
      , 1, 2, 3


Prompt:
if setImmediate?
    it 'should work with setImmediate', (done) ->
      immediate_id = setImmediate ->

Response:
assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
        clearImmediate(immediate_id)
        done()
      , 1, 2, 3


Response:
longjohn = require '../lib/longjohn'
assert = require 'assert'

describe 'longjohn', ->
  it 'should work with normal throw', ->
    assert.throws -> throw new Error('foo')

  it 'should work with errors from other modules', (done) ->
    fs = require('fs')

    fs.readFile 'not_there.txt', 'utf8', (err, text) ->
      return done() if err? and err instanceof Error and
      (err.stack is "Error: ENOENT, open 'not_there.txt'" or
       err.stack is "Error: ENOENT, open 'not_there.txt'\n    at Error (native)")
      assert.fail()

  it 'should track frames across setTimeout', (done) ->
    setTimeout ->
      assert.equal(new Error('foobar').stack.split(longjohn.empty_frame).length, 2)
      done()
    , 1

  it 'should work for issue #10', (done) ->
    a = -> b()
    b = ->
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 2);
      done()

    setTimeout(a, 0)

  it 'should work for issue #10-2', (done) ->
    a = -> setTimeout(b, 0)
    b = ->
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 3)
      done()

    setTimeout(a, 0)

  it 'should allow stack size limiting', (done) ->
    longjohn.async_trace_limit = 2


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
longjohn = require '../lib/longjohn'
assert = require 'assert'

describe 'longjohn', ->
  it 'should work with normal throw', ->
    assert.throws -> throw new Error('foo')

  it 'should work with errors from other modules', (done) ->
    fs = require('fs')

    fs.readFile 'not_there.txt', 'utf8', (err, text) ->
      return done() if err? and err instanceof Error and
      (err.stack is "Error: ENOENT, open 'not_there.txt'" or
       err.stack is "Error: ENOENT, open 'not_there.txt'\n    at Error (native)")
      assert.fail()

  it 'should track frames across setTimeout', (done) ->
    setTimeout ->
      assert.equal(new Error('foobar').stack.split(longjohn.empty_frame).length, 2)
      done()
    , 1

  it 'should work for issue #10', (done) ->
    a = -> b()
    b = ->
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 2);
      done()

    setTimeout(a, 0)

  it 'should work for issue #10-2', (done) ->
    a = -> setTimeout(b, 0)
    b = ->
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 3)
      done()

    setTimeout(a, 0)

  it 'should allow stack size limiting', (done) ->
    longjohn.async_trace_limit = 2
```

Response:
var assert, longjohn;

longjohn = require('../lib/longjohn');

assert = require('assert');

describe('longjohn', function() {
  it('should work with normal throw', function() {
    return assert.throws(function() {
      throw new Error('foo');
    });
  });
  it('should work with errors from other modules', function(done) {
    var fs;
    fs = require('fs');
    return fs.readFile('not_there.txt', 'utf8', function(err, text) {
      if ((err != null) && err instanceof Error && (err.stack === "Error: ENOENT, open 'not_there.txt'" || err.stack === "Error: ENOENT, open 'not_there.txt'\n    at Error (native)")) {
        return done();
      }
      return assert.fail();
    });
  });
  it('should track frames across setTimeout', function(done) {
    return setTimeout(function() {
      assert.equal(new Error('foobar').stack.split(longjohn.empty_frame).length, 2);
      return done();
    }, 1);
  });
  it('should work for issue #10', function(done) {
    var a, b;
    a = function() {
      return b();
    };
    b = function() {
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 2);
      return done();
    };
    return setTimeout(a, 0);
  });
  it('should work for issue #10-2', function(done) {
    var a, b;
    a = function() {
      return setTimeout(b, 0);
    };
    b = function() {
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 3);
      return done();
    };
    return setTimeout(a, 0);
  });
  return it('should allow stack size limiting', function(done) {
    return longjohn.async_trace_limit = 2;
  });
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var assert, longjohn;

longjohn = require('../lib/longjohn');

assert = require('assert');

describe('longjohn', function() {
  it('should work with normal throw', function() {
    return assert.throws(function() {
      throw new Error('foo');
    });
  });
  it('should work with errors from other modules', function(done) {
    var fs;
    fs = require('fs');
    return fs.readFile('not_there.txt', 'utf8', function(err, text) {
      if ((err != null) && err instanceof Error && (err.stack === "Error: ENOENT, open 'not_there.txt'" || err.stack === "Error: ENOENT, open 'not_there.txt'\n    at Error (native)")) {
        return done();
      }
      return assert.fail();
    });
  });
  it('should track frames across setTimeout', function(done) {
    return setTimeout(function() {
      assert.equal(new Error('foobar').stack.split(longjohn.empty_frame).length, 2);
      return done();
    }, 1);
  });
  it('should work for issue #10', function(done) {
    var a, b;
    a = function() {
      return b();
    };
    b = function() {
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 2);
      return done();
    };
    return setTimeout(a, 0);
  });
  it('should work for issue #10-2', function(done) {
    var a, b;
    a = function() {
      return setTimeout(b, 0);
    };
    b = function() {
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 3);
      return done();
    };
    return setTimeout(a, 0);
  });
  return it('should allow stack size limiting', function(done) {
    return longjohn.async_trace_limit = 2;
  });
});
```

Response:
longjohn = require '../lib/longjohn'
assert = require 'assert'

describe 'longjohn', ->
  it 'should work with normal throw', ->
    assert.throws -> throw new Error('foo')

  it 'should work with errors from other modules', (done) ->
    fs = require('fs')

    fs.readFile 'not_there.txt', 'utf8', (err, text) ->
      return done() if err? and err instanceof Error and
      (err.stack is "Error: ENOENT, open 'not_there.txt'" or
       err.stack is "Error: ENOENT, open 'not_there.txt'\n    at Error (native)")
      assert.fail()

  it 'should track frames across setTimeout', (done) ->
    setTimeout ->
      assert.equal(new Error('foobar').stack.split(longjohn.empty_frame).length, 2)
      done()
    , 1

  it 'should work for issue #10', (done) ->
    a = -> b()
    b = ->
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 2);
      done()

    setTimeout(a, 0)

  it 'should work for issue #10-2', (done) ->
    a = -> setTimeout(b, 0)
    b = ->
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 3)
      done()

    setTimeout(a, 0)

  it 'should allow stack size limiting', (done) ->
    longjohn.async_trace_limit = 2


Prompt:
longjohn = require '../lib/longjohn'
assert = require 'assert'

describe 'longjohn', ->
  it 'should work with normal throw', ->
    assert.throws -> throw new Error('foo')

  it 'should work with errors from other modules', (done) ->
    fs = require('fs')

    fs.readFile 'not_there.txt', 'utf8', (err, text) ->
      return done() if err? and err instanceof Error and
      (err.stack is "Error: ENOENT, open 'not_there.txt'" or
       err.stack is "Error: ENOENT, open 'not_there.txt'\n    at Error (native)")
      assert.fail()

  it 'should track frames across setTimeout', (done) ->
    setTimeout ->
      assert.equal(new Error('foobar').stack.split(longjohn.empty_frame).length, 2)
      done()

Response:
, 1

  it 'should work for issue #10', (done) ->
    a = -> b()
    b = ->
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 2);
      done()

    setTimeout(a, 0)

  it 'should work for issue #10-2', (done) ->
    a = -> setTimeout(b, 0)
    b = ->
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 3)
      done()

    setTimeout(a, 0)

  it 'should allow stack size limiting', (done) ->
    longjohn.async_trace_limit = 2


Response:
counter = 0
    foo = ->
      if ++counter > 3
        assert.equal(new Error('foo').stack.split(longjohn.empty_frame).length, 2)
        return done()
      setTimeout(foo, 1)

    foo()

  it 'should work with on/emit', ->
    {EventEmitter} = require 'events'

    count = 0
    foo = -> ++count

    emitter = new EventEmitter()

    emitter.on('foo', foo)
    emitter.on('foo', foo)
    emitter.on('foo', foo)

    emitter.emit('foo')

    assert.equal(count, 3)

  it 'should work with removeListener', ->
    {EventEmitter} = require 'events'

    count = 0
    foo = -> ++count

    emitter = new EventEmitter()

    emitter.on('foo', foo)
    emitter.on('foo', foo)

    emitter.removeListener('foo', foo)

    emitter.emit('foo')


Prompt:
counter = 0
    foo = ->
      if ++counter > 3
        assert.equal(new Error('foo').stack.split(longjohn.empty_frame).length, 2)
        return done()
      setTimeout(foo, 1)

    foo()

  it 'should work with on/emit', ->
    {EventEmitter} = require 'events'

    count = 0
    foo = -> ++count

    emitter = new EventEmitter()

    emitter.on('foo', foo)
    emitter.on('foo', foo)

Response:
emitter.on('foo', foo)

    emitter.emit('foo')

    assert.equal(count, 3)

  it 'should work with removeListener', ->
    {EventEmitter} = require 'events'

    count = 0
    foo = -> ++count

    emitter = new EventEmitter()

    emitter.on('foo', foo)
    emitter.on('foo', foo)

    emitter.removeListener('foo', foo)

    emitter.emit('foo')


Response:
assert.equal(count, 1)

  it 'should work with removeAllListeners (issue #32)', ->
    {EventEmitter} = require 'events'

    count = 0
    foo = -> ++count

    emitter = new EventEmitter()

    emitter.on('removeListener', foo)
    emitter.on('dummy', foo)

    emitter.removeAllListeners('dummy', foo)

    assert.equal(count, 1)

  it 'should work with setTimeout', (done) ->
    setTimeout ->
      assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
      done()
    , 1, 1, 2, 3

  it 'should work with setInterval', (done) ->
    interval_id = setInterval ->
      assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
      clearInterval(interval_id)
      done()
    , 1, 1, 2, 3

  if setImmediate?
    it 'should work with setImmediate', (done) ->
      immediate_id = setImmediate ->
        assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
        clearImmediate(immediate_id)
        done()
      , 1, 2, 3


Prompt:
assert.equal(count, 1)

  it 'should work with removeAllListeners (issue #32)', ->
    {EventEmitter} = require 'events'

    count = 0
    foo = -> ++count

    emitter = new EventEmitter()

    emitter.on('removeListener', foo)
    emitter.on('dummy', foo)

    emitter.removeAllListeners('dummy', foo)

    assert.equal(count, 1)

  it 'should work with setTimeout', (done) ->

Response:
setTimeout ->
      assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
      done()
    , 1, 1, 2, 3

  it 'should work with setInterval', (done) ->
    interval_id = setInterval ->
      assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
      clearInterval(interval_id)
      done()
    , 1, 1, 2, 3

  if setImmediate?
    it 'should work with setImmediate', (done) ->
      immediate_id = setImmediate ->
        assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
        clearImmediate(immediate_id)
        done()
      , 1, 2, 3


Response:
assert.equal(count, 1)

  it 'should work with setTimeout', (done) ->
    setTimeout ->
      assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
      done()
    , 1, 1, 2, 3

  it 'should work with setInterval', (done) ->
    interval_id = setInterval ->
      assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
      clearInterval(interval_id)
      done()
    , 1, 1, 2, 3

  if setImmediate?
    it 'should work with setImmediate', (done) ->
      immediate_id = setImmediate ->
        assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
        clearImmediate(immediate_id)
        done()
      , 1, 2, 3


Prompt:
assert.equal(count, 1)

  it 'should work with setTimeout', (done) ->
    setTimeout ->
      assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
      done()
    , 1, 1, 2, 3

  it 'should work with setInterval', (done) ->
    interval_id = setInterval ->
      assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])

Response:
clearInterval(interval_id)
      done()
    , 1, 1, 2, 3

  if setImmediate?
    it 'should work with setImmediate', (done) ->
      immediate_id = setImmediate ->
        assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
        clearImmediate(immediate_id)
        done()
      , 1, 2, 3


Response:
longjohn = require '../lib/longjohn'
assert = require 'assert'

describe 'longjohn', ->
  it 'should work with normal throw', ->
    assert.throws -> throw new Error('foo')

  it 'should work with errors from other modules', (done) ->
    fs = require('fs')

    fs.readFile 'not_there.txt', 'utf8', (err, text) ->
      return done() if err? and err instanceof Error and err.stack is "Error: ENOENT, open 'not_there.txt'"
      assert.fail()

  it 'should track frames across setTimeout', (done) ->
    setTimeout ->
      assert.equal(new Error('foobar').stack.split(longjohn.empty_frame).length, 2)
      done()
    , 1

  it 'should work for issue #10', (done) ->
    a = -> b()
    b = ->
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 2);
      done()

    setTimeout(a, 0)

  it 'should work for issue #10-2', (done) ->
    a = -> setTimeout(b, 0)
    b = ->
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 3)
      done()

    setTimeout(a, 0)

  it 'should allow stack size limiting', (done) ->
    longjohn.async_trace_limit = 2

    counter = 0
    foo = ->
      if ++counter > 3
        assert.equal(new Error('foo').stack.split(longjohn.empty_frame).length, 2)
        return done()
      setTimeout(foo, 1)


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
longjohn = require '../lib/longjohn'
assert = require 'assert'

describe 'longjohn', ->
  it 'should work with normal throw', ->
    assert.throws -> throw new Error('foo')

  it 'should work with errors from other modules', (done) ->
    fs = require('fs')

    fs.readFile 'not_there.txt', 'utf8', (err, text) ->
      return done() if err? and err instanceof Error and err.stack is "Error: ENOENT, open 'not_there.txt'"
      assert.fail()

  it 'should track frames across setTimeout', (done) ->
    setTimeout ->
      assert.equal(new Error('foobar').stack.split(longjohn.empty_frame).length, 2)
      done()
    , 1

  it 'should work for issue #10', (done) ->
    a = -> b()
    b = ->
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 2);
      done()

    setTimeout(a, 0)

  it 'should work for issue #10-2', (done) ->
    a = -> setTimeout(b, 0)
    b = ->
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 3)
      done()

    setTimeout(a, 0)

  it 'should allow stack size limiting', (done) ->
    longjohn.async_trace_limit = 2

    counter = 0
    foo = ->
      if ++counter > 3
        assert.equal(new Error('foo').stack.split(longjohn.empty_frame).length, 2)
        return done()
      setTimeout(foo, 1)
```

Response:
var assert, longjohn;

longjohn = require('../lib/longjohn');

assert = require('assert');

describe('longjohn', function() {
  it('should work with normal throw', function() {
    return assert.throws(function() {
      throw new Error('foo');
    });
  });
  it('should work with errors from other modules', function(done) {
    var fs;
    fs = require('fs');
    return fs.readFile('not_there.txt', 'utf8', function(err, text) {
      if ((err != null) && err instanceof Error && err.stack === "Error: ENOENT, open 'not_there.txt'") {
        return done();
      }
      return assert.fail();
    });
  });
  it('should track frames across setTimeout', function(done) {
    return setTimeout(function() {
      assert.equal(new Error('foobar').stack.split(longjohn.empty_frame).length, 2);
      return done();
    }, 1);
  });
  it('should work for issue #10', function(done) {
    var a, b;
    a = function() {
      return b();
    };
    b = function() {
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 2);
      return done();
    };
    return setTimeout(a, 0);
  });
  it('should work for issue #10-2', function(done) {
    var a, b;
    a = function() {
      return setTimeout(b, 0);
    };
    b = function() {
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 3);
      return done();
    };
    return setTimeout(a, 0);
  });
  return it('should allow stack size limiting', function(done) {
    var counter, foo;
    longjohn.async_trace_limit = 2;
    counter = 0;
    return foo = function() {
      if (++counter > 3) {
        assert.equal(new Error('foo').stack.split(longjohn.empty_frame).length, 2);
        return done();
      }
      return setTimeout(foo, 1);
    };
  });
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var assert, longjohn;

longjohn = require('../lib/longjohn');

assert = require('assert');

describe('longjohn', function() {
  it('should work with normal throw', function() {
    return assert.throws(function() {
      throw new Error('foo');
    });
  });
  it('should work with errors from other modules', function(done) {
    var fs;
    fs = require('fs');
    return fs.readFile('not_there.txt', 'utf8', function(err, text) {
      if ((err != null) && err instanceof Error && err.stack === "Error: ENOENT, open 'not_there.txt'") {
        return done();
      }
      return assert.fail();
    });
  });
  it('should track frames across setTimeout', function(done) {
    return setTimeout(function() {
      assert.equal(new Error('foobar').stack.split(longjohn.empty_frame).length, 2);
      return done();
    }, 1);
  });
  it('should work for issue #10', function(done) {
    var a, b;
    a = function() {
      return b();
    };
    b = function() {
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 2);
      return done();
    };
    return setTimeout(a, 0);
  });
  it('should work for issue #10-2', function(done) {
    var a, b;
    a = function() {
      return setTimeout(b, 0);
    };
    b = function() {
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 3);
      return done();
    };
    return setTimeout(a, 0);
  });
  return it('should allow stack size limiting', function(done) {
    var counter, foo;
    longjohn.async_trace_limit = 2;
    counter = 0;
    return foo = function() {
      if (++counter > 3) {
        assert.equal(new Error('foo').stack.split(longjohn.empty_frame).length, 2);
        return done();
      }
      return setTimeout(foo, 1);
    };
  });
});
```

Response:
longjohn = require '../lib/longjohn'
assert = require 'assert'

describe 'longjohn', ->
  it 'should work with normal throw', ->
    assert.throws -> throw new Error('foo')

  it 'should work with errors from other modules', (done) ->
    fs = require('fs')

    fs.readFile 'not_there.txt', 'utf8', (err, text) ->
      return done() if err? and err instanceof Error and err.stack is "Error: ENOENT, open 'not_there.txt'"
      assert.fail()

  it 'should track frames across setTimeout', (done) ->
    setTimeout ->
      assert.equal(new Error('foobar').stack.split(longjohn.empty_frame).length, 2)
      done()
    , 1

  it 'should work for issue #10', (done) ->
    a = -> b()
    b = ->
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 2);
      done()

    setTimeout(a, 0)

  it 'should work for issue #10-2', (done) ->
    a = -> setTimeout(b, 0)
    b = ->
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 3)
      done()

    setTimeout(a, 0)

  it 'should allow stack size limiting', (done) ->
    longjohn.async_trace_limit = 2

    counter = 0
    foo = ->
      if ++counter > 3
        assert.equal(new Error('foo').stack.split(longjohn.empty_frame).length, 2)
        return done()
      setTimeout(foo, 1)


Prompt:
longjohn = require '../lib/longjohn'
assert = require 'assert'

describe 'longjohn', ->
  it 'should work with normal throw', ->
    assert.throws -> throw new Error('foo')

  it 'should work with errors from other modules', (done) ->
    fs = require('fs')

    fs.readFile 'not_there.txt', 'utf8', (err, text) ->
      return done() if err? and err instanceof Error and err.stack is "Error: ENOENT, open 'not_there.txt'"
      assert.fail()

  it 'should track frames across setTimeout', (done) ->
    setTimeout ->
      assert.equal(new Error('foobar').stack.split(longjohn.empty_frame).length, 2)
      done()
    , 1

  it 'should work for issue #10', (done) ->
    a = -> b()

Response:
b = ->
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 2);
      done()

    setTimeout(a, 0)

  it 'should work for issue #10-2', (done) ->
    a = -> setTimeout(b, 0)
    b = ->
      assert.equal(new Error('this is uncaught!').stack.split(longjohn.empty_frame).length, 3)
      done()

    setTimeout(a, 0)

  it 'should allow stack size limiting', (done) ->
    longjohn.async_trace_limit = 2

    counter = 0
    foo = ->
      if ++counter > 3
        assert.equal(new Error('foo').stack.split(longjohn.empty_frame).length, 2)
        return done()
      setTimeout(foo, 1)


Response:
foo()

  it 'should work with on/emit', ->
    {EventEmitter} = require 'events'

    count = 0
    foo = -> ++count

    emitter = new EventEmitter()

    emitter.on('foo', foo)
    emitter.on('foo', foo)
    emitter.on('foo', foo)

    emitter.emit('foo')

    assert.equal(count, 3)

  it 'should work with removeListener', ->
    {EventEmitter} = require 'events'

    count = 0
    foo = -> ++count

    emitter = new EventEmitter()

    emitter.on('foo', foo)
    emitter.on('foo', foo)

    emitter.removeListener('foo', foo)

    emitter.emit('foo')

    assert.equal(count, 1)

  it 'should work with setTimeout', (done) ->
    setTimeout ->
      assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
      done()
    , 1, 1, 2, 3


Prompt:
foo()

  it 'should work with on/emit', ->
    {EventEmitter} = require 'events'

    count = 0
    foo = -> ++count

    emitter = new EventEmitter()

    emitter.on('foo', foo)
    emitter.on('foo', foo)
    emitter.on('foo', foo)

    emitter.emit('foo')

    assert.equal(count, 3)

  it 'should work with removeListener', ->
    {EventEmitter} = require 'events'

Response:
count = 0
    foo = -> ++count

    emitter = new EventEmitter()

    emitter.on('foo', foo)
    emitter.on('foo', foo)

    emitter.removeListener('foo', foo)

    emitter.emit('foo')

    assert.equal(count, 1)

  it 'should work with setTimeout', (done) ->
    setTimeout ->
      assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
      done()
    , 1, 1, 2, 3


Response:
it 'should work with setInterval', (done) ->
    interval_id = setInterval ->
      assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
      clearInterval(interval_id)
      done()
    , 1, 1, 2, 3

  if setImmediate?
    it 'should work with setImmediate', (done) ->
      immediate_id = setImmediate ->
        assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
        clearImmediate(immediate_id)
        done()
      , 1, 2, 3


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should work with setInterval', (done) ->
    interval_id = setInterval ->
      assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
      clearInterval(interval_id)
      done()
    , 1, 1, 2, 3

  if setImmediate?
    it 'should work with setImmediate', (done) ->
      immediate_id = setImmediate ->
        assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
        clearImmediate(immediate_id)
        done()
      , 1, 2, 3
```

Response:
it('should work with setInterval', function(done) {
  var interval_id;
  return interval_id = setInterval(function() {
    assert.deepEqual(Array.prototype.slice.call(arguments), [1, 2, 3]);
    clearInterval(interval_id);
    return done();
  }, 1, 1, 2, 3);
});

if (typeof setImmediate !== "undefined" && setImmediate !== null) {
  it('should work with setImmediate', function(done) {
    var immediate_id;
    return immediate_id = setImmediate(function() {
      assert.deepEqual(Array.prototype.slice.call(arguments), [1, 2, 3]);
      clearImmediate(immediate_id);
      return done();
    }, 1, 2, 3);
  });
}


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
it('should work with setInterval', function(done) {
  var interval_id;
  return interval_id = setInterval(function() {
    assert.deepEqual(Array.prototype.slice.call(arguments), [1, 2, 3]);
    clearInterval(interval_id);
    return done();
  }, 1, 1, 2, 3);
});

if (typeof setImmediate !== "undefined" && setImmediate !== null) {
  it('should work with setImmediate', function(done) {
    var immediate_id;
    return immediate_id = setImmediate(function() {
      assert.deepEqual(Array.prototype.slice.call(arguments), [1, 2, 3]);
      clearImmediate(immediate_id);
      return done();
    }, 1, 2, 3);
  });
}
```

Response:
it 'should work with setInterval', (done) ->
    interval_id = setInterval ->
      assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
      clearInterval(interval_id)
      done()
    , 1, 1, 2, 3

  if setImmediate?
    it 'should work with setImmediate', (done) ->
      immediate_id = setImmediate ->
        assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
        clearImmediate(immediate_id)
        done()
      , 1, 2, 3


Prompt:
it 'should work with setInterval', (done) ->
    interval_id = setInterval ->
      assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
      clearInterval(interval_id)
      done()
    , 1, 1, 2, 3

Response:
if setImmediate?
    it 'should work with setImmediate', (done) ->
      immediate_id = setImmediate ->
        assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
        clearImmediate(immediate_id)
        done()
      , 1, 2, 3


Response:
it 'should work with setInterval', (done) ->
    interval_id = setInterval ->
      assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
      clearInterval(interval_id)
      done()
    , 1, 1, 2, 3

  it 'should work with setImmediate', (done) ->
    immediate_id = setImmediate ->
      assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
      clearImmediate(immediate_id)
      done()
    , 1, 2, 3


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should work with setInterval', (done) ->
    interval_id = setInterval ->
      assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
      clearInterval(interval_id)
      done()
    , 1, 1, 2, 3

  it 'should work with setImmediate', (done) ->
    immediate_id = setImmediate ->
      assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
      clearImmediate(immediate_id)
      done()
    , 1, 2, 3
```

Response:
it('should work with setInterval', function(done) {
  var interval_id;
  return interval_id = setInterval(function() {
    assert.deepEqual(Array.prototype.slice.call(arguments), [1, 2, 3]);
    clearInterval(interval_id);
    return done();
  }, 1, 1, 2, 3);
});

it('should work with setImmediate', function(done) {
  var immediate_id;
  return immediate_id = setImmediate(function() {
    assert.deepEqual(Array.prototype.slice.call(arguments), [1, 2, 3]);
    clearImmediate(immediate_id);
    return done();
  }, 1, 2, 3);
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
it('should work with setInterval', function(done) {
  var interval_id;
  return interval_id = setInterval(function() {
    assert.deepEqual(Array.prototype.slice.call(arguments), [1, 2, 3]);
    clearInterval(interval_id);
    return done();
  }, 1, 1, 2, 3);
});

it('should work with setImmediate', function(done) {
  var immediate_id;
  return immediate_id = setImmediate(function() {
    assert.deepEqual(Array.prototype.slice.call(arguments), [1, 2, 3]);
    clearImmediate(immediate_id);
    return done();
  }, 1, 2, 3);
});
```

Response:
it 'should work with setInterval', (done) ->
    interval_id = setInterval ->
      assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
      clearInterval(interval_id)
      done()
    , 1, 1, 2, 3

  it 'should work with setImmediate', (done) ->
    immediate_id = setImmediate ->
      assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
      clearImmediate(immediate_id)
      done()
    , 1, 2, 3


Prompt:
it 'should work with setInterval', (done) ->
    interval_id = setInterval ->
      assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
      clearInterval(interval_id)
      done()
    , 1, 1, 2, 3

Response:
it 'should work with setImmediate', (done) ->
    immediate_id = setImmediate ->
      assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
      clearImmediate(immediate_id)
      done()
    , 1, 2, 3


Response:
it 'should work with setInterval', (done) ->
    interval_id = setInterval ->
      assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
      clearInterval(interval_id)
      done()
    , 1, 1, 2, 3


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should work with setInterval', (done) ->
    interval_id = setInterval ->
      assert.deepEqual(Array::slice.call(arguments), [1, 2, 3])
      clearInterval(interval_id)
      done()
    , 1, 1, 2, 3
```

Response:
it('should work with setInterval', function(done) {
  var interval_id;
  return interval_id = setInterval(function() {
    assert.deepEqual(Array.prototype.slice.call(arguments), [1, 2, 3]);
    clearInterval(interval_id);
    return done();
  }, 1, 1, 2, 3);
});