Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var Command, Variable;

Command = require('./Command');

Variable = (function() {
  class Variable extends Command {
    log() {}

    unlog() {}

    constructor() {}

    before(args, engine, operation, continuation, scope, ascender, ascending) {
      var ref, value;
      if ((value = ascending != null ? (ref = ascending.values) != null ? ref[args[0]] : void 0 : void 0) != null) {
        return value;
      }
    }

    // Declare variable within domain, initial value is zero
    declare(engine, name) {
      var variable, variables;
      variables = engine.variables;
      if (!(variable = variables[name])) {
        variable = variables[name] = engine.variable(name);
      }
      //if engine.nullified?[name]
      //  delete engine.nullified[name]
      //if engine.replaced?[name]
      //  delete engine.replaced[name]
      (engine.declared || (engine.declared = {}))[name] = variable;
      return variable;
    }

    // Undeclare variable in given domain, outputs "null" once
    undeclare(engine, variable, quick) {
      var ref;
      if (quick) {
        (engine.replaced || (engine.replaced = {}))[variable.name] = variable;
      } else {
        (engine.nullified || (engine.nullified = {}))[variable.name] = variable;
        if ((ref = engine.declared) != null ? ref[variable.name] : void 0) {
          delete engine.declared[variable.name];
        }
      }
      delete engine.values[variable.name];
      engine.nullify(variable);
      return engine.unedit(variable);
    }

  };

  Variable.prototype.type = 'Variable';

  Variable.prototype.signature = [
    {
      property: ['String']
    }
  ];

  return Variable;

}).call(this);

Variable.Expression = (function() {
  // Algebraic expression
  class Expression extends Variable {};

  Expression.prototype.signature = [
    {
      left: ['Variable',
    'Number'],
      right: ['Variable',
    'Number']
    }
  ];

  return Expression;

}).call(this);
```

Response:
Command = require('./Command')

class Variable extends Command
  type: 'Variable'

  signature: [
    property: ['String']
  ]

  log: ->
  unlog: ->

  constructor: ->

  before: (args, engine, operation, continuation, scope, ascender, ascending) ->
    if (value = ascending?.values?[args[0]])?
      return value

  # Declare variable within domain, initial value is zero
  declare: (engine, name) ->
    variables = engine.variables
    unless variable = variables[name]
      variable = variables[name] = engine.variable(name)
    #if engine.nullified?[name]
    #  delete engine.nullified[name]
    #if engine.replaced?[name]
    #  delete engine.replaced[name]
    (engine.declared ||= {})[name] = variable
    return variable

  # Undeclare variable in given domain, outputs "null" once
  undeclare: (engine, variable, quick) ->
    if quick
      (engine.replaced ||= {})[variable.name] = variable
    else
      (engine.nullified ||= {})[variable.name] = variable
      if engine.declared?[variable.name]
        delete engine.declared[variable.name]

    delete engine.values[variable.name]
    engine.nullify(variable)
    engine.unedit(variable)

# Algebraic expression
class Variable.Expression extends Variable

  signature: [
    left:  ['Variable', 'Number']
    right: ['Variable', 'Number']
  ]


Prompt:
Command = require('./Command')

class Variable extends Command
  type: 'Variable'

  signature: [
    property: ['String']
  ]

  log: ->
  unlog: ->

  constructor: ->

  before: (args, engine, operation, continuation, scope, ascender, ascending) ->
    if (value = ascending?.values?[args[0]])?
      return value

  # Declare variable within domain, initial value is zero
  declare: (engine, name) ->
    variables = engine.variables
    unless variable = variables[name]
      variable = variables[name] = engine.variable(name)
    #if engine.nullified?[name]
    #  delete engine.nullified[name]

Response:
#if engine.replaced?[name]
    #  delete engine.replaced[name]
    (engine.declared ||= {})[name] = variable
    return variable

  # Undeclare variable in given domain, outputs "null" once
  undeclare: (engine, variable, quick) ->
    if quick
      (engine.replaced ||= {})[variable.name] = variable
    else
      (engine.nullified ||= {})[variable.name] = variable
      if engine.declared?[variable.name]
        delete engine.declared[variable.name]

    delete engine.values[variable.name]
    engine.nullify(variable)
    engine.unedit(variable)

# Algebraic expression
class Variable.Expression extends Variable

  signature: [
    left:  ['Variable', 'Number']
    right: ['Variable', 'Number']
  ]


Response:
Variable.Expression.algebra =
  '+': (left, right) ->
    return left + right

  '-': (left, right) ->
    return left - right

  '*': (left, right) ->
    return left * right

  '/': (left, right) ->
    return left / right

module.exports = Variable


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
Variable.Expression.algebra =
  '+': (left, right) ->
    return left + right

  '-': (left, right) ->
    return left - right

  '*': (left, right) ->
    return left * right

  '/': (left, right) ->
    return left / right

module.exports = Variable
```

Response:
Variable.Expression.algebra = {
  '+': function(left, right) {
    return left + right;
  },
  '-': function(left, right) {
    return left - right;
  },
  '*': function(left, right) {
    return left * right;
  },
  '/': function(left, right) {
    return left / right;
  }
};

module.exports = Variable;


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
Variable.Expression.algebra = {
  '+': function(left, right) {
    return left + right;
  },
  '-': function(left, right) {
    return left - right;
  },
  '*': function(left, right) {
    return left * right;
  },
  '/': function(left, right) {
    return left / right;
  }
};

module.exports = Variable;
```

Response:
Variable.Expression.algebra =
  '+': (left, right) ->
    return left + right

  '-': (left, right) ->
    return left - right

  '*': (left, right) ->
    return left * right

  '/': (left, right) ->
    return left / right

module.exports = Variable


Prompt:
Variable.Expression.algebra =
  '+': (left, right) ->
    return left + right

  '-': (left, right) ->
    return left - right

Response:
'*': (left, right) ->
    return left * right

  '/': (left, right) ->
    return left / right

module.exports = Variable


Response:
Command = require('./Command')

class Variable extends Command
  type: 'Variable'

  signature: [
    property: ['String']
  ]

  log: ->

  constructor: ->

  before: (args, engine, operation, continuation, scope, ascender, ascending) ->
    if (value = ascending?.values?[args[0]])?
      return value

  # Declare variable within domain, initial value is zero
  declare: (engine, name) ->
    variables = engine.variables
    unless variable = variables[name]
      variable = variables[name] = engine.variable(name)
    #if engine.nullified?[name]
    #  delete engine.nullified[name]
    #if engine.replaced?[name]
    #  delete engine.replaced[name]
    (engine.declared ||= {})[name] = variable
    return variable

  # Undeclare variable in given domain, outputs "null" once
  undeclare: (engine, variable, quick) ->
    if quick
      (engine.replaced ||= {})[variable.name] = variable
    else
      (engine.nullified ||= {})[variable.name] = variable
      if engine.declared?[variable.name]
        delete engine.declared[variable.name]

    delete engine.values[variable.name]
    engine.nullify(variable)
    engine.unedit(variable)

# Algebraic expression
class Variable.Expression extends Variable

  signature: [
    left:  ['Variable', 'Number']
    right: ['Variable', 'Number']
  ]


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
Command = require('./Command')

class Variable extends Command
  type: 'Variable'

  signature: [
    property: ['String']
  ]

  log: ->

  constructor: ->

  before: (args, engine, operation, continuation, scope, ascender, ascending) ->
    if (value = ascending?.values?[args[0]])?
      return value

  # Declare variable within domain, initial value is zero
  declare: (engine, name) ->
    variables = engine.variables
    unless variable = variables[name]
      variable = variables[name] = engine.variable(name)
    #if engine.nullified?[name]
    #  delete engine.nullified[name]
    #if engine.replaced?[name]
    #  delete engine.replaced[name]
    (engine.declared ||= {})[name] = variable
    return variable

  # Undeclare variable in given domain, outputs "null" once
  undeclare: (engine, variable, quick) ->
    if quick
      (engine.replaced ||= {})[variable.name] = variable
    else
      (engine.nullified ||= {})[variable.name] = variable
      if engine.declared?[variable.name]
        delete engine.declared[variable.name]

    delete engine.values[variable.name]
    engine.nullify(variable)
    engine.unedit(variable)

# Algebraic expression
class Variable.Expression extends Variable

  signature: [
    left:  ['Variable', 'Number']
    right: ['Variable', 'Number']
  ]
```

Response:
var Command, Variable;

Command = require('./Command');

Variable = (function() {
  class Variable extends Command {
    log() {}

    constructor() {}

    before(args, engine, operation, continuation, scope, ascender, ascending) {
      var ref, value;
      if ((value = ascending != null ? (ref = ascending.values) != null ? ref[args[0]] : void 0 : void 0) != null) {
        return value;
      }
    }

    // Declare variable within domain, initial value is zero
    declare(engine, name) {
      var variable, variables;
      variables = engine.variables;
      if (!(variable = variables[name])) {
        variable = variables[name] = engine.variable(name);
      }
      //if engine.nullified?[name]
      //  delete engine.nullified[name]
      //if engine.replaced?[name]
      //  delete engine.replaced[name]
      (engine.declared || (engine.declared = {}))[name] = variable;
      return variable;
    }

    // Undeclare variable in given domain, outputs "null" once
    undeclare(engine, variable, quick) {
      var ref;
      if (quick) {
        (engine.replaced || (engine.replaced = {}))[variable.name] = variable;
      } else {
        (engine.nullified || (engine.nullified = {}))[variable.name] = variable;
        if ((ref = engine.declared) != null ? ref[variable.name] : void 0) {
          delete engine.declared[variable.name];
        }
      }
      delete engine.values[variable.name];
      engine.nullify(variable);
      return engine.unedit(variable);
    }

  };

  Variable.prototype.type = 'Variable';

  Variable.prototype.signature = [
    {
      property: ['String']
    }
  ];

  return Variable;

}).call(this);

Variable.Expression = (function() {
  // Algebraic expression
  class Expression extends Variable {};

  Expression.prototype.signature = [
    {
      left: ['Variable',
    'Number'],
      right: ['Variable',
    'Number']
    }
  ];

  return Expression;

}).call(this);


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var Command, Variable;

Command = require('./Command');

Variable = (function() {
  class Variable extends Command {
    log() {}

    constructor() {}

    before(args, engine, operation, continuation, scope, ascender, ascending) {
      var ref, value;
      if ((value = ascending != null ? (ref = ascending.values) != null ? ref[args[0]] : void 0 : void 0) != null) {
        return value;
      }
    }

    // Declare variable within domain, initial value is zero
    declare(engine, name) {
      var variable, variables;
      variables = engine.variables;
      if (!(variable = variables[name])) {
        variable = variables[name] = engine.variable(name);
      }
      //if engine.nullified?[name]
      //  delete engine.nullified[name]
      //if engine.replaced?[name]
      //  delete engine.replaced[name]
      (engine.declared || (engine.declared = {}))[name] = variable;
      return variable;
    }

    // Undeclare variable in given domain, outputs "null" once
    undeclare(engine, variable, quick) {
      var ref;
      if (quick) {
        (engine.replaced || (engine.replaced = {}))[variable.name] = variable;
      } else {
        (engine.nullified || (engine.nullified = {}))[variable.name] = variable;
        if ((ref = engine.declared) != null ? ref[variable.name] : void 0) {
          delete engine.declared[variable.name];
        }
      }
      delete engine.values[variable.name];
      engine.nullify(variable);
      return engine.unedit(variable);
    }

  };

  Variable.prototype.type = 'Variable';

  Variable.prototype.signature = [
    {
      property: ['String']
    }
  ];

  return Variable;

}).call(this);

Variable.Expression = (function() {
  // Algebraic expression
  class Expression extends Variable {};

  Expression.prototype.signature = [
    {
      left: ['Variable',
    'Number'],
      right: ['Variable',
    'Number']
    }
  ];

  return Expression;

}).call(this);
```

Response:
Command = require('./Command')

class Variable extends Command
  type: 'Variable'

  signature: [
    property: ['String']
  ]

  log: ->

  constructor: ->

  before: (args, engine, operation, continuation, scope, ascender, ascending) ->
    if (value = ascending?.values?[args[0]])?
      return value

  # Declare variable within domain, initial value is zero
  declare: (engine, name) ->
    variables = engine.variables
    unless variable = variables[name]
      variable = variables[name] = engine.variable(name)
    #if engine.nullified?[name]
    #  delete engine.nullified[name]
    #if engine.replaced?[name]
    #  delete engine.replaced[name]
    (engine.declared ||= {})[name] = variable
    return variable

  # Undeclare variable in given domain, outputs "null" once
  undeclare: (engine, variable, quick) ->
    if quick
      (engine.replaced ||= {})[variable.name] = variable
    else
      (engine.nullified ||= {})[variable.name] = variable
      if engine.declared?[variable.name]
        delete engine.declared[variable.name]

    delete engine.values[variable.name]
    engine.nullify(variable)
    engine.unedit(variable)

# Algebraic expression
class Variable.Expression extends Variable

  signature: [
    left:  ['Variable', 'Number']
    right: ['Variable', 'Number']
  ]


Prompt:
Command = require('./Command')

class Variable extends Command
  type: 'Variable'

  signature: [
    property: ['String']
  ]

  log: ->

  constructor: ->

  before: (args, engine, operation, continuation, scope, ascender, ascending) ->
    if (value = ascending?.values?[args[0]])?
      return value

  # Declare variable within domain, initial value is zero
  declare: (engine, name) ->
    variables = engine.variables
    unless variable = variables[name]
      variable = variables[name] = engine.variable(name)
    #if engine.nullified?[name]
    #  delete engine.nullified[name]

Response:
#if engine.replaced?[name]
    #  delete engine.replaced[name]
    (engine.declared ||= {})[name] = variable
    return variable

  # Undeclare variable in given domain, outputs "null" once
  undeclare: (engine, variable, quick) ->
    if quick
      (engine.replaced ||= {})[variable.name] = variable
    else
      (engine.nullified ||= {})[variable.name] = variable
      if engine.declared?[variable.name]
        delete engine.declared[variable.name]

    delete engine.values[variable.name]
    engine.nullify(variable)
    engine.unedit(variable)

# Algebraic expression
class Variable.Expression extends Variable

  signature: [
    left:  ['Variable', 'Number']
    right: ['Variable', 'Number']
  ]


Response:
Command = require('./Command')

class Variable extends Command
  type: 'Variable'

  signature: [
    property: ['String']
  ]

  constructor: ->

  before: (args, engine, operation, continuation, scope, ascender, ascending) ->
    if (value = ascending?.values?[args[0]])?
      return value

  # Declare variable within domain, initial value is zero
  declare: (engine, name) ->
    variables = engine.variables
    unless variable = variables[name]
      variable = variables[name] = engine.variable(name)
    #if engine.nullified?[name]
    #  delete engine.nullified[name]
    #if engine.replaced?[name]
    #  delete engine.replaced[name]
    (engine.declared ||= {})[name] = variable
    return variable

  # Undeclare variable in given domain, outputs "null" once
  undeclare: (engine, variable, quick) ->
    if quick
      (engine.replaced ||= {})[variable.name] = variable
    else
      (engine.nullified ||= {})[variable.name] = variable
      if engine.declared?[variable.name]
        delete engine.declared[variable.name]

    delete engine.values[variable.name]
    engine.nullify(variable)
    engine.unedit(variable)

# Algebraic expression
class Variable.Expression extends Variable

  signature: [
    left:  ['Variable', 'Number']
    right: ['Variable', 'Number']
  ]

Variable.Expression.algebra =
  '+': (left, right) ->


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
Command = require('./Command')

class Variable extends Command
  type: 'Variable'

  signature: [
    property: ['String']
  ]

  constructor: ->

  before: (args, engine, operation, continuation, scope, ascender, ascending) ->
    if (value = ascending?.values?[args[0]])?
      return value

  # Declare variable within domain, initial value is zero
  declare: (engine, name) ->
    variables = engine.variables
    unless variable = variables[name]
      variable = variables[name] = engine.variable(name)
    #if engine.nullified?[name]
    #  delete engine.nullified[name]
    #if engine.replaced?[name]
    #  delete engine.replaced[name]
    (engine.declared ||= {})[name] = variable
    return variable

  # Undeclare variable in given domain, outputs "null" once
  undeclare: (engine, variable, quick) ->
    if quick
      (engine.replaced ||= {})[variable.name] = variable
    else
      (engine.nullified ||= {})[variable.name] = variable
      if engine.declared?[variable.name]
        delete engine.declared[variable.name]

    delete engine.values[variable.name]
    engine.nullify(variable)
    engine.unedit(variable)

# Algebraic expression
class Variable.Expression extends Variable

  signature: [
    left:  ['Variable', 'Number']
    right: ['Variable', 'Number']
  ]

Variable.Expression.algebra =
  '+': (left, right) ->
```

Response:
var Command, Variable;

Command = require('./Command');

Variable = (function() {
  class Variable extends Command {
    constructor() {}

    before(args, engine, operation, continuation, scope, ascender, ascending) {
      var ref, value;
      if ((value = ascending != null ? (ref = ascending.values) != null ? ref[args[0]] : void 0 : void 0) != null) {
        return value;
      }
    }

    // Declare variable within domain, initial value is zero
    declare(engine, name) {
      var variable, variables;
      variables = engine.variables;
      if (!(variable = variables[name])) {
        variable = variables[name] = engine.variable(name);
      }
      //if engine.nullified?[name]
      //  delete engine.nullified[name]
      //if engine.replaced?[name]
      //  delete engine.replaced[name]
      (engine.declared || (engine.declared = {}))[name] = variable;
      return variable;
    }

    // Undeclare variable in given domain, outputs "null" once
    undeclare(engine, variable, quick) {
      var ref;
      if (quick) {
        (engine.replaced || (engine.replaced = {}))[variable.name] = variable;
      } else {
        (engine.nullified || (engine.nullified = {}))[variable.name] = variable;
        if ((ref = engine.declared) != null ? ref[variable.name] : void 0) {
          delete engine.declared[variable.name];
        }
      }
      delete engine.values[variable.name];
      engine.nullify(variable);
      return engine.unedit(variable);
    }

  };

  Variable.prototype.type = 'Variable';

  Variable.prototype.signature = [
    {
      property: ['String']
    }
  ];

  return Variable;

}).call(this);

Variable.Expression = (function() {
  // Algebraic expression
  class Expression extends Variable {};

  Expression.prototype.signature = [
    {
      left: ['Variable',
    'Number'],
      right: ['Variable',
    'Number']
    }
  ];

  return Expression;

}).call(this);

Variable.Expression.algebra = {
  '+': function(left, right) {}
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var Command, Variable;

Command = require('./Command');

Variable = (function() {
  class Variable extends Command {
    constructor() {}

    before(args, engine, operation, continuation, scope, ascender, ascending) {
      var ref, value;
      if ((value = ascending != null ? (ref = ascending.values) != null ? ref[args[0]] : void 0 : void 0) != null) {
        return value;
      }
    }

    // Declare variable within domain, initial value is zero
    declare(engine, name) {
      var variable, variables;
      variables = engine.variables;
      if (!(variable = variables[name])) {
        variable = variables[name] = engine.variable(name);
      }
      //if engine.nullified?[name]
      //  delete engine.nullified[name]
      //if engine.replaced?[name]
      //  delete engine.replaced[name]
      (engine.declared || (engine.declared = {}))[name] = variable;
      return variable;
    }

    // Undeclare variable in given domain, outputs "null" once
    undeclare(engine, variable, quick) {
      var ref;
      if (quick) {
        (engine.replaced || (engine.replaced = {}))[variable.name] = variable;
      } else {
        (engine.nullified || (engine.nullified = {}))[variable.name] = variable;
        if ((ref = engine.declared) != null ? ref[variable.name] : void 0) {
          delete engine.declared[variable.name];
        }
      }
      delete engine.values[variable.name];
      engine.nullify(variable);
      return engine.unedit(variable);
    }

  };

  Variable.prototype.type = 'Variable';

  Variable.prototype.signature = [
    {
      property: ['String']
    }
  ];

  return Variable;

}).call(this);

Variable.Expression = (function() {
  // Algebraic expression
  class Expression extends Variable {};

  Expression.prototype.signature = [
    {
      left: ['Variable',
    'Number'],
      right: ['Variable',
    'Number']
    }
  ];

  return Expression;

}).call(this);

Variable.Expression.algebra = {
  '+': function(left, right) {}
};
```

Response:
Command = require('./Command')

class Variable extends Command
  type: 'Variable'

  signature: [
    property: ['String']
  ]

  constructor: ->

  before: (args, engine, operation, continuation, scope, ascender, ascending) ->
    if (value = ascending?.values?[args[0]])?
      return value

  # Declare variable within domain, initial value is zero
  declare: (engine, name) ->
    variables = engine.variables
    unless variable = variables[name]
      variable = variables[name] = engine.variable(name)
    #if engine.nullified?[name]
    #  delete engine.nullified[name]
    #if engine.replaced?[name]
    #  delete engine.replaced[name]
    (engine.declared ||= {})[name] = variable
    return variable

  # Undeclare variable in given domain, outputs "null" once
  undeclare: (engine, variable, quick) ->
    if quick
      (engine.replaced ||= {})[variable.name] = variable
    else
      (engine.nullified ||= {})[variable.name] = variable
      if engine.declared?[variable.name]
        delete engine.declared[variable.name]

    delete engine.values[variable.name]
    engine.nullify(variable)
    engine.unedit(variable)

# Algebraic expression
class Variable.Expression extends Variable

  signature: [
    left:  ['Variable', 'Number']
    right: ['Variable', 'Number']
  ]

Variable.Expression.algebra =
  '+': (left, right) ->


Prompt:
Command = require('./Command')

class Variable extends Command
  type: 'Variable'

  signature: [
    property: ['String']
  ]

  constructor: ->

  before: (args, engine, operation, continuation, scope, ascender, ascending) ->
    if (value = ascending?.values?[args[0]])?
      return value

  # Declare variable within domain, initial value is zero
  declare: (engine, name) ->
    variables = engine.variables
    unless variable = variables[name]
      variable = variables[name] = engine.variable(name)
    #if engine.nullified?[name]
    #  delete engine.nullified[name]
    #if engine.replaced?[name]
    #  delete engine.replaced[name]
    (engine.declared ||= {})[name] = variable

Response:
return variable

  # Undeclare variable in given domain, outputs "null" once
  undeclare: (engine, variable, quick) ->
    if quick
      (engine.replaced ||= {})[variable.name] = variable
    else
      (engine.nullified ||= {})[variable.name] = variable
      if engine.declared?[variable.name]
        delete engine.declared[variable.name]

    delete engine.values[variable.name]
    engine.nullify(variable)
    engine.unedit(variable)

# Algebraic expression
class Variable.Expression extends Variable

  signature: [
    left:  ['Variable', 'Number']
    right: ['Variable', 'Number']
  ]

Variable.Expression.algebra =
  '+': (left, right) ->


Response:
return left + right

  '-': (left, right) ->
    return left - right

  '*': (left, right) ->
    return left * right

  '/': (left, right) ->
    return left / right

module.exports = Variable


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
return left + right

  '-': (left, right) ->
    return left - right

  '*': (left, right) ->
    return left * right

  '/': (left, right) ->
    return left / right

module.exports = Variable
```

Response:
return left + right({
  '-': function(left, right) {
    return left - right;
  },
  '*': function(left, right) {
    return left * right;
  },
  '/': function(left, right) {
    return left / right;
  }
});

module.exports = Variable;


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
return left + right({
  '-': function(left, right) {
    return left - right;
  },
  '*': function(left, right) {
    return left * right;
  },
  '/': function(left, right) {
    return left / right;
  }
});

module.exports = Variable;
```

Response:
return left + right

  '-': (left, right) ->
    return left - right

  '*': (left, right) ->
    return left * right

  '/': (left, right) ->
    return left / right

module.exports = Variable


Prompt:
return left + right

  '-': (left, right) ->
    return left - right

  '*': (left, right) ->

Response:
return left * right

  '/': (left, right) ->
    return left / right

module.exports = Variable


Response:
i: 5
list: while i -= 1
  i * 2

ok list.join(' ') is "8 6 4 2"

i: 5
list: (i * 3 while i -= 1)

ok list.join(' ') is "12 9 6 3"

i: 5
func:   (num) -> i -= num
assert: -> ok i < 5 > 0

results: while func 1
  assert()
  i

ok results.join(' ') is '4 3 2 1'

i: 10
results: while i -= 1 when i % 2 is 0
  i * 2

ok results.join(' ') is '16 12 8 4'

value: false
i: 0
results: until value
  value: true if i is 5
  i += 1

ok i is 6


Prompt:
i: 5
list: while i -= 1
  i * 2

ok list.join(' ') is "8 6 4 2"

i: 5
list: (i * 3 while i -= 1)

ok list.join(' ') is "12 9 6 3"

i: 5
func:   (num) -> i -= num
assert: -> ok i < 5 > 0

results: while func 1
  assert()

Response:
i

ok results.join(' ') is '4 3 2 1'

i: 10
results: while i -= 1 when i % 2 is 0
  i * 2

ok results.join(' ') is '16 12 8 4'

value: false
i: 0
results: until value
  value: true if i is 5
  i += 1

ok i is 6


Response:
async = require 'async'
Err = require 'err1st'
BaseMailer = require './base'
util = require '../util'
logger = require '../components/logger'

class LoginMailer extends BaseMailer

  delay: 0
  action: 'send'
  template: 'login'

  send: (user) ->

    self = this

    email =
      id: "login#{user._id}"
      user: user
      to: user.emailForLogin
      subject: "[简聊] 欢迎来到简聊"

    email.redirectTip = '点击按钮访问简聊：'
    email.redirectBtnTip = '访问简聊'
    email.redirectUrl = util.buildIndexUrl()

    self._sendByRender email

module.exports = new LoginMailer


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
async = require 'async'
Err = require 'err1st'
BaseMailer = require './base'
util = require '../util'
logger = require '../components/logger'

class LoginMailer extends BaseMailer

  delay: 0
  action: 'send'
  template: 'login'

  send: (user) ->

    self = this

    email =
      id: "login#{user._id}"
      user: user
      to: user.emailForLogin
      subject: "[简聊] 欢迎来到简聊"

    email.redirectTip = '点击按钮访问简聊：'
    email.redirectBtnTip = '访问简聊'
    email.redirectUrl = util.buildIndexUrl()

    self._sendByRender email

module.exports = new LoginMailer
```

Response:
var BaseMailer, Err, LoginMailer, async, logger, util;

async = require('async');

Err = require('err1st');

BaseMailer = require('./base');

util = require('../util');

logger = require('../components/logger');

LoginMailer = (function() {
  class LoginMailer extends BaseMailer {
    send(user) {
      var email, self;
      self = this;
      email = {
        id: `login${user._id}`,
        user: user,
        to: user.emailForLogin,
        subject: "[简聊] 欢迎来到简聊"
      };
      email.redirectTip = '点击按钮访问简聊：';
      email.redirectBtnTip = '访问简聊';
      email.redirectUrl = util.buildIndexUrl();
      return self._sendByRender(email);
    }

  };

  LoginMailer.prototype.delay = 0;

  LoginMailer.prototype.action = 'send';

  LoginMailer.prototype.template = 'login';

  return LoginMailer;

}).call(this);

module.exports = new LoginMailer();


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var BaseMailer, Err, LoginMailer, async, logger, util;

async = require('async');

Err = require('err1st');

BaseMailer = require('./base');

util = require('../util');

logger = require('../components/logger');

LoginMailer = (function() {
  class LoginMailer extends BaseMailer {
    send(user) {
      var email, self;
      self = this;
      email = {
        id: `login${user._id}`,
        user: user,
        to: user.emailForLogin,
        subject: "[简聊] 欢迎来到简聊"
      };
      email.redirectTip = '点击按钮访问简聊：';
      email.redirectBtnTip = '访问简聊';
      email.redirectUrl = util.buildIndexUrl();
      return self._sendByRender(email);
    }

  };

  LoginMailer.prototype.delay = 0;

  LoginMailer.prototype.action = 'send';

  LoginMailer.prototype.template = 'login';

  return LoginMailer;

}).call(this);

module.exports = new LoginMailer();
```

Response:
async = require 'async'
Err = require 'err1st'
BaseMailer = require './base'
util = require '../util'
logger = require '../components/logger'

class LoginMailer extends BaseMailer

  delay: 0
  action: 'send'
  template: 'login'

  send: (user) ->

    self = this

    email =
      id: "login#{user._id}"
      user: user
      to: user.emailForLogin
      subject: "[简聊] 欢迎来到简聊"

    email.redirectTip = '点击按钮访问简聊：'
    email.redirectBtnTip = '访问简聊'
    email.redirectUrl = util.buildIndexUrl()

    self._sendByRender email

module.exports = new LoginMailer


Prompt:
async = require 'async'
Err = require 'err1st'
BaseMailer = require './base'
util = require '../util'
logger = require '../components/logger'

class LoginMailer extends BaseMailer

  delay: 0
  action: 'send'
  template: 'login'

  send: (user) ->

Response:
self = this

    email =
      id: "login#{user._id}"
      user: user
      to: user.emailForLogin
      subject: "[简聊] 欢迎来到简聊"

    email.redirectTip = '点击按钮访问简聊：'
    email.redirectBtnTip = '访问简聊'
    email.redirectUrl = util.buildIndexUrl()

    self._sendByRender email

module.exports = new LoginMailer


Response:
rimraf = require('rimraf')
fs = require('fs')
tempDir = process.env.SPEC_TEMP_DIR = "#{process.cwd()}/tmp"

module.exports = tmp =
  create: ->
    fs.mkdirSync(tempDir) unless fs.existsSync(tempDir)
  delete: ->
    if fs.existsSync(tempDir)
      rimraf.sync(process.env.SPEC_TEMP_DIR)

tmp.delete()
tmp.create()


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
rimraf = require('rimraf')
fs = require('fs')
tempDir = process.env.SPEC_TEMP_DIR = "#{process.cwd()}/tmp"

module.exports = tmp =
  create: ->
    fs.mkdirSync(tempDir) unless fs.existsSync(tempDir)
  delete: ->
    if fs.existsSync(tempDir)
      rimraf.sync(process.env.SPEC_TEMP_DIR)

tmp.delete()
tmp.create()
```

Response:
var fs, rimraf, tempDir, tmp;

rimraf = require('rimraf');

fs = require('fs');

tempDir = process.env.SPEC_TEMP_DIR = `${process.cwd()}/tmp`;

module.exports = tmp = {
  create: function() {
    if (!fs.existsSync(tempDir)) {
      return fs.mkdirSync(tempDir);
    }
  },
  delete: function() {
    if (fs.existsSync(tempDir)) {
      return rimraf.sync(process.env.SPEC_TEMP_DIR);
    }
  }
};

tmp.delete();

tmp.create();


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var fs, rimraf, tempDir, tmp;

rimraf = require('rimraf');

fs = require('fs');

tempDir = process.env.SPEC_TEMP_DIR = `${process.cwd()}/tmp`;

module.exports = tmp = {
  create: function() {
    if (!fs.existsSync(tempDir)) {
      return fs.mkdirSync(tempDir);
    }
  },
  delete: function() {
    if (fs.existsSync(tempDir)) {
      return rimraf.sync(process.env.SPEC_TEMP_DIR);
    }
  }
};

tmp.delete();

tmp.create();
```

Response:
rimraf = require('rimraf')
fs = require('fs')
tempDir = process.env.SPEC_TEMP_DIR = "#{process.cwd()}/tmp"

module.exports = tmp =
  create: ->
    fs.mkdirSync(tempDir) unless fs.existsSync(tempDir)
  delete: ->
    if fs.existsSync(tempDir)
      rimraf.sync(process.env.SPEC_TEMP_DIR)

tmp.delete()
tmp.create()


Prompt:
rimraf = require('rimraf')
fs = require('fs')
tempDir = process.env.SPEC_TEMP_DIR = "#{process.cwd()}/tmp"

module.exports = tmp =
  create: ->

Response:
fs.mkdirSync(tempDir) unless fs.existsSync(tempDir)
  delete: ->
    if fs.existsSync(tempDir)
      rimraf.sync(process.env.SPEC_TEMP_DIR)

tmp.delete()
tmp.create()


Response:
rimraf = require('rimraf')
fs = require('fs')
tempDir = process.env.SPEC_TEMP_DIR = "#{process.cwd()}/tmp"

module.exports = tmp =
  create: ->
    fs.mkdirSync(tempDir) unless fs.existsSync(tempDir)
  delete: ->
    if fs.existsSync(tempDir)
      rimraf.sync(process.env.SPEC_TEMP_DIR)

beforeAll ->
  tmp.delete()
  tmp.create()


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
rimraf = require('rimraf')
fs = require('fs')
tempDir = process.env.SPEC_TEMP_DIR = "#{process.cwd()}/tmp"

module.exports = tmp =
  create: ->
    fs.mkdirSync(tempDir) unless fs.existsSync(tempDir)
  delete: ->
    if fs.existsSync(tempDir)
      rimraf.sync(process.env.SPEC_TEMP_DIR)

beforeAll ->
  tmp.delete()
  tmp.create()
```

Response:
var fs, rimraf, tempDir, tmp;

rimraf = require('rimraf');

fs = require('fs');

tempDir = process.env.SPEC_TEMP_DIR = `${process.cwd()}/tmp`;

module.exports = tmp = {
  create: function() {
    if (!fs.existsSync(tempDir)) {
      return fs.mkdirSync(tempDir);
    }
  },
  delete: function() {
    if (fs.existsSync(tempDir)) {
      return rimraf.sync(process.env.SPEC_TEMP_DIR);
    }
  }
};

beforeAll(function() {
  tmp.delete();
  return tmp.create();
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var fs, rimraf, tempDir, tmp;

rimraf = require('rimraf');

fs = require('fs');

tempDir = process.env.SPEC_TEMP_DIR = `${process.cwd()}/tmp`;

module.exports = tmp = {
  create: function() {
    if (!fs.existsSync(tempDir)) {
      return fs.mkdirSync(tempDir);
    }
  },
  delete: function() {
    if (fs.existsSync(tempDir)) {
      return rimraf.sync(process.env.SPEC_TEMP_DIR);
    }
  }
};

beforeAll(function() {
  tmp.delete();
  return tmp.create();
});
```

Response:
rimraf = require('rimraf')
fs = require('fs')
tempDir = process.env.SPEC_TEMP_DIR = "#{process.cwd()}/tmp"

module.exports = tmp =
  create: ->
    fs.mkdirSync(tempDir) unless fs.existsSync(tempDir)
  delete: ->
    if fs.existsSync(tempDir)
      rimraf.sync(process.env.SPEC_TEMP_DIR)

beforeAll ->
  tmp.delete()
  tmp.create()


Prompt:
rimraf = require('rimraf')
fs = require('fs')
tempDir = process.env.SPEC_TEMP_DIR = "#{process.cwd()}/tmp"

module.exports = tmp =
  create: ->
    fs.mkdirSync(tempDir) unless fs.existsSync(tempDir)

Response:
delete: ->
    if fs.existsSync(tempDir)
      rimraf.sync(process.env.SPEC_TEMP_DIR)

beforeAll ->
  tmp.delete()
  tmp.create()


Response:
rimraf = require('rimraf')
fs = require('fs')
tempDir = process.env.SPEC_TEMP_DIR = "#{process.cwd()}/tmp"

module.exports = self =
  create: ->
    fs.mkdirSync(tempDir) unless fs.existsSync(tempDir)
  delete: ->
    if fs.existsSync(tempDir)
      rimraf.sync(process.env.SPEC_TEMP_DIR)

beforeAll ->
  self.delete()
  self.create()


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
rimraf = require('rimraf')
fs = require('fs')
tempDir = process.env.SPEC_TEMP_DIR = "#{process.cwd()}/tmp"

module.exports = self =
  create: ->
    fs.mkdirSync(tempDir) unless fs.existsSync(tempDir)
  delete: ->
    if fs.existsSync(tempDir)
      rimraf.sync(process.env.SPEC_TEMP_DIR)

beforeAll ->
  self.delete()
  self.create()
```

Response:
var fs, rimraf, self, tempDir;

rimraf = require('rimraf');

fs = require('fs');

tempDir = process.env.SPEC_TEMP_DIR = `${process.cwd()}/tmp`;

module.exports = self = {
  create: function() {
    if (!fs.existsSync(tempDir)) {
      return fs.mkdirSync(tempDir);
    }
  },
  delete: function() {
    if (fs.existsSync(tempDir)) {
      return rimraf.sync(process.env.SPEC_TEMP_DIR);
    }
  }
};

beforeAll(function() {
  self.delete();
  return self.create();
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var fs, rimraf, self, tempDir;

rimraf = require('rimraf');

fs = require('fs');

tempDir = process.env.SPEC_TEMP_DIR = `${process.cwd()}/tmp`;

module.exports = self = {
  create: function() {
    if (!fs.existsSync(tempDir)) {
      return fs.mkdirSync(tempDir);
    }
  },
  delete: function() {
    if (fs.existsSync(tempDir)) {
      return rimraf.sync(process.env.SPEC_TEMP_DIR);
    }
  }
};

beforeAll(function() {
  self.delete();
  return self.create();
});
```

Response:
rimraf = require('rimraf')
fs = require('fs')
tempDir = process.env.SPEC_TEMP_DIR = "#{process.cwd()}/tmp"

module.exports = self =
  create: ->
    fs.mkdirSync(tempDir) unless fs.existsSync(tempDir)
  delete: ->
    if fs.existsSync(tempDir)
      rimraf.sync(process.env.SPEC_TEMP_DIR)

beforeAll ->
  self.delete()
  self.create()


Prompt:
rimraf = require('rimraf')
fs = require('fs')
tempDir = process.env.SPEC_TEMP_DIR = "#{process.cwd()}/tmp"

module.exports = self =
  create: ->
    fs.mkdirSync(tempDir) unless fs.existsSync(tempDir)

Response:
delete: ->
    if fs.existsSync(tempDir)
      rimraf.sync(process.env.SPEC_TEMP_DIR)

beforeAll ->
  self.delete()
  self.create()


Response:
class Vector

	### Adds two vectors and returns the product. ###
	@add: (v1, v2) ->
		new Vector v1.x + v2.x, v1.y + v2.y

	### Subtracts v2 from v1 and returns the product. ###
	@sub: (v1, v2) ->
		new Vector v1.x - v2.x, v1.y - v2.y

	### Projects one vector (v1) onto another (v2) ###
	@project: (v1, v2) ->
		v1.clone().scale ((v1.dot v2) / v1.magSq())

	### Creates a new Vector instance. ###
	constructor: (@x = 0.0, @y = 0.0) ->

	### Sets the components of this vector. ###
	set: (@x, @y) ->
		@

	### Add a vector to this one. ###
	add: (v) ->
		@x += v.x; @y += v.y; @

	### Subtracts a vector from this one. ###
	sub: (v) ->
		@x -= v.x; @y -= v.y; @

	### Scales this vector by a value. ###
	scale: (f) ->
		@x *= f; @y *= f; @

	### Computes the dot product between vectors. ###
	dot: (v) ->
		@x * v.x + @y * v.y

	### Computes the cross product between vectors. ###
	cross: (v) ->
		(@x * v.y) - (@y * v.x)

	### Computes the magnitude (length). ###
	mag: ->
		Math.sqrt @x*@x + @y*@y

	### Computes the squared magnitude (length). ###
	magSq: ->
		@x*@x + @y*@y

	### Computes the distance to another vector. ###


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
class Vector

	### Adds two vectors and returns the product. ###
	@add: (v1, v2) ->
		new Vector v1.x + v2.x, v1.y + v2.y

	### Subtracts v2 from v1 and returns the product. ###
	@sub: (v1, v2) ->
		new Vector v1.x - v2.x, v1.y - v2.y

	### Projects one vector (v1) onto another (v2) ###
	@project: (v1, v2) ->
		v1.clone().scale ((v1.dot v2) / v1.magSq())

	### Creates a new Vector instance. ###
	constructor: (@x = 0.0, @y = 0.0) ->

	### Sets the components of this vector. ###
	set: (@x, @y) ->
		@

	### Add a vector to this one. ###
	add: (v) ->
		@x += v.x; @y += v.y; @

	### Subtracts a vector from this one. ###
	sub: (v) ->
		@x -= v.x; @y -= v.y; @

	### Scales this vector by a value. ###
	scale: (f) ->
		@x *= f; @y *= f; @

	### Computes the dot product between vectors. ###
	dot: (v) ->
		@x * v.x + @y * v.y

	### Computes the cross product between vectors. ###
	cross: (v) ->
		(@x * v.y) - (@y * v.x)

	### Computes the magnitude (length). ###
	mag: ->
		Math.sqrt @x*@x + @y*@y

	### Computes the squared magnitude (length). ###
	magSq: ->
		@x*@x + @y*@y

	### Computes the distance to another vector. ###
```

Response:
var Vector;

Vector = class Vector {
  /* Adds two vectors and returns the product. */
  static add(v1, v2) {
    return new Vector(v1.x + v2.x, v1.y + v2.y);
  }

  /* Subtracts v2 from v1 and returns the product. */
  static sub(v1, v2) {
    return new Vector(v1.x - v2.x, v1.y - v2.y);
  }

  /* Projects one vector (v1) onto another (v2) */
  static project(v1, v2) {
    return v1.clone().scale((v1.dot(v2)) / v1.magSq());
  }

  /* Creates a new Vector instance. */
  constructor(x = 0.0, y = 0.0) {
    this.x = x;
    this.y = y;
  }

  /* Sets the components of this vector. */
  set(x, y) {
    this.x = x;
    this.y = y;
    return this;
  }

  /* Add a vector to this one. */
  add(v) {
    this.x += v.x;
    this.y += v.y;
    return this;
  }

  /* Subtracts a vector from this one. */
  sub(v) {
    this.x -= v.x;
    this.y -= v.y;
    return this;
  }

  /* Scales this vector by a value. */
  scale(f) {
    this.x *= f;
    this.y *= f;
    return this;
  }

  /* Computes the dot product between vectors. */
  dot(v) {
    return this.x * v.x + this.y * v.y;
  }

  /* Computes the cross product between vectors. */
  cross(v) {
    return (this.x * v.y) - (this.y * v.x);
  }

  /* Computes the magnitude (length). */
  mag() {
    return Math.sqrt(this.x * this.x + this.y * this.y);
  }

  /* Computes the squared magnitude (length). */
  magSq() {
    return this.x * this.x + this.y * this.y;
  }

};

/* Computes the distance to another vector. */


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

Vector = class Vector {
  /* Adds two vectors and returns the product. */
  static add(v1, v2) {
    return new Vector(v1.x + v2.x, v1.y + v2.y);
  }

  /* Subtracts v2 from v1 and returns the product. */
  static sub(v1, v2) {
    return new Vector(v1.x - v2.x, v1.y - v2.y);
  }

  /* Projects one vector (v1) onto another (v2) */
  static project(v1, v2) {
    return v1.clone().scale((v1.dot(v2)) / v1.magSq());
  }

  /* Creates a new Vector instance. */
  constructor(x = 0.0, y = 0.0) {
    this.x = x;
    this.y = y;
  }

  /* Sets the components of this vector. */
  set(x, y) {
    this.x = x;
    this.y = y;
    return this;
  }

  /* Add a vector to this one. */
  add(v) {
    this.x += v.x;
    this.y += v.y;
    return this;
  }

  /* Subtracts a vector from this one. */
  sub(v) {
    this.x -= v.x;
    this.y -= v.y;
    return this;
  }

  /* Scales this vector by a value. */
  scale(f) {
    this.x *= f;
    this.y *= f;
    return this;
  }

  /* Computes the dot product between vectors. */
  dot(v) {
    return this.x * v.x + this.y * v.y;
  }

  /* Computes the cross product between vectors. */
  cross(v) {
    return (this.x * v.y) - (this.y * v.x);
  }

  /* Computes the magnitude (length). */
  mag() {
    return Math.sqrt(this.x * this.x + this.y * this.y);
  }

  /* Computes the squared magnitude (length). */
  magSq() {
    return this.x * this.x + this.y * this.y;
  }

};

/* Computes the distance to another vector. */
```

Response:
class Vector

	### Adds two vectors and returns the product. ###
	@add: (v1, v2) ->
		new Vector v1.x + v2.x, v1.y + v2.y

	### Subtracts v2 from v1 and returns the product. ###
	@sub: (v1, v2) ->
		new Vector v1.x - v2.x, v1.y - v2.y

	### Projects one vector (v1) onto another (v2) ###
	@project: (v1, v2) ->
		v1.clone().scale ((v1.dot v2) / v1.magSq())

	### Creates a new Vector instance. ###
	constructor: (@x = 0.0, @y = 0.0) ->

	### Sets the components of this vector. ###
	set: (@x, @y) ->
		@

	### Add a vector to this one. ###
	add: (v) ->
		@x += v.x; @y += v.y; @

	### Subtracts a vector from this one. ###
	sub: (v) ->
		@x -= v.x; @y -= v.y; @

	### Scales this vector by a value. ###
	scale: (f) ->
		@x *= f; @y *= f; @

	### Computes the dot product between vectors. ###
	dot: (v) ->
		@x * v.x + @y * v.y

	### Computes the cross product between vectors. ###
	cross: (v) ->
		(@x * v.y) - (@y * v.x)

	### Computes the magnitude (length). ###
	mag: ->
		Math.sqrt @x*@x + @y*@y

	### Computes the squared magnitude (length). ###
	magSq: ->
		@x*@x + @y*@y

	### Computes the distance to another vector. ###


Prompt:
class Vector

	### Adds two vectors and returns the product. ###
	@add: (v1, v2) ->
		new Vector v1.x + v2.x, v1.y + v2.y

	### Subtracts v2 from v1 and returns the product. ###
	@sub: (v1, v2) ->
		new Vector v1.x - v2.x, v1.y - v2.y

	### Projects one vector (v1) onto another (v2) ###
	@project: (v1, v2) ->
		v1.clone().scale ((v1.dot v2) / v1.magSq())

	### Creates a new Vector instance. ###
	constructor: (@x = 0.0, @y = 0.0) ->

	### Sets the components of this vector. ###
	set: (@x, @y) ->
		@

	### Add a vector to this one. ###
	add: (v) ->
		@x += v.x; @y += v.y; @

Response:
### Subtracts a vector from this one. ###
	sub: (v) ->
		@x -= v.x; @y -= v.y; @

	### Scales this vector by a value. ###
	scale: (f) ->
		@x *= f; @y *= f; @

	### Computes the dot product between vectors. ###
	dot: (v) ->
		@x * v.x + @y * v.y

	### Computes the cross product between vectors. ###
	cross: (v) ->
		(@x * v.y) - (@y * v.x)

	### Computes the magnitude (length). ###
	mag: ->
		Math.sqrt @x*@x + @y*@y

	### Computes the squared magnitude (length). ###
	magSq: ->
		@x*@x + @y*@y

	### Computes the distance to another vector. ###


Response:
dist: (v) ->
		dx = v.x - @x; dy = v.y - @y
		Math.sqrt dx*dx + dy*dy

	### Computes the squared distance to another vector. ###
	distSq: (v) ->
		dx = v.x - @x; dy = v.y - @y
		dx*dx + dy*dy

	### Normalises the vector, making it a unit vector (of length 1). ###
	norm: ->
		m = Math.sqrt @x*@x + @y*@y
		@x /= m
		@y /= m
		@

	### Limits the vector length to a given amount. ###
	limit: (l) ->
		mSq = @x*@x + @y*@y
		if mSq > l*l
			m = Math.sqrt mSq
			@x /= m; @y /= m
			@x *= l; @y *= l
			@

	### Copies components from another vector. ###
	copy: (v) ->
		@x = v.x; @y = v.y; @

	### Clones this vector to a new itentical one. ###
	clone: ->
		new Vector @x, @y

	### Resets the vector to zero. ###
	clear: ->
		@x = 0.0; @y = 0.0; @


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
dist: (v) ->
		dx = v.x - @x; dy = v.y - @y
		Math.sqrt dx*dx + dy*dy

	### Computes the squared distance to another vector. ###
	distSq: (v) ->
		dx = v.x - @x; dy = v.y - @y
		dx*dx + dy*dy

	### Normalises the vector, making it a unit vector (of length 1). ###
	norm: ->
		m = Math.sqrt @x*@x + @y*@y
		@x /= m
		@y /= m
		@

	### Limits the vector length to a given amount. ###
	limit: (l) ->
		mSq = @x*@x + @y*@y
		if mSq > l*l
			m = Math.sqrt mSq
			@x /= m; @y /= m
			@x *= l; @y *= l
			@

	### Copies components from another vector. ###
	copy: (v) ->
		@x = v.x; @y = v.y; @

	### Clones this vector to a new itentical one. ###
	clone: ->
		new Vector @x, @y

	### Resets the vector to zero. ###
	clear: ->
		@x = 0.0; @y = 0.0; @
```

Response:
({
  dist: function(v) {
    var dx, dy;
    dx = v.x - this.x;
    dy = v.y - this.y;
    return Math.sqrt(dx * dx + dy * dy);
  },
  /* Computes the squared distance to another vector. */
  distSq: function(v) {
    var dx, dy;
    dx = v.x - this.x;
    dy = v.y - this.y;
    return dx * dx + dy * dy;
  },
  /* Normalises the vector, making it a unit vector (of length 1). */
  norm: function() {
    var m;
    m = Math.sqrt(this.x * this.x + this.y * this.y);
    this.x /= m;
    this.y /= m;
    return this;
  },
  /* Limits the vector length to a given amount. */
  limit: function(l) {
    var m, mSq;
    mSq = this.x * this.x + this.y * this.y;
    if (mSq > l * l) {
      m = Math.sqrt(mSq);
      this.x /= m;
      this.y /= m;
      this.x *= l;
      this.y *= l;
      return this;
    }
  },
  /* Copies components from another vector. */
  copy: function(v) {
    this.x = v.x;
    this.y = v.y;
    return this;
  },
  /* Clones this vector to a new itentical one. */
  clone: function() {
    return new Vector(this.x, this.y);
  },
  /* Resets the vector to zero. */
  clear: function() {
    this.x = 0.0;
    this.y = 0.0;
    return this;
  }
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
({
  dist: function(v) {
    var dx, dy;
    dx = v.x - this.x;
    dy = v.y - this.y;
    return Math.sqrt(dx * dx + dy * dy);
  },
  /* Computes the squared distance to another vector. */
  distSq: function(v) {
    var dx, dy;
    dx = v.x - this.x;
    dy = v.y - this.y;
    return dx * dx + dy * dy;
  },
  /* Normalises the vector, making it a unit vector (of length 1). */
  norm: function() {
    var m;
    m = Math.sqrt(this.x * this.x + this.y * this.y);
    this.x /= m;
    this.y /= m;
    return this;
  },
  /* Limits the vector length to a given amount. */
  limit: function(l) {
    var m, mSq;
    mSq = this.x * this.x + this.y * this.y;
    if (mSq > l * l) {
      m = Math.sqrt(mSq);
      this.x /= m;
      this.y /= m;
      this.x *= l;
      this.y *= l;
      return this;
    }
  },
  /* Copies components from another vector. */
  copy: function(v) {
    this.x = v.x;
    this.y = v.y;
    return this;
  },
  /* Clones this vector to a new itentical one. */
  clone: function() {
    return new Vector(this.x, this.y);
  },
  /* Resets the vector to zero. */
  clear: function() {
    this.x = 0.0;
    this.y = 0.0;
    return this;
  }
});
```

Response:
dist: (v) ->
		dx = v.x - @x; dy = v.y - @y
		Math.sqrt dx*dx + dy*dy

	### Computes the squared distance to another vector. ###
	distSq: (v) ->
		dx = v.x - @x; dy = v.y - @y
		dx*dx + dy*dy

	### Normalises the vector, making it a unit vector (of length 1). ###
	norm: ->
		m = Math.sqrt @x*@x + @y*@y
		@x /= m
		@y /= m
		@

	### Limits the vector length to a given amount. ###
	limit: (l) ->
		mSq = @x*@x + @y*@y
		if mSq > l*l
			m = Math.sqrt mSq
			@x /= m; @y /= m
			@x *= l; @y *= l
			@

	### Copies components from another vector. ###
	copy: (v) ->
		@x = v.x; @y = v.y; @

	### Clones this vector to a new itentical one. ###
	clone: ->
		new Vector @x, @y

	### Resets the vector to zero. ###
	clear: ->
		@x = 0.0; @y = 0.0; @


Prompt:
dist: (v) ->
		dx = v.x - @x; dy = v.y - @y
		Math.sqrt dx*dx + dy*dy

	### Computes the squared distance to another vector. ###
	distSq: (v) ->
		dx = v.x - @x; dy = v.y - @y
		dx*dx + dy*dy

	### Normalises the vector, making it a unit vector (of length 1). ###
	norm: ->
		m = Math.sqrt @x*@x + @y*@y
		@x /= m
		@y /= m
		@

	### Limits the vector length to a given amount. ###
	limit: (l) ->

Response:
mSq = @x*@x + @y*@y
		if mSq > l*l
			m = Math.sqrt mSq
			@x /= m; @y /= m
			@x *= l; @y *= l
			@

	### Copies components from another vector. ###
	copy: (v) ->
		@x = v.x; @y = v.y; @

	### Clones this vector to a new itentical one. ###
	clone: ->
		new Vector @x, @y

	### Resets the vector to zero. ###
	clear: ->
		@x = 0.0; @y = 0.0; @


Response:
if Meteor.isServer

  describe 'A route', ->

    it 'can be constructed with options', (test) ->
      route = new @Route new @Restivus, 'test-route-1', {authRequired: true, roleRequired: ['admin', 'dev']},
        get: -> 'GET test-route-1'

      test.equal route.path, 'test-route-1'
      test.isTrue route.options.authRequired
      test.isTrue _.contains(route.options.roleRequired, 'admin')
      test.isTrue _.contains(route.options.roleRequired, 'dev')
      test.equal route.endpoints.get(), 'GET test-route-1'

    it 'can be constructed without options', (test) ->
      route = new @Route new @Restivus, 'test-route-2',
        get: -> 'GET test-route-2'

      test.equal route.path, 'test-route-2'
      test.equal route.endpoints.get(), 'GET test-route-2'

    it 'should support endpoints for all HTTP methods', (test) ->
      route = new @Route new @Restivus, 'test-route-3',
        get: -> 'GET test-route-2'
        post: -> 'POST test-route-2'
        put: -> 'PUT test-route-2'
        patch: -> 'PATCH test-route-2'
        delete: -> 'DELETE test-route-2'
        options: -> 'OPTIONS test-route-2'

      test.equal route.endpoints.get(), 'GET test-route-2'
      test.equal route.endpoints.post(), 'POST test-route-2'
      test.equal route.endpoints.put(), 'PUT test-route-2'
      test.equal route.endpoints.patch(), 'PATCH test-route-2'
      test.equal route.endpoints.delete(), 'DELETE test-route-2'
      test.equal route.endpoints.options(), 'OPTIONS test-route-2'

    context 'that\'s initialized without options', ->
     it 'should have the default configuration', (test) ->
       test.equal Restivus.config.apiPath, 'api/'
       test.isFalse Restivus.config.useAuth
       test.isFalse Restivus.config.prettyJson
       test.equal Restivus.config.auth.token, 'services.resume.loginTokens.hashedToken'


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
if Meteor.isServer

  describe 'A route', ->

    it 'can be constructed with options', (test) ->
      route = new @Route new @Restivus, 'test-route-1', {authRequired: true, roleRequired: ['admin', 'dev']},
        get: -> 'GET test-route-1'

      test.equal route.path, 'test-route-1'
      test.isTrue route.options.authRequired
      test.isTrue _.contains(route.options.roleRequired, 'admin')
      test.isTrue _.contains(route.options.roleRequired, 'dev')
      test.equal route.endpoints.get(), 'GET test-route-1'

    it 'can be constructed without options', (test) ->
      route = new @Route new @Restivus, 'test-route-2',
        get: -> 'GET test-route-2'

      test.equal route.path, 'test-route-2'
      test.equal route.endpoints.get(), 'GET test-route-2'

    it 'should support endpoints for all HTTP methods', (test) ->
      route = new @Route new @Restivus, 'test-route-3',
        get: -> 'GET test-route-2'
        post: -> 'POST test-route-2'
        put: -> 'PUT test-route-2'
        patch: -> 'PATCH test-route-2'
        delete: -> 'DELETE test-route-2'
        options: -> 'OPTIONS test-route-2'

      test.equal route.endpoints.get(), 'GET test-route-2'
      test.equal route.endpoints.post(), 'POST test-route-2'
      test.equal route.endpoints.put(), 'PUT test-route-2'
      test.equal route.endpoints.patch(), 'PATCH test-route-2'
      test.equal route.endpoints.delete(), 'DELETE test-route-2'
      test.equal route.endpoints.options(), 'OPTIONS test-route-2'

    context 'that\'s initialized without options', ->
     it 'should have the default configuration', (test) ->
       test.equal Restivus.config.apiPath, 'api/'
       test.isFalse Restivus.config.useAuth
       test.isFalse Restivus.config.prettyJson
       test.equal Restivus.config.auth.token, 'services.resume.loginTokens.hashedToken'
```

Response:
if (Meteor.isServer) {
  describe('A route', function() {
    it('can be constructed with options', function(test) {
      var route;
      route = new this.Route(new this.Restivus(), 'test-route-1', {
        authRequired: true,
        roleRequired: ['admin', 'dev']
      }, {
        get: function() {
          return 'GET test-route-1';
        }
      });
      test.equal(route.path, 'test-route-1');
      test.isTrue(route.options.authRequired);
      test.isTrue(_.contains(route.options.roleRequired, 'admin'));
      test.isTrue(_.contains(route.options.roleRequired, 'dev'));
      return test.equal(route.endpoints.get(), 'GET test-route-1');
    });
    it('can be constructed without options', function(test) {
      var route;
      route = new this.Route(new this.Restivus(), 'test-route-2', {
        get: function() {
          return 'GET test-route-2';
        }
      });
      test.equal(route.path, 'test-route-2');
      return test.equal(route.endpoints.get(), 'GET test-route-2');
    });
    it('should support endpoints for all HTTP methods', function(test) {
      var route;
      route = new this.Route(new this.Restivus(), 'test-route-3', {
        get: function() {
          return 'GET test-route-2';
        },
        post: function() {
          return 'POST test-route-2';
        },
        put: function() {
          return 'PUT test-route-2';
        },
        patch: function() {
          return 'PATCH test-route-2';
        },
        delete: function() {
          return 'DELETE test-route-2';
        },
        options: function() {
          return 'OPTIONS test-route-2';
        }
      });
      test.equal(route.endpoints.get(), 'GET test-route-2');
      test.equal(route.endpoints.post(), 'POST test-route-2');
      test.equal(route.endpoints.put(), 'PUT test-route-2');
      test.equal(route.endpoints.patch(), 'PATCH test-route-2');
      test.equal(route.endpoints.delete(), 'DELETE test-route-2');
      return test.equal(route.endpoints.options(), 'OPTIONS test-route-2');
    });
    return context('that\'s initialized without options', function() {
      return it('should have the default configuration', function(test) {
        test.equal(Restivus.config.apiPath, 'api/');
        test.isFalse(Restivus.config.useAuth);
        test.isFalse(Restivus.config.prettyJson);
        return test.equal(Restivus.config.auth.token, 'services.resume.loginTokens.hashedToken');
      });
    });
  });
}


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
if (Meteor.isServer) {
  describe('A route', function() {
    it('can be constructed with options', function(test) {
      var route;
      route = new this.Route(new this.Restivus(), 'test-route-1', {
        authRequired: true,
        roleRequired: ['admin', 'dev']
      }, {
        get: function() {
          return 'GET test-route-1';
        }
      });
      test.equal(route.path, 'test-route-1');
      test.isTrue(route.options.authRequired);
      test.isTrue(_.contains(route.options.roleRequired, 'admin'));
      test.isTrue(_.contains(route.options.roleRequired, 'dev'));
      return test.equal(route.endpoints.get(), 'GET test-route-1');
    });
    it('can be constructed without options', function(test) {
      var route;
      route = new this.Route(new this.Restivus(), 'test-route-2', {
        get: function() {
          return 'GET test-route-2';
        }
      });
      test.equal(route.path, 'test-route-2');
      return test.equal(route.endpoints.get(), 'GET test-route-2');
    });
    it('should support endpoints for all HTTP methods', function(test) {
      var route;
      route = new this.Route(new this.Restivus(), 'test-route-3', {
        get: function() {
          return 'GET test-route-2';
        },
        post: function() {
          return 'POST test-route-2';
        },
        put: function() {
          return 'PUT test-route-2';
        },
        patch: function() {
          return 'PATCH test-route-2';
        },
        delete: function() {
          return 'DELETE test-route-2';
        },
        options: function() {
          return 'OPTIONS test-route-2';
        }
      });
      test.equal(route.endpoints.get(), 'GET test-route-2');
      test.equal(route.endpoints.post(), 'POST test-route-2');
      test.equal(route.endpoints.put(), 'PUT test-route-2');
      test.equal(route.endpoints.patch(), 'PATCH test-route-2');
      test.equal(route.endpoints.delete(), 'DELETE test-route-2');
      return test.equal(route.endpoints.options(), 'OPTIONS test-route-2');
    });
    return context('that\'s initialized without options', function() {
      return it('should have the default configuration', function(test) {
        test.equal(Restivus.config.apiPath, 'api/');
        test.isFalse(Restivus.config.useAuth);
        test.isFalse(Restivus.config.prettyJson);
        return test.equal(Restivus.config.auth.token, 'services.resume.loginTokens.hashedToken');
      });
    });
  });
}
```

Response:
if Meteor.isServer

  describe 'A route', ->

    it 'can be constructed with options', (test) ->
      route = new @Route new @Restivus, 'test-route-1', {authRequired: true, roleRequired: ['admin', 'dev']},
        get: -> 'GET test-route-1'

      test.equal route.path, 'test-route-1'
      test.isTrue route.options.authRequired
      test.isTrue _.contains(route.options.roleRequired, 'admin')
      test.isTrue _.contains(route.options.roleRequired, 'dev')
      test.equal route.endpoints.get(), 'GET test-route-1'

    it 'can be constructed without options', (test) ->
      route = new @Route new @Restivus, 'test-route-2',
        get: -> 'GET test-route-2'

      test.equal route.path, 'test-route-2'
      test.equal route.endpoints.get(), 'GET test-route-2'

    it 'should support endpoints for all HTTP methods', (test) ->
      route = new @Route new @Restivus, 'test-route-3',
        get: -> 'GET test-route-2'
        post: -> 'POST test-route-2'
        put: -> 'PUT test-route-2'
        patch: -> 'PATCH test-route-2'
        delete: -> 'DELETE test-route-2'
        options: -> 'OPTIONS test-route-2'

      test.equal route.endpoints.get(), 'GET test-route-2'
      test.equal route.endpoints.post(), 'POST test-route-2'
      test.equal route.endpoints.put(), 'PUT test-route-2'
      test.equal route.endpoints.patch(), 'PATCH test-route-2'
      test.equal route.endpoints.delete(), 'DELETE test-route-2'
      test.equal route.endpoints.options(), 'OPTIONS test-route-2'

    context 'that\'s initialized without options', ->
     it 'should have the default configuration', (test) ->
       test.equal Restivus.config.apiPath, 'api/'
       test.isFalse Restivus.config.useAuth
       test.isFalse Restivus.config.prettyJson
       test.equal Restivus.config.auth.token, 'services.resume.loginTokens.hashedToken'


Prompt:
if Meteor.isServer

  describe 'A route', ->

    it 'can be constructed with options', (test) ->
      route = new @Route new @Restivus, 'test-route-1', {authRequired: true, roleRequired: ['admin', 'dev']},
        get: -> 'GET test-route-1'

      test.equal route.path, 'test-route-1'
      test.isTrue route.options.authRequired
      test.isTrue _.contains(route.options.roleRequired, 'admin')
      test.isTrue _.contains(route.options.roleRequired, 'dev')
      test.equal route.endpoints.get(), 'GET test-route-1'

    it 'can be constructed without options', (test) ->
      route = new @Route new @Restivus, 'test-route-2',
        get: -> 'GET test-route-2'

      test.equal route.path, 'test-route-2'
      test.equal route.endpoints.get(), 'GET test-route-2'

    it 'should support endpoints for all HTTP methods', (test) ->

Response:
route = new @Route new @Restivus, 'test-route-3',
        get: -> 'GET test-route-2'
        post: -> 'POST test-route-2'
        put: -> 'PUT test-route-2'
        patch: -> 'PATCH test-route-2'
        delete: -> 'DELETE test-route-2'
        options: -> 'OPTIONS test-route-2'

      test.equal route.endpoints.get(), 'GET test-route-2'
      test.equal route.endpoints.post(), 'POST test-route-2'
      test.equal route.endpoints.put(), 'PUT test-route-2'
      test.equal route.endpoints.patch(), 'PATCH test-route-2'
      test.equal route.endpoints.delete(), 'DELETE test-route-2'
      test.equal route.endpoints.options(), 'OPTIONS test-route-2'

    context 'that\'s initialized without options', ->
     it 'should have the default configuration', (test) ->
       test.equal Restivus.config.apiPath, 'api/'
       test.isFalse Restivus.config.useAuth
       test.isFalse Restivus.config.prettyJson
       test.equal Restivus.config.auth.token, 'services.resume.loginTokens.hashedToken'


Response:
if Meteor.isServer

  describe 'A route', ->

    it 'can be constructed with options', (test) ->
      route = new @Route new @Restivus, 'test-route-1', {authRequired: true, roleRequired: ['admin', 'dev']},
        get: -> 'GET test-route-1'

      test.equal route.path, 'test-route-1'
      test.isTrue route.options.authRequired
      test.isTrue _.contains(route.options.roleRequired, 'admin')
      test.isTrue _.contains(route.options.roleRequired, 'dev')
      test.equal route.endpoints.get(), 'GET test-route-1'

    it 'can be constructed without options', (test) ->
      route = new @Route new @Restivus, 'test-route-2',
        get: -> 'GET test-route-2'

      test.equal route.path, 'test-route-2'
      test.equal route.endpoints.get(), 'GET test-route-2'

    it 'should support endpoints for all HTTP methods', (test) ->
      route = new @Route new @Restivus, 'test-route-3',
        get: -> 'GET test-route-2'
        post: -> 'POST test-route-2'
        put: -> 'PUT test-route-2'
        patch: -> 'PATCH test-route-2'
        delete: -> 'DELETE test-route-2'
        options: -> 'OPTIONS test-route-2'

      test.equal route.endpoints.get(), 'GET test-route-2'
      test.equal route.endpoints.post(), 'POST test-route-2'
      test.equal route.endpoints.put(), 'PUT test-route-2'
      test.equal route.endpoints.patch(), 'PATCH test-route-2'
      test.equal route.endpoints.delete(), 'DELETE test-route-2'
      test.equal route.endpoints.options(), 'OPTIONS test-route-2'

    context 'that\'s initialized without options', ->
     it 'should have the default configuration', (test) ->
       test.equal Restivus.config.apiPath, 'api/'
       test.isFalse Restivus.config.useAuth
       test.isFalse Restivus.config.prettyJson
       test.equal Restivus.config.auth.token, 'services.resume.loginTokens.token'


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
if Meteor.isServer

  describe 'A route', ->

    it 'can be constructed with options', (test) ->
      route = new @Route new @Restivus, 'test-route-1', {authRequired: true, roleRequired: ['admin', 'dev']},
        get: -> 'GET test-route-1'

      test.equal route.path, 'test-route-1'
      test.isTrue route.options.authRequired
      test.isTrue _.contains(route.options.roleRequired, 'admin')
      test.isTrue _.contains(route.options.roleRequired, 'dev')
      test.equal route.endpoints.get(), 'GET test-route-1'

    it 'can be constructed without options', (test) ->
      route = new @Route new @Restivus, 'test-route-2',
        get: -> 'GET test-route-2'

      test.equal route.path, 'test-route-2'
      test.equal route.endpoints.get(), 'GET test-route-2'

    it 'should support endpoints for all HTTP methods', (test) ->
      route = new @Route new @Restivus, 'test-route-3',
        get: -> 'GET test-route-2'
        post: -> 'POST test-route-2'
        put: -> 'PUT test-route-2'
        patch: -> 'PATCH test-route-2'
        delete: -> 'DELETE test-route-2'
        options: -> 'OPTIONS test-route-2'

      test.equal route.endpoints.get(), 'GET test-route-2'
      test.equal route.endpoints.post(), 'POST test-route-2'
      test.equal route.endpoints.put(), 'PUT test-route-2'
      test.equal route.endpoints.patch(), 'PATCH test-route-2'
      test.equal route.endpoints.delete(), 'DELETE test-route-2'
      test.equal route.endpoints.options(), 'OPTIONS test-route-2'

    context 'that\'s initialized without options', ->
     it 'should have the default configuration', (test) ->
       test.equal Restivus.config.apiPath, 'api/'
       test.isFalse Restivus.config.useAuth
       test.isFalse Restivus.config.prettyJson
       test.equal Restivus.config.auth.token, 'services.resume.loginTokens.token'
```

Response:
if (Meteor.isServer) {
  describe('A route', function() {
    it('can be constructed with options', function(test) {
      var route;
      route = new this.Route(new this.Restivus(), 'test-route-1', {
        authRequired: true,
        roleRequired: ['admin', 'dev']
      }, {
        get: function() {
          return 'GET test-route-1';
        }
      });
      test.equal(route.path, 'test-route-1');
      test.isTrue(route.options.authRequired);
      test.isTrue(_.contains(route.options.roleRequired, 'admin'));
      test.isTrue(_.contains(route.options.roleRequired, 'dev'));
      return test.equal(route.endpoints.get(), 'GET test-route-1');
    });
    it('can be constructed without options', function(test) {
      var route;
      route = new this.Route(new this.Restivus(), 'test-route-2', {
        get: function() {
          return 'GET test-route-2';
        }
      });
      test.equal(route.path, 'test-route-2');
      return test.equal(route.endpoints.get(), 'GET test-route-2');
    });
    it('should support endpoints for all HTTP methods', function(test) {
      var route;
      route = new this.Route(new this.Restivus(), 'test-route-3', {
        get: function() {
          return 'GET test-route-2';
        },
        post: function() {
          return 'POST test-route-2';
        },
        put: function() {
          return 'PUT test-route-2';
        },
        patch: function() {
          return 'PATCH test-route-2';
        },
        delete: function() {
          return 'DELETE test-route-2';
        },
        options: function() {
          return 'OPTIONS test-route-2';
        }
      });
      test.equal(route.endpoints.get(), 'GET test-route-2');
      test.equal(route.endpoints.post(), 'POST test-route-2');
      test.equal(route.endpoints.put(), 'PUT test-route-2');
      test.equal(route.endpoints.patch(), 'PATCH test-route-2');
      test.equal(route.endpoints.delete(), 'DELETE test-route-2');
      return test.equal(route.endpoints.options(), 'OPTIONS test-route-2');
    });
    return context('that\'s initialized without options', function() {
      return it('should have the default configuration', function(test) {
        test.equal(Restivus.config.apiPath, 'api/');
        test.isFalse(Restivus.config.useAuth);
        test.isFalse(Restivus.config.prettyJson);
        return test.equal(Restivus.config.auth.token, 'services.resume.loginTokens.token');
      });
    });
  });
}


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
if (Meteor.isServer) {
  describe('A route', function() {
    it('can be constructed with options', function(test) {
      var route;
      route = new this.Route(new this.Restivus(), 'test-route-1', {
        authRequired: true,
        roleRequired: ['admin', 'dev']
      }, {
        get: function() {
          return 'GET test-route-1';
        }
      });
      test.equal(route.path, 'test-route-1');
      test.isTrue(route.options.authRequired);
      test.isTrue(_.contains(route.options.roleRequired, 'admin'));
      test.isTrue(_.contains(route.options.roleRequired, 'dev'));
      return test.equal(route.endpoints.get(), 'GET test-route-1');
    });
    it('can be constructed without options', function(test) {
      var route;
      route = new this.Route(new this.Restivus(), 'test-route-2', {
        get: function() {
          return 'GET test-route-2';
        }
      });
      test.equal(route.path, 'test-route-2');
      return test.equal(route.endpoints.get(), 'GET test-route-2');
    });
    it('should support endpoints for all HTTP methods', function(test) {
      var route;
      route = new this.Route(new this.Restivus(), 'test-route-3', {
        get: function() {
          return 'GET test-route-2';
        },
        post: function() {
          return 'POST test-route-2';
        },
        put: function() {
          return 'PUT test-route-2';
        },
        patch: function() {
          return 'PATCH test-route-2';
        },
        delete: function() {
          return 'DELETE test-route-2';
        },
        options: function() {
          return 'OPTIONS test-route-2';
        }
      });
      test.equal(route.endpoints.get(), 'GET test-route-2');
      test.equal(route.endpoints.post(), 'POST test-route-2');
      test.equal(route.endpoints.put(), 'PUT test-route-2');
      test.equal(route.endpoints.patch(), 'PATCH test-route-2');
      test.equal(route.endpoints.delete(), 'DELETE test-route-2');
      return test.equal(route.endpoints.options(), 'OPTIONS test-route-2');
    });
    return context('that\'s initialized without options', function() {
      return it('should have the default configuration', function(test) {
        test.equal(Restivus.config.apiPath, 'api/');
        test.isFalse(Restivus.config.useAuth);
        test.isFalse(Restivus.config.prettyJson);
        return test.equal(Restivus.config.auth.token, 'services.resume.loginTokens.token');
      });
    });
  });
}
```

Response:
if Meteor.isServer

  describe 'A route', ->

    it 'can be constructed with options', (test) ->
      route = new @Route new @Restivus, 'test-route-1', {authRequired: true, roleRequired: ['admin', 'dev']},
        get: -> 'GET test-route-1'

      test.equal route.path, 'test-route-1'
      test.isTrue route.options.authRequired
      test.isTrue _.contains(route.options.roleRequired, 'admin')
      test.isTrue _.contains(route.options.roleRequired, 'dev')
      test.equal route.endpoints.get(), 'GET test-route-1'

    it 'can be constructed without options', (test) ->
      route = new @Route new @Restivus, 'test-route-2',
        get: -> 'GET test-route-2'

      test.equal route.path, 'test-route-2'
      test.equal route.endpoints.get(), 'GET test-route-2'

    it 'should support endpoints for all HTTP methods', (test) ->
      route = new @Route new @Restivus, 'test-route-3',
        get: -> 'GET test-route-2'
        post: -> 'POST test-route-2'
        put: -> 'PUT test-route-2'
        patch: -> 'PATCH test-route-2'
        delete: -> 'DELETE test-route-2'
        options: -> 'OPTIONS test-route-2'

      test.equal route.endpoints.get(), 'GET test-route-2'
      test.equal route.endpoints.post(), 'POST test-route-2'
      test.equal route.endpoints.put(), 'PUT test-route-2'
      test.equal route.endpoints.patch(), 'PATCH test-route-2'
      test.equal route.endpoints.delete(), 'DELETE test-route-2'
      test.equal route.endpoints.options(), 'OPTIONS test-route-2'

    context 'that\'s initialized without options', ->
     it 'should have the default configuration', (test) ->
       test.equal Restivus.config.apiPath, 'api/'
       test.isFalse Restivus.config.useAuth
       test.isFalse Restivus.config.prettyJson
       test.equal Restivus.config.auth.token, 'services.resume.loginTokens.token'


Prompt:
if Meteor.isServer

  describe 'A route', ->

    it 'can be constructed with options', (test) ->
      route = new @Route new @Restivus, 'test-route-1', {authRequired: true, roleRequired: ['admin', 'dev']},
        get: -> 'GET test-route-1'

      test.equal route.path, 'test-route-1'
      test.isTrue route.options.authRequired
      test.isTrue _.contains(route.options.roleRequired, 'admin')
      test.isTrue _.contains(route.options.roleRequired, 'dev')
      test.equal route.endpoints.get(), 'GET test-route-1'

    it 'can be constructed without options', (test) ->
      route = new @Route new @Restivus, 'test-route-2',
        get: -> 'GET test-route-2'

      test.equal route.path, 'test-route-2'
      test.equal route.endpoints.get(), 'GET test-route-2'

    it 'should support endpoints for all HTTP methods', (test) ->

Response:
route = new @Route new @Restivus, 'test-route-3',
        get: -> 'GET test-route-2'
        post: -> 'POST test-route-2'
        put: -> 'PUT test-route-2'
        patch: -> 'PATCH test-route-2'
        delete: -> 'DELETE test-route-2'
        options: -> 'OPTIONS test-route-2'

      test.equal route.endpoints.get(), 'GET test-route-2'
      test.equal route.endpoints.post(), 'POST test-route-2'
      test.equal route.endpoints.put(), 'PUT test-route-2'
      test.equal route.endpoints.patch(), 'PATCH test-route-2'
      test.equal route.endpoints.delete(), 'DELETE test-route-2'
      test.equal route.endpoints.options(), 'OPTIONS test-route-2'

    context 'that\'s initialized without options', ->
     it 'should have the default configuration', (test) ->
       test.equal Restivus.config.apiPath, 'api/'
       test.isFalse Restivus.config.useAuth
       test.isFalse Restivus.config.prettyJson
       test.equal Restivus.config.auth.token, 'services.resume.loginTokens.token'


Response:
objectDiff = (obj1, obj2, options = {}) ->
  result = {}
  score = 0

  for own key, value1 of obj1 when !(key of obj2)
    result["#{key}__deleted"] = value1
    score -= 30

  for own key, value2 of obj2 when !(key of obj1)
    result["#{key}__added"] = value2
    score -= 30

  for own key, value1 of obj1 when key of obj2
    score += 20
    value2 = obj2[key]
    [subscore, change] = diffWithScore(value1, value2, options)
    if change
      result[key] = change
    else
      result[key] = value1
      # console.log "key #{key} subscore=#{subscore} #{value1}"
    score += Math.min(20, Math.max(-10, subscore / 5))  # BATMAN!

  if Object.keys(result).length is 0
    [score, result] = [100 * Math.max(Object.keys(obj1).length, 0.5), undefined]
  else
    score = Math.max(0, score)

  # console.log "objectDiff(#{JSON.stringify(obj1, null, 2)} <=> #{JSON.stringify(obj2, null, 2)}) == #{JSON.stringify([score, result])}"

  return [score, result]


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
objectDiff = (obj1, obj2, options = {}) ->
  result = {}
  score = 0

  for own key, value1 of obj1 when !(key of obj2)
    result["#{key}__deleted"] = value1
    score -= 30

  for own key, value2 of obj2 when !(key of obj1)
    result["#{key}__added"] = value2
    score -= 30

  for own key, value1 of obj1 when key of obj2
    score += 20
    value2 = obj2[key]
    [subscore, change] = diffWithScore(value1, value2, options)
    if change
      result[key] = change
    else
      result[key] = value1
      # console.log "key #{key} subscore=#{subscore} #{value1}"
    score += Math.min(20, Math.max(-10, subscore / 5))  # BATMAN!

  if Object.keys(result).length is 0
    [score, result] = [100 * Math.max(Object.keys(obj1).length, 0.5), undefined]
  else
    score = Math.max(0, score)

  # console.log "objectDiff(#{JSON.stringify(obj1, null, 2)} <=> #{JSON.stringify(obj2, null, 2)}) == #{JSON.stringify([score, result])}"

  return [score, result]
```

Response:
var objectDiff,
  hasProp = {}.hasOwnProperty;

objectDiff = function(obj1, obj2, options = {}) {
  var change, key, result, score, subscore, value1, value2;
  result = {};
  score = 0;
  for (key in obj1) {
    if (!hasProp.call(obj1, key)) continue;
    value1 = obj1[key];
    if (!(!(key in obj2))) {
      continue;
    }
    result[`${key}__deleted`] = value1;
    score -= 30;
  }
  for (key in obj2) {
    if (!hasProp.call(obj2, key)) continue;
    value2 = obj2[key];
    if (!(!(key in obj1))) {
      continue;
    }
    result[`${key}__added`] = value2;
    score -= 30;
  }
  for (key in obj1) {
    if (!hasProp.call(obj1, key)) continue;
    value1 = obj1[key];
    if (!(key in obj2)) {
      continue;
    }
    score += 20;
    value2 = obj2[key];
    [subscore, change] = diffWithScore(value1, value2, options);
    if (change) {
      result[key] = change;
    } else {
      result[key] = value1;
    }
    // console.log "key #{key} subscore=#{subscore} #{value1}"
    score += Math.min(20, Math.max(-10, subscore / 5)); // BATMAN!
  }
  if (Object.keys(result).length === 0) {
    [score, result] = [100 * Math.max(Object.keys(obj1).length, 0.5), void 0];
  } else {
    score = Math.max(0, score);
  }
  // console.log "objectDiff(#{JSON.stringify(obj1, null, 2)} <=> #{JSON.stringify(obj2, null, 2)}) == #{JSON.stringify([score, result])}"
  return [score, result];
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var objectDiff,
  hasProp = {}.hasOwnProperty;

objectDiff = function(obj1, obj2, options = {}) {
  var change, key, result, score, subscore, value1, value2;
  result = {};
  score = 0;
  for (key in obj1) {
    if (!hasProp.call(obj1, key)) continue;
    value1 = obj1[key];
    if (!(!(key in obj2))) {
      continue;
    }
    result[`${key}__deleted`] = value1;
    score -= 30;
  }
  for (key in obj2) {
    if (!hasProp.call(obj2, key)) continue;
    value2 = obj2[key];
    if (!(!(key in obj1))) {
      continue;
    }
    result[`${key}__added`] = value2;
    score -= 30;
  }
  for (key in obj1) {
    if (!hasProp.call(obj1, key)) continue;
    value1 = obj1[key];
    if (!(key in obj2)) {
      continue;
    }
    score += 20;
    value2 = obj2[key];
    [subscore, change] = diffWithScore(value1, value2, options);
    if (change) {
      result[key] = change;
    } else {
      result[key] = value1;
    }
    // console.log "key #{key} subscore=#{subscore} #{value1}"
    score += Math.min(20, Math.max(-10, subscore / 5)); // BATMAN!
  }
  if (Object.keys(result).length === 0) {
    [score, result] = [100 * Math.max(Object.keys(obj1).length, 0.5), void 0];
  } else {
    score = Math.max(0, score);
  }
  // console.log "objectDiff(#{JSON.stringify(obj1, null, 2)} <=> #{JSON.stringify(obj2, null, 2)}) == #{JSON.stringify([score, result])}"
  return [score, result];
};
```

Response:
objectDiff = (obj1, obj2, options = {}) ->
  result = {}
  score = 0

  for own key, value1 of obj1 when !(key of obj2)
    result["#{key}__deleted"] = value1
    score -= 30

  for own key, value2 of obj2 when !(key of obj1)
    result["#{key}__added"] = value2
    score -= 30

  for own key, value1 of obj1 when key of obj2
    score += 20
    value2 = obj2[key]
    [subscore, change] = diffWithScore(value1, value2, options)
    if change
      result[key] = change
    else
      result[key] = value1
      # console.log "key #{key} subscore=#{subscore} #{value1}"
    score += Math.min(20, Math.max(-10, subscore / 5))  # BATMAN!

  if Object.keys(result).length is 0
    [score, result] = [100 * Math.max(Object.keys(obj1).length, 0.5), undefined]
  else
    score = Math.max(0, score)

  # console.log "objectDiff(#{JSON.stringify(obj1, null, 2)} <=> #{JSON.stringify(obj2, null, 2)}) == #{JSON.stringify([score, result])}"

  return [score, result]


Prompt:
objectDiff = (obj1, obj2, options = {}) ->
  result = {}
  score = 0

  for own key, value1 of obj1 when !(key of obj2)
    result["#{key}__deleted"] = value1
    score -= 30

  for own key, value2 of obj2 when !(key of obj1)
    result["#{key}__added"] = value2
    score -= 30

  for own key, value1 of obj1 when key of obj2
    score += 20
    value2 = obj2[key]

Response:
[subscore, change] = diffWithScore(value1, value2, options)
    if change
      result[key] = change
    else
      result[key] = value1
      # console.log "key #{key} subscore=#{subscore} #{value1}"
    score += Math.min(20, Math.max(-10, subscore / 5))  # BATMAN!

  if Object.keys(result).length is 0
    [score, result] = [100 * Math.max(Object.keys(obj1).length, 0.5), undefined]
  else
    score = Math.max(0, score)

  # console.log "objectDiff(#{JSON.stringify(obj1, null, 2)} <=> #{JSON.stringify(obj2, null, 2)}) == #{JSON.stringify([score, result])}"

  return [score, result]


Response:
findMatchingObject = (item, index, fuzzyOriginals) ->
  # console.log "findMatchingObject: " + JSON.stringify({item, fuzzyOriginals}, null, 2)
  bestMatch = null

  matchIndex = 0
  for own key, candidate of fuzzyOriginals when key isnt '__next'
    indexDistance = Math.abs(matchIndex - index)
    if extendedTypeOf(item) == extendedTypeOf(candidate)
      score = diffScore(item, candidate)
      if !bestMatch || score > bestMatch.score || (score == bestMatch.score && indexDistance < bestMatch.indexDistance)
        bestMatch = { score, key, indexDistance }
    matchIndex++

  # console.log "findMatchingObject result = " + JSON.stringify(bestMatch, null, 2)
  bestMatch


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
findMatchingObject = (item, index, fuzzyOriginals) ->
  # console.log "findMatchingObject: " + JSON.stringify({item, fuzzyOriginals}, null, 2)
  bestMatch = null

  matchIndex = 0
  for own key, candidate of fuzzyOriginals when key isnt '__next'
    indexDistance = Math.abs(matchIndex - index)
    if extendedTypeOf(item) == extendedTypeOf(candidate)
      score = diffScore(item, candidate)
      if !bestMatch || score > bestMatch.score || (score == bestMatch.score && indexDistance < bestMatch.indexDistance)
        bestMatch = { score, key, indexDistance }
    matchIndex++

  # console.log "findMatchingObject result = " + JSON.stringify(bestMatch, null, 2)
  bestMatch
```

Response:
var findMatchingObject,
  hasProp = {}.hasOwnProperty;

findMatchingObject = function(item, index, fuzzyOriginals) {
  var bestMatch, candidate, indexDistance, key, matchIndex, score;
  // console.log "findMatchingObject: " + JSON.stringify({item, fuzzyOriginals}, null, 2)
  bestMatch = null;
  matchIndex = 0;
  for (key in fuzzyOriginals) {
    if (!hasProp.call(fuzzyOriginals, key)) continue;
    candidate = fuzzyOriginals[key];
    if (!(key !== '__next')) {
      continue;
    }
    indexDistance = Math.abs(matchIndex - index);
    if (extendedTypeOf(item) === extendedTypeOf(candidate)) {
      score = diffScore(item, candidate);
      if (!bestMatch || score > bestMatch.score || (score === bestMatch.score && indexDistance < bestMatch.indexDistance)) {
        bestMatch = {score, key, indexDistance};
      }
    }
    matchIndex++;
  }
  // console.log "findMatchingObject result = " + JSON.stringify(bestMatch, null, 2)
  return bestMatch;
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var findMatchingObject,
  hasProp = {}.hasOwnProperty;

findMatchingObject = function(item, index, fuzzyOriginals) {
  var bestMatch, candidate, indexDistance, key, matchIndex, score;
  // console.log "findMatchingObject: " + JSON.stringify({item, fuzzyOriginals}, null, 2)
  bestMatch = null;
  matchIndex = 0;
  for (key in fuzzyOriginals) {
    if (!hasProp.call(fuzzyOriginals, key)) continue;
    candidate = fuzzyOriginals[key];
    if (!(key !== '__next')) {
      continue;
    }
    indexDistance = Math.abs(matchIndex - index);
    if (extendedTypeOf(item) === extendedTypeOf(candidate)) {
      score = diffScore(item, candidate);
      if (!bestMatch || score > bestMatch.score || (score === bestMatch.score && indexDistance < bestMatch.indexDistance)) {
        bestMatch = {score, key, indexDistance};
      }
    }
    matchIndex++;
  }
  // console.log "findMatchingObject result = " + JSON.stringify(bestMatch, null, 2)
  return bestMatch;
};
```

Response:
findMatchingObject = (item, index, fuzzyOriginals) ->
  # console.log "findMatchingObject: " + JSON.stringify({item, fuzzyOriginals}, null, 2)
  bestMatch = null

  matchIndex = 0
  for own key, candidate of fuzzyOriginals when key isnt '__next'
    indexDistance = Math.abs(matchIndex - index)
    if extendedTypeOf(item) == extendedTypeOf(candidate)
      score = diffScore(item, candidate)
      if !bestMatch || score > bestMatch.score || (score == bestMatch.score && indexDistance < bestMatch.indexDistance)
        bestMatch = { score, key, indexDistance }
    matchIndex++

  # console.log "findMatchingObject result = " + JSON.stringify(bestMatch, null, 2)
  bestMatch


Prompt:
findMatchingObject = (item, index, fuzzyOriginals) ->
  # console.log "findMatchingObject: " + JSON.stringify({item, fuzzyOriginals}, null, 2)
  bestMatch = null

  matchIndex = 0
  for own key, candidate of fuzzyOriginals when key isnt '__next'
    indexDistance = Math.abs(matchIndex - index)

Response:
if extendedTypeOf(item) == extendedTypeOf(candidate)
      score = diffScore(item, candidate)
      if !bestMatch || score > bestMatch.score || (score == bestMatch.score && indexDistance < bestMatch.indexDistance)
        bestMatch = { score, key, indexDistance }
    matchIndex++

  # console.log "findMatchingObject result = " + JSON.stringify(bestMatch, null, 2)
  bestMatch


Response:
scalarize = (array, originals, fuzzyOriginals) ->
  fuzzyMatches = []
  if fuzzyOriginals
    # Find best fuzzy match for each object in the array
    keyScores = {}
    for item, index in array
      if isScalar item
        continue
      bestMatch = findMatchingObject(item, index, fuzzyOriginals)
      if !keyScores[bestMatch.key] || bestMatch.score > keyScores[bestMatch.key].score
          keyScores[bestMatch.key] = {score: bestMatch.score, index}
    for key, match of keyScores
      fuzzyMatches[match.index] = key

  for item, index in array
    if isScalar item
      item
    else
      key = fuzzyMatches[index] || "__$!SCALAR" + originals.__next++
      originals[key] = item
      key


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
scalarize = (array, originals, fuzzyOriginals) ->
  fuzzyMatches = []
  if fuzzyOriginals
    # Find best fuzzy match for each object in the array
    keyScores = {}
    for item, index in array
      if isScalar item
        continue
      bestMatch = findMatchingObject(item, index, fuzzyOriginals)
      if !keyScores[bestMatch.key] || bestMatch.score > keyScores[bestMatch.key].score
          keyScores[bestMatch.key] = {score: bestMatch.score, index}
    for key, match of keyScores
      fuzzyMatches[match.index] = key

  for item, index in array
    if isScalar item
      item
    else
      key = fuzzyMatches[index] || "__$!SCALAR" + originals.__next++
      originals[key] = item
      key
```

Response:
var scalarize;

scalarize = function(array, originals, fuzzyOriginals) {
  var bestMatch, fuzzyMatches, i, index, item, j, key, keyScores, len, len1, match, results;
  fuzzyMatches = [];
  if (fuzzyOriginals) {
    // Find best fuzzy match for each object in the array
    keyScores = {};
    for (index = i = 0, len = array.length; i < len; index = ++i) {
      item = array[index];
      if (isScalar(item)) {
        continue;
      }
      bestMatch = findMatchingObject(item, index, fuzzyOriginals);
      if (!keyScores[bestMatch.key] || bestMatch.score > keyScores[bestMatch.key].score) {
        keyScores[bestMatch.key] = {
          score: bestMatch.score,
          index
        };
      }
    }
    for (key in keyScores) {
      match = keyScores[key];
      fuzzyMatches[match.index] = key;
    }
  }
  results = [];
  for (index = j = 0, len1 = array.length; j < len1; index = ++j) {
    item = array[index];
    if (isScalar(item)) {
      results.push(item);
    } else {
      key = fuzzyMatches[index] || "__$!SCALAR" + originals.__next++;
      originals[key] = item;
      results.push(key);
    }
  }
  return results;
};


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

scalarize = function(array, originals, fuzzyOriginals) {
  var bestMatch, fuzzyMatches, i, index, item, j, key, keyScores, len, len1, match, results;
  fuzzyMatches = [];
  if (fuzzyOriginals) {
    // Find best fuzzy match for each object in the array
    keyScores = {};
    for (index = i = 0, len = array.length; i < len; index = ++i) {
      item = array[index];
      if (isScalar(item)) {
        continue;
      }
      bestMatch = findMatchingObject(item, index, fuzzyOriginals);
      if (!keyScores[bestMatch.key] || bestMatch.score > keyScores[bestMatch.key].score) {
        keyScores[bestMatch.key] = {
          score: bestMatch.score,
          index
        };
      }
    }
    for (key in keyScores) {
      match = keyScores[key];
      fuzzyMatches[match.index] = key;
    }
  }
  results = [];
  for (index = j = 0, len1 = array.length; j < len1; index = ++j) {
    item = array[index];
    if (isScalar(item)) {
      results.push(item);
    } else {
      key = fuzzyMatches[index] || "__$!SCALAR" + originals.__next++;
      originals[key] = item;
      results.push(key);
    }
  }
  return results;
};
```

Response:
scalarize = (array, originals, fuzzyOriginals) ->
  fuzzyMatches = []
  if fuzzyOriginals
    # Find best fuzzy match for each object in the array
    keyScores = {}
    for item, index in array
      if isScalar item
        continue
      bestMatch = findMatchingObject(item, index, fuzzyOriginals)
      if !keyScores[bestMatch.key] || bestMatch.score > keyScores[bestMatch.key].score
          keyScores[bestMatch.key] = {score: bestMatch.score, index}
    for key, match of keyScores
      fuzzyMatches[match.index] = key

  for item, index in array
    if isScalar item
      item
    else
      key = fuzzyMatches[index] || "__$!SCALAR" + originals.__next++
      originals[key] = item
      key


Prompt:
scalarize = (array, originals, fuzzyOriginals) ->
  fuzzyMatches = []
  if fuzzyOriginals
    # Find best fuzzy match for each object in the array
    keyScores = {}
    for item, index in array
      if isScalar item
        continue
      bestMatch = findMatchingObject(item, index, fuzzyOriginals)
      if !keyScores[bestMatch.key] || bestMatch.score > keyScores[bestMatch.key].score

Response:
keyScores[bestMatch.key] = {score: bestMatch.score, index}
    for key, match of keyScores
      fuzzyMatches[match.index] = key

  for item, index in array
    if isScalar item
      item
    else
      key = fuzzyMatches[index] || "__$!SCALAR" + originals.__next++
      originals[key] = item
      key


Response:
descalarize = (item, originals) ->
  if isScalarized(item, originals)
    originals[item]
  else
    item


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
descalarize = (item, originals) ->
  if isScalarized(item, originals)
    originals[item]
  else
    item
```

Response:
var descalarize;

descalarize = function(item, originals) {
  if (isScalarized(item, originals)) {
    return originals[item];
  } else {
    return item;
  }
};


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

descalarize = function(item, originals) {
  if (isScalarized(item, originals)) {
    return originals[item];
  } else {
    return item;
  }
};
```

Response:
descalarize = (item, originals) ->
  if isScalarized(item, originals)
    originals[item]
  else
    item


Response:
arrayDiff = (obj1, obj2, options = {}) ->
  originals1 = { __next: 1 }
  seq1 = scalarize(obj1, originals1)
  originals2 = { __next: originals1.__next }
  seq2 = scalarize(obj2, originals2, originals1)

  opcodes = new SequenceMatcher(null, seq1, seq2).getOpcodes()

  # console.log "arrayDiff:\nobj1 = #{JSON.stringify(obj1, null, 2)}\nobj2 = #{JSON.stringify(obj2, null, 2)}\nseq1 = #{JSON.stringify(seq1, null, 2)}\nseq2 = #{JSON.stringify(seq2, null, 2)}\nopcodes = #{JSON.stringify(opcodes, null, 2)}"

  result = []
  score = 0

  allEqual = yes
  for [op, i1, i2, j1, j2] in opcodes
    if !(op is 'equal' or (options.keysOnly and op is 'replace'))
      allEqual = no

    switch op
      when 'equal'
        for i in [i1 ... i2]
          item = seq1[i]
          if isScalarized(item, originals1)
            unless isScalarized(item, originals2)
              throw new AssertionError("internal bug: isScalarized(item, originals1) != isScalarized(item, originals2) for item #{JSON.stringify(item)}")
            item1 = descalarize(item, originals1)
            item2 = descalarize(item, originals2)
            change = diff(item1, item2, options)
            if change
              result.push ['~', change]
              allEqual = no
            else
              result.push [' ', item1]
          else
            result.push [' ', item]
          score += 10
      when 'delete'
        for i in [i1 ... i2]
          result.push ['-', descalarize(seq1[i], originals1)]
          score -= 5
      when 'insert'
        for j in [j1 ... j2]
          result.push ['+', descalarize(seq2[j], originals2)]
          score -= 5
      when 'replace'
        if !options.keysOnly
          for i in [i1 ... i2]
            result.push ['-', descalarize(seq1[i], originals1)]
            score -= 5
          for j in [j1 ... j2]


Prompt:
arrayDiff = (obj1, obj2, options = {}) ->
  originals1 = { __next: 1 }
  seq1 = scalarize(obj1, originals1)
  originals2 = { __next: originals1.__next }
  seq2 = scalarize(obj2, originals2, originals1)

  opcodes = new SequenceMatcher(null, seq1, seq2).getOpcodes()

  # console.log "arrayDiff:\nobj1 = #{JSON.stringify(obj1, null, 2)}\nobj2 = #{JSON.stringify(obj2, null, 2)}\nseq1 = #{JSON.stringify(seq1, null, 2)}\nseq2 = #{JSON.stringify(seq2, null, 2)}\nopcodes = #{JSON.stringify(opcodes, null, 2)}"

  result = []
  score = 0

  allEqual = yes
  for [op, i1, i2, j1, j2] in opcodes
    if !(op is 'equal' or (options.keysOnly and op is 'replace'))
      allEqual = no

    switch op
      when 'equal'
        for i in [i1 ... i2]
          item = seq1[i]
          if isScalarized(item, originals1)
            unless isScalarized(item, originals2)
              throw new AssertionError("internal bug: isScalarized(item, originals1) != isScalarized(item, originals2) for item #{JSON.stringify(item)}")

Response:
item1 = descalarize(item, originals1)
            item2 = descalarize(item, originals2)
            change = diff(item1, item2, options)
            if change
              result.push ['~', change]
              allEqual = no
            else
              result.push [' ', item1]
          else
            result.push [' ', item]
          score += 10
      when 'delete'
        for i in [i1 ... i2]
          result.push ['-', descalarize(seq1[i], originals1)]
          score -= 5
      when 'insert'
        for j in [j1 ... j2]
          result.push ['+', descalarize(seq2[j], originals2)]
          score -= 5
      when 'replace'
        if !options.keysOnly
          for i in [i1 ... i2]
            result.push ['-', descalarize(seq1[i], originals1)]
            score -= 5
          for j in [j1 ... j2]


Response:
result.push ['+', descalarize(seq2[j], originals2)]
            score -= 5
        else
          for i in [i1 ... i2]
            change = diff(descalarize(seq1[i], originals1), descalarize(seq2[i - i1 + j1], originals2), options)
            if change
              result.push ['~', change]
              allEqual = no
            else
              result.push [' ']

  if allEqual or (opcodes.length is 0)
    # result = undefined
    score  = 100
  else
    score  = Math.max(0, score)

  return [score, result]


Prompt:
result.push ['+', descalarize(seq2[j], originals2)]
            score -= 5
        else
          for i in [i1 ... i2]
            change = diff(descalarize(seq1[i], originals1), descalarize(seq2[i - i1 + j1], originals2), options)
            if change
              result.push ['~', change]
              allEqual = no
            else

Response:
result.push [' ']

  if allEqual or (opcodes.length is 0)
    # result = undefined
    score  = 100
  else
    score  = Math.max(0, score)

  return [score, result]