tapjs / stack-utils

Captures and cleans stack traces.
https://www.npmjs.com/package/stack-utils
MIT License
190 stars 35 forks source link

`at` and `parseLine` have almost (but not quite) identical output formats. #4

Closed jamestalmage closed 7 years ago

jamestalmage commented 8 years ago

The output of at and parseLine are nearly identical. parseLine just does some extra processing of evalOrigin to split it into evalLine, evalColumn and evalFile.

Seems easy enough to make the two outputs identical.

Perhaps at could even just be reduced to:

this.parseLine(this.captureString({limit: 1, stackStartFunction: fn});

Currently at utilizes the CallSite API directly instead of parsing a string, maybe it's better to stick with that.

isaacs commented 7 years ago

I'm fine avoiding additional string munging. The CallSite API is much more authoritative and less prone to parse errors, since it comes direct from the VM.

If someone comes along asking for evalFile/Line/Column, we can probably tack it onto the returned value by splitting out the parsing of evalOrigin into a separate file.