Ray, weren't you looking at something like this recently? Le 15 avril 2010 17:42, Domingos <mrc...@gmail.com> a écrit :
> Hello everyone, > > Here I am going to suggest other solution to represent the JVM class > singleton behaviour. Look at my suggestion below: > > > var $clinit186 = function() { > // static initialization > }; > > SomeClass .prototype.aMethod = function() { > $clinit186(); > var mth = SomeClass .prototype.aMethod = function(p1, p2) { > > }; > mth.apply(this, arguments); > }; > > > var instance = new SomeClass(); > instance.aMethod (1, 2); > > > > > This solution seams to be much more light weight than da current > solution: > > var $clinit186 = function() { > $clinit186 = nullMethod; > // static initialization > }; > > SomeClass.prototype.aMethod = function(p1, p2) { > > }; > > > var instance = new SomeClass(); > ($clinit186(), instance.aMethod (1, 2)); > > > What do you people think about? > > Best Regards, > Domingos > > -- > http://groups.google.com/group/Google-Web-Toolkit-Contributors > -- http://groups.google.com/group/Google-Web-Toolkit-Contributors