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
decaffeinate is producing the wrong JavaScript based on my CoffeeScript input:
a = [1, 2, 3, 4, 5] start = '1' end = '3' console.log a[start..end]
(repl)
I get this output:
a = [1, 2, 3, 4, 5]; start = '1'; end = '3'; console.log(a.slice(start, end + 1 || undefined));
Here's what I expect it to be instead:
a = [1, 2, 3, 4, 5]; start = '1'; end = '3'; console.log(a.slice(start, +end + 1 || undefined));
Otherwise, it takes the range from '1' to '31'.
The text was updated successfully, but these errors were encountered:
fix: ensure that inclusive slice bounds are numbers
af7d2e1
Fixes decaffeinate#882 We need to put a `+` unary op at the front to avoid string concatenation when adding `1`.
fix: ensure that inclusive slice bounds are numbers (#905)
3229126
Fixes #882 We need to put a `+` unary op at the front to avoid string concatenation when adding `1`. Also add a space after the `+` when it would otherwise create `++`.
alangpierce
No branches or pull requests
decaffeinate is producing the wrong JavaScript based on my CoffeeScript input:
(repl)
I get this output:
Here's what I expect it to be instead:
Otherwise, it takes the range from '1' to '31'.
The text was updated successfully, but these errors were encountered: