alxlit/coffeescript-php

Fails functions.coffee, function_invocations.coffee for 1.3.1

Closed this issue · 0 comments

The test cases functions.coffee and function_invocations.coffee both fail for the 1.3.1 port of CoffeeScript, however this is due to a bug in the reference 1.3.1 compiler that has been fixed in the port, I think, (and in versions 1.3.2+ of the reference).

Here's the problem:

(splat..., @prop) ->

The reference 1.3.1 compiler will produce...

(function() {
  var __slice = [].slice;

  (function() {
    var splat, _i;
    splat = 2 <= arguments.length ? __slice.call(arguments, 0, _i = arguments.length - 1) : (_i = 0, []), prop = arguments[_i++];
    this.prop = prop;
  });
}).call(this);

...which fails to declare the prop variable. The port will correctly declare it, var prop, splat, _i;