Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

fix: shallow-clone context instead of deep-copy #452

Merged
merged 1 commit into from
Apr 24, 2018
Merged

Conversation

kamilogorek
Copy link
Contributor

Fixes #451

I'm not sure if this should be 2.5.1 or 2.6.0 though. Thoughts?

@@ -333,8 +333,7 @@ extend(Raven.prototype, {
cb = kwargs;
kwargs = {};
} else {
// Do not use reference, as we'll modify this object later on
kwargs = kwargs ? JSON.parse(stringify(kwargs)) : {};
kwargs = utils.isPlainObject(kwargs) ? extend({}, kwargs) : {};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extend({}, 'something') will treat each letter as a key so we want to avoid it

@@ -359,7 +340,7 @@ describe('raven.Client', function() {
foo: null
}
};
kwargs.extra.foo = kwargs;
kwargs.extra.foo = kwargs.extra;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It had to be changed, as referencing kwargs directly wouldn't work in this test, as it's not the same reference anymore.

@kamilogorek kamilogorek requested a review from a team April 24, 2018 08:47
Copy link
Member

@mitsuhiko mitsuhiko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor release should be fine.

@kamilogorek kamilogorek merged commit 170a1a2 into master Apr 24, 2018
@kamilogorek kamilogorek deleted the fix-clone-issue branch April 24, 2018 09:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants