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

when doesn't work on range loops/comprehensions #285

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

when doesn't work on range loops/comprehensions #285

aroben opened this issue Feb 7, 2014 · 0 comments

Comments

@aroben
Copy link

aroben commented Feb 7, 2014

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

jashkenas/coffee-script says:

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

console.log((function() {
  var _i, _results;
  _results = [];
  for (n = _i = 0; _i <= 5; n = ++_i) {
    if (n % 2) {
      _results.push(n);
    }
  }
  return _results;
})());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant