-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Copy object to prevent exception in react native #960
Conversation
What if we do something else here and just check for |
|
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.
Use objectMerge
I would check for the existence of isFrozen and skip if we have that function and the object is frozen. That entire branch only matters for react native. |
Yea, sure, I don't have any opinion on what the right thing to be doing is here w.r.t. react-native etc, just want to make sure we keep compatibility in good shape. |
@HazAT – Can we add some kind of cursory test? Then I'd be glad to approve. |
src/raven.js
Outdated
@@ -1779,6 +1780,13 @@ function objectMerge(obj1, obj2) { | |||
return obj1; | |||
} | |||
|
|||
function objectFrozen(obj) { |
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.
@HazAT – would you mind adding a comment about why we do this for react native, and why it's okay if Object.isFrozen
isn't called in environments where it isn't supported (maybe link to this PR?). Last thing and then I'll merge.
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.
Of course makes sense 👍
This fixes:
getsentry/sentry-react-native#57
getsentry/sentry-react-native#64