Why does the following code not work in Internet Explorer (I\'ve only tested in IE8 so far):
(function(){
this.foo = function foo(){};
foo.prototype = {
IE has a lot of problems with named function expressions. As you said in your question, stick with this:
this.foo = function (){};
For an in-depth, grueling read on this topic, check out this link
The short of it is that the inner, named function expression is treated as a function declaration, and hoisted up to places it should never, ever be.