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

Stack trace wrong line number in REPL mode #1095

Open
anhnhoktvn opened this issue Mar 25, 2020 · 0 comments
Open

Stack trace wrong line number in REPL mode #1095

anhnhoktvn opened this issue Mar 25, 2020 · 0 comments

Comments

@anhnhoktvn
Copy link

anhnhoktvn commented Mar 25, 2020

Hello, I found this bug:

With simple file like this:
File: test.ls

throw Error \line_1

Normally I get this error:

$ lsc test.ls 
Failed at: test.ls
Error: line_1
    at Object.<anonymous> (/home/anhnhoktvn/test.ls:1:7)

In REPL mode it would return wrong line number:

ls> require \./test
/home/anhnhoktvn/.nvm/versions/node/v13.11.0/pnpm-global/3/node_modules/.pnpm/registry.npmjs.org/livescript/1.6.0/node_modules/livescript/lib/node.js:57
      throw hackTrace(e, js, filename);
      ^

Error: line_1
    at Object.<anonymous> (/home/anhnhoktvn/test.ls:2:7)
1| // Generated by LiveScript 1.6.0
2+ throw Error('line_1');
3| //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QubHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE1BQU0sS0FBTixDQUFZLFFBQUEsQ0FBWiIsInNvdXJjZXNDb250ZW50IjpbbnVsbF19
4| 

I expect it shows error at line 1 but in this case it shows line 2.
The source map seems not work in repl mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants