Skip to content
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

Don't mangle the original objects when deep === true #6

Closed
wants to merge 1 commit into from

Conversation

papandreou
Copy link
Contributor

Test case:

var cjson = require('cjson');
var one = {a: {b: 1}},
    two = {a: {b: 2}};

console.log(cjson.extend(true, {}, one, two));

Output:

{ a: { b: 2 }}

... which is correct, but one has also been changed:

console.log(one);

Output:

{ a: { b: 2 }}

@papandreou
Copy link
Contributor Author

@kof Ping?

@kof
Copy link
Owner

kof commented Sep 19, 2012

oh sorry forgot this one, will take a look tomorrow!

@kof kof closed this in d3eca92 Sep 20, 2012
@kof
Copy link
Owner

kof commented Sep 20, 2012

Thanks for you pull, couldn't merge it because of its quality, but the bug is fixed now and tests are added.

@papandreou
Copy link
Contributor Author

Thanks for fixing it, but please tell me what you mean by "because of its quality"?

@kof
Copy link
Owner

kof commented Sep 20, 2012

you are generating a function inside of the "for" loop, it is much more code than needed, lack of tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants