You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Failed at: index.ls
ReferenceError: ind is not defined
at Object.<anonymous> (/tmp/livescript-test/index.ls:5:24)
1| // Generated by LiveScript 1.5.0
2| var i$, i;
3| for (i$ = 0; i$ <= 2; ++i$) {
4| i = i$;
5+ console.log('Hello', ind);
6| }
7|
8|
9|
at Module._compile (module.js:571:32)
at Object.LiveScript.run (/tmp/livescript-test/node_modules/livescript/lib/node.js:31:19)
at compileScript (/tmp/livescript-test/node_modules/livescript/lib/command.js:222:31)
at /tmp/livescript-test/node_modules/livescript/lib/command.js:152:11
at /tmp/livescript-test/node_modules/livescript/lib/command.js:142:7
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:416:3)
The problem is that line number 5 reported in error log for index.ls is incorrect in scope of index.ls file. In this example I get a full compiled version as (probably) the demo is short. But when working with bigger files, I do not get a full compiled version, so it becomes difficult to track errors.
I tried to use sourcemaps by running:
lsc -m embedded index.ls
the result is still the same.
Is there a way to make errors show on correct lines in scope of ls files?
OS: Linux
Node.js: 7.5.0
LiveScript: 1.5.0
The text was updated successfully, but these errors were encountered:
pavel
changed the title
Wrong line number reported on error
Wrong line number reported on runtime error
Mar 7, 2017
One thing you could do right now is compile index.ls (with -m embedded, as you discovered) instead of running it directly from lsc, and when you run it, run it with node -r source-map-support/register index.js (after pulling down source-map-support from npm).
I don't have the time right this second to try integrating this functionality into the lsc command when running scripts directly, but it shouldn't be that hard if someone else wanted to try it.
Having a following
index.ls
file:When running it with:
I get the following error:
The problem is that line number
5
reported in error log forindex.ls
is incorrect in scope ofindex.ls
file. In this example I get a full compiled version as (probably) the demo is short. But when working with bigger files, I do not get a full compiled version, so it becomes difficult to track errors.I tried to use sourcemaps by running:
the result is still the same.
Is there a way to make errors show on correct lines in scope of
ls
files?OS: Linux
Node.js: 7.5.0
LiveScript: 1.5.0
The text was updated successfully, but these errors were encountered: