Even today, you shouldn't need to write code like that. Just bind functions to the current scope. That looks something like this (imagine this code is in the context of some object):
element.addEventListener('click', function(e) {
this.foo();
}.bind(this), false);
Notice the call to "bind" which binds the click handler function to the current object, so that inside it can call this.foo().