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

by doesn't work with range loops/comprehensions #286

Closed
aroben opened this issue Feb 7, 2014 · 1 comment
Closed

by doesn't work with range loops/comprehensions #286

aroben opened this issue Feb 7, 2014 · 1 comment

Comments

@aroben
Copy link

aroben commented Feb 7, 2014

$ coffee -be --cli "console.log (n for n in [0..5] by 2)"
[ 0, 1, 2, 3, 4, 5 ]
$ coffee -bj --cli "console.log (n for n in [0..5] by 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] by 2)"
[ 0, 2, 4 ]
$ coffee -bce "console.log (n for n in [0..5] by 2)"
// Generated by CoffeeScript 1.7.1
var n;

console.log((function() {
  var _i, _results;
  _results = [];
  for (n = _i = 0; _i <= 5; n = _i += 2) {
    _results.push(n);
  }
  return _results;
})());
@michaelficarra
Copy link
Owner

CSR doesn't currently support stepped loops of any kind.

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

2 participants