Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loops/comprehensions over decreasing ranges don't work #284

Closed
aroben opened this issue Feb 7, 2014 · 0 comments
Closed

Loops/comprehensions over decreasing ranges don't work #284

aroben opened this issue Feb 7, 2014 · 0 comments
Labels

Comments

@aroben
Copy link

aroben commented Feb 7, 2014

$ coffee -be --cli "console.log (n for n in [5..-5])"
[]
$ coffee -bj --cli "console.log (n for n in [5..-5])"
// Generated by CoffeeScript 2.0.0-beta9-dev
var n;
console.log(function (accum$) {
  for (i$ = 5; i$ <= -5; ++i$) {
    n = i$;
    accum$.push(n);
  }
  return accum$;
}.call(this, []));

jashkenas/coffee-script produces the following:

$ coffee -be "console.log (n for n in [5..-5])"
[ 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5 ]
$ coffee -bce "console.log (n for n in [5..-5])"
// Generated by CoffeeScript 1.7.1
var n;

console.log((function() {
  var _i, _results;
  _results = [];
  for (n = _i = 5; _i >= -5; n = --_i) {
    _results.push(n);
  }
  return _results;
})());

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/2268299-loops-comprehensions-over-decreasing-ranges-don-t-work?utm_campaign=plugin&utm_content=tracker%2F33145&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F33145&utm_medium=issues&utm_source=github).
basicer added a commit to basicer/CoffeeScriptRedux that referenced this issue Apr 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants