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

parsing bug #4482

Closed
ry opened this issue Mar 24, 2020 · 1 comment · Fixed by #4483
Closed

parsing bug #4482

ry opened this issue Mar 24, 2020 · 1 comment · Fixed by #4483
Labels
bug Something isn't working correctly

Comments

@ry
Copy link
Member

ry commented Mar 24, 2020

v0.37.1

~/src/deno2> deno x.js
thread 'main' panicked at 'assertion failed: lines.len() > line', cli/compilers/ts.rs:557:11
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Error 101 ~/src/deno2> cat x.js
setInterval(() => {
  console.log("hello");
}, 1000),
@ry ry added the bug Something isn't working correctly label Mar 24, 2020
@kevinkassimo
Copy link
Contributor

kevinkassimo commented Mar 24, 2020

This assertion fails due to str::lines() in Rust ignores final empty line, and thus the assertion would fail: https://doc.rust-lang.org/std/primitive.str.html#method.lines

Reading the source code shows that str::lines() uses .split_terminator('\n'). Instead we should just split ourselves with .split('\n'). This is a quick fix I'll do right away

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants