• window.clusterFuck

    I started a project called Terra a few weeks ago. I added a conditional to that would complain if I’d already defined the library: (function (exports) { function init() { if (!exports.terra) { // do initialization things } else { throw 'You’ve already defined terra. Pay attention…'; } } // more stuff happens… init(); })(this); I’ll admit that this is a really ugly pattern for handling namespaces, but even common patterns are affected by this. Let me take you on a journey through the biggest browser wat I’ve ever seen. I ran the code and the console yelled at me. Strange… but maybe I forgot a somewhere. I set some…

    Continue reading