Archive: November 2008

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 ...

Instance private, class private, package and friends

Update: This is flawed. See details at the end. This post was inspired by a post that Robert Nyman wrote a while back. At the same time I was thinking about how to achieve private fields without the memory issues. JavaScript does not have private members as understood by a lot of other object oriented ...