Skip to content

Conversation

@haroldo-ok
Copy link

Hello,

I've just corrected a bug on the line number routine, when running on windows: the drive letter got in the way, and the routine returned the file path instead of the line number. I got around it by using a regex to extract the line number. Haven't tested it on Linux, but should work okay, too.

@igo
Copy link
Owner

igo commented Mar 18, 2012

can you please send how does e.stack looks on windows? I want to avoid try-catch block because they are slow.

@haroldo-ok
Copy link
Author

Of course! Here you go:

Error: This is an stack trace test
at Object. (C:\Users\Haroldo\test.js:1:69)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
at Module.load (module.js:348:31)
at Function._load (module.js:308:12)
at Array.0 (module.js:479:10)
at EventEmitter._tickCallback (node.js:192:40)

As you can see, the great villain here is the drive letter, whose
following colon confuses the routine that would pick the line number.

Em 18/03/2012 06:33, Igor Urminček escreveu:

can you please send how does e.stack looks on windows? I want to avoid try-catch block because they are slow.


Reply to this email directly or view it on GitHub:
#10 (comment)

Repository owner deleted a comment Dec 30, 2023
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

Successfully merging this pull request may close these issues.

2 participants