3 ms·
First of all I'm impressed with you being objective and not gnawing my head off even after discovering probably the thorniest part of the library (and so soon t
by Bowser 15y ago
First of all I'm impressed with you being objective and not gnawing my head off even after discovering probably the thorniest part of the library (and so soon too)! I am aware of and on your side about the issues with patching the Object.prototype.
So, to be perfectly clear, the Object prototype will NEVER be modified in any way by default! The "enableSugar" method you have found (so resourcefully, I might add :) ) is something I added in later as an "opt-in" way of using objects as hashes in pages where you ALREADY have assurance that it won't break. It is intended as something of the reverse of "noConflict" in jQuery. By using this method you're basically saying that you're ready to live on the edge and will take responsibility for what breaks. More importantly you can turn it off again if something does start to break.
Now that having been said, even though I've added this method there is ZERO reference in it to the documentation. A few reasons for this: one is the backlash I knew I would get for even MENTIONING the sacred Object prototype (you may have proved that point, heh)... the other is that I'm not sure I ever really want it used... in the first place I sort of intended it as more of an "easter-egg" and I'm not sure I ever want to mention it in the docs...
In any case though it will NEVER be a default, and for precisely the reasons you've mentioned.