-
Notifications
You must be signed in to change notification settings - Fork 11
Combine exception stacks lazily where possible #1
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
Combine exception stacks lazily where possible #1
Conversation
Omigod that rocks! Great idea. I'll do some testing of my own and maybe even add some new tests to specifically cover this, but yes, I'll be glad to merge this PR. |
Actually... I may not have the time to get to this myself for a week or two. So why wait? :) Would you mind adding a test case to hit this line of code? It's the only branch that's not currently covered. If you'll do that, I'll merge the PR ASAP |
Is the coverage only from node? I can patch a global to simulate the fallback to hit that case. |
The coverage data includes node and browsers. (all the However, I just noticed that I only have KARMA_COVERAGE=true set for one of the CI builds, and that buid only includes Firefox and PhantomJS. Try setting KARMA_COVERAGE=true for the SauceLabs build. That build covers all browsers, so maybe one of them will hit that line of code. |
I'm fairly sure firefox should hit that line, i'll give it a go. |
8e0026b
to
b906674
Compare
b906674
to
8da99f7
Compare
That's all passing now and executing the line from before (older versions of firefox made As part of these changes I broke a long line up and because this is line coverage and not branch coverage, it's not getting hit any more. The line in question is https://coveralls.io/builds/4946993/source?filename=lib%2Findex.js#L192 which can only be hit if This is only needed for IE8 support - is that a goal? |
IE8 support isn't necessary, but it doesn't hurt to leave that line in there just in case. I'm ok with it not being hit. Thanks for all your work! Merging in 3... 2... 1... |
Combine exception stacks lazily where possible
Onoes! The tests are failing on Android due to the I'll make a quick change to avoid adding that property. |
Thanks! Do the android tests only run on the main branch? |
I have no idea why the Android tests didn't fail on the PR branch. They appear to have run successfully there. No clue. |
This is a bit wacky, but I figured I'd send in the PR and see what you think.
I did a big survey of error / exception libs I could find on npm today, and this one ticked the boxes I was looking for - attaching arbitrary data, and concatenating stack traces together.
One thing I was hoping to find was a lib which only attached the stack traces together if the
.stack
property is read - especially on v8 where this property is lazily calculated.This PR attempts to detect if this is possible in the executing runtime, and then does so.
Passes tests on Karma and Node locally, but there might be something I've missed still