2 ms·
The chance for this to happen should make us think both about a) the language b) the commonly accepted use of language features. How come that user code of any
by alanfranzoni 8y ago
The chance for this to happen should make us think both about a) the language b) the commonly accepted use of language features.
How come that user code of any kind gets to override a builtin prototype, and that people are happy with that?
Would it be THAT bad to create a "mootools.Arrays" object with a "flatten" function? I think that either you've got a way to do such language extensions in a narrow scope (I think Ruby modules can do that, but I should check) so that they don't influence the whole app, or you simply shouldn't do that, period. Crazy interactions are hidden everywhere, otherwise.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#Bad_practice_Extension_of_native_prototypes https://developer.mozilla.org/en-US/docs/Web/JavaScript/Inhe...
"One misfeature that is often used is to extend Object.prototype or one of the other built-in prototypes."