function singleton ( fn ){ var result; return function(){ return result || ( result = fn .apply( this, arguments ) ); } }
单例模式。