http://www.9cbs.net/expert/topic/945/945526.xml?temp=.313244
Implementation method is a reference to the first object's spatial reference by constructor.singleton by a method for constructor.
Function myclass () {var fs = function (fs) {return fs.caller}; fs = fs (fs); if (fs.singleton) {return fs.singleton ();} return new innerclass ();
Function innerclass () {this.r = math.random (); // test; var innerObject = this; function fs.singleton () {return innerObject;}}} allert ()}} Alert (). r); alert (new " Myclass (). R); Alert (new myclass (). R); Alert (new myclass (). R);