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

Please do not mutate global prototypes #1

Closed
timoxley opened this issue Jul 19, 2014 · 4 comments
Closed

Please do not mutate global prototypes #1

timoxley opened this issue Jul 19, 2014 · 4 comments

Comments

@timoxley
Copy link

Overriding global prototypes breaks node's module isolation and is generally considered bad practice in JavaScript.

Say you change the api slightly for _s, or discover a bug or improve performance or basically change anything at all about your library. Given that node allows you to have multiple simultaneous versions of the same package installed, which version of _s is actually used? It's determined at run-time (whichever version is loaded last, it could even change as the application runs). This is not how computer should work.

Please don't affect the global state in JavaScript, even if it seems very convenient.

@gabrielelana
Copy link

👍

@gabrielelana
Copy link

@usablica to fix the problem you can adjust the code to be a proper extension for underscore/lodash

@afshinm
Copy link
Contributor

afshinm commented Jul 20, 2014

Thanks for letting me know your feedbacks @timoxley @gabrielelana

I'm going to rewrite it asap.

@afshinm
Copy link
Contributor

afshinm commented Aug 4, 2014

done @timoxley @gabrielelana. Please use v0.2.0

@afshinm afshinm closed this as completed Aug 4, 2014
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

No branches or pull requests

3 participants