-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
objectMerge Add to trimHeadFrames if capturing new trace #1216
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
Conversation
src/raven.js
Outdated
stacktrace: true // if we fall back to captureMessage, default to attempting a new trace | ||
}, | ||
options | ||
trimHeadFrames: ((options && options.trimHeadFrames) || 0) + 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we set the default for options
at the top of the method while also making a copy?
options = options ? Object.merge({}, options) : {}
and then just leave (options.trimHeadFrames || 0) + 1
?
We also don't need a double objectMerge
, as it can be done in a single call when we do so:
objectMerge(options, {
stacktrace: true,
trimHeadFrames: (options.trimHeadFrames || 0) + 1
})
Although I'm not sure if we cannot just reverse it, even though it's reference and write
objectMerge(options, {
stacktrace: true,
trimHeadFrames: (options.trimHeadFrames || 0) + 1
})
without making a copy, as objectMerge
is just reassigning values by key anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like a good idea! Thanks!
You missed a comma after
|
Fixed it myself and rebase manually. Thanks! :) |
Sorry, thanks for picking that up! |
I can't see this fix on any of the active branches... did it get lost? |
50beaa5 first at the top. I'll make a release within next 20-30min. |
Released as |
Awesome, thanks! |
Otherwise the original trim value will be off by one.