And also because it has prevented the language itself from standardizing some features, e.g. String.prototype.contains had to be renamed to includes because shipping it as contains would have broken sites that use mootools.
You're obviously right but could this sort of case not be handled by future versions of JS allow clients to opt in to the prototype being modified, something equivalent to extension methods in .NET where if a client wants to use them they import the associated namespace?
Especially under Node.js prototype modification can be a very big issue. Because once you start any third party module, all bets about knowledge and control of your environment are off. Someone, somewhere down the module chain might have messed with the prototype chain in some way and you won't know it until you run into the resulting bugs.
I've been there, and once you start to see random debug logs popping up in your console because you somehow ended up iterating over a `enumerable` prototype extension in a string "enhancement" library used by a third party module, that is used by a third party module. You'll end up having to take one of three choices: Either modify your code to deal with the mess, contact the author of the string library to fix it (and all upstream authors to update their dependencies) or just drop the top level library altogether. None of these are perfectly clean / easy and in some cases these might they might also be impossible (author cannot be reached, won't change his code, you code can't handle it or you simply cannot drop the third party dependency).
Once you start writing a library, you got quite a bit of responsibility resting on your shoulder to not break things upstream :)
We already averted the "nightmare" of io.js / node.js ending up with different ES6 feature sets, so we shouldn't open a new can of worms.
The Node.js ecosystem is wonderful and that in big part stems from the fact that you can basically install any module at any time and things just work.
> If you've got a fair degree of knowledge and control over what's in your environment (e.g. Things are documented or standardised, you're using node.js), I don't really see the issue.
Are you checking every single library you use for prototype changes, including the libraries each library depends on, the libraries those depend on, etc.?