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

fix: clone() cloning prototype's custom methods #1078

Closed
wants to merge 0 commits into from

Conversation

jettcalleja
Copy link

clone method in common.js will also clone the prototype custom methods

var a = [1,2];
Array.prototype.try = function() {return true;};
winston.info(a);  // info:  0=1, 1=2, try=function () {return true;}

@indexzero
Copy link
Member

It's generally considered a bad practice to modify the Array prototype. Will consider landing this on the 2.x branch after [email protected] hits the wild in about a week.

@jettcalleja
Copy link
Author

I agree it is a bad practice, but I did this to catch this modifying prototypes and avoid logging them. Thanks for the consideration!

@jettcalleja
Copy link
Author

@indexzero travis-ci became fail, will this be landing on the 2.x?

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

Successfully merging this pull request may close these issues.

2 participants