You need partners around your function
var Blah2 = (function(){ this.w = function(s){Response.write(s);}
Also, this.w does not do what you want. this actually points to a global object right there. Do you want to:
var Blah2 = (function(){ return {w : function(s){ Response.write(s); }}; }());
or
bar Blah2 = new (function(){ ...
source share