Using catch-alls to implement super in SpiderMonkey

Another thing that always been bothering me about OOP in JS is that calling super is such a pain. Some libraries do ugly hacks like checking the source (by calling toString on their constructor and method function objects) and then wrap the original function in another function that encapsulates a variable called super. Other libraries ...

Computed vs Cascaded Style

Most JS frameworks and libraries I’ve seen have a function similar to this: function getStyle(el, prop) { if (document.defaultView && document.defaultView.getComputedStyle) { return document.defaultView.getComputedStyle(el, null)[prop]; } else if (el.currentStyle) { return el.currentStyle[prop]; } else { return el.style[prop]; } } So what is wrong with this you might ask? Lets add some background and then we ...

Tamarin

I guess you all heard that MacromediaAdobe donated their JIT compiler version of JavaScript to Mozilla. Tamarin is the JIT for Action Script 3 (AS3) which is a version of ECMAScript 3rd Edition. Using a JIT should improvement of JavaScript by at least 10x. This is of course very good news. However a lot of ...

JS Generics

With JavaScript 1.6 Mozilla introduced generic version of a lot of the Array and String methods. Without broad support these very useful methods are in reality only available to Firefox and Firefox extension. Personally I’ve become too used to them to survive long without them. I’ve previously posted the JS 1.5 array extras and I’ve ...

Go Glen

This is what Glen Murphy has been working on since he started at Google.

JavaScript 1.6

With the upcoming release of Firefox 1.5 Mozilla have decided to increase their JavaScript version number to 1.6. There are basically three new features since 1.5: ECMAScript 4 XML Array Extras Array and String generics Array and String generics means that some of the methods that are available on Array.prototype and String.prototype are now also ...

For Each Loop in Mozilla

I’m not entirely sure when Mozilla started to support for each loops but I guess it was part of the E4X code checkins. Anyway, I was totally shocked when I saw it and I fired up a quick test. var o = {a: "A", b: "B", c: "C"}; for each (var v in o) { ...

Stop-Reload-Button in Firefox

One nice little extension I usually install on Firefox is an extension that merges the reload and stop button. It hides the stop button when it is disabled and shows the reload button when the stop button is not available. However, the extension is not compatible with DPA2 or the latest nighlies. After installing and ...

Firefox 1.0.3.1?

Firefox 1.0.3 was a serious mistake. It basically breaks any application designed to be used with both MSXML and XMLHttpRequest because it breaks the prototype chain on getters for native objects. For example it breaks Sarrissa, Bindows, WebFX’s XML Extras, WebFX’s IE Emu, some code at Forgetfoo’s site as well as a lot of other ...

Google snags another one (part 2)

Ben Goodger, the lead developer of Mozilla Firefox is now employed by Google. What does this mean for Firefox? Probably not much since he is still working (“devoted”) full time with Firefox, he’s just gettting paid from Google instead of the Mozilla Foundation. What does this mean for Google? This is probably bigger but who ...