Subj : Re: disabling toString() and toSource() for functions To : netscape.public.mozilla.jseng From : Igor Bukanov Date : Wed Jan 19 2005 11:54 am Merten Schumann wrote: > Hm, interesting. Just tried it in Rhino, it works, code of my "hidden" > functions is printend. So users can see what internal variables and all > I do use there ... Hmmm. > > Would be really nice to have something to prevent this > toString()/toSource() stuff, if needed! By overloading the > toString()/toSource() or so, but how to do this for functions? Something > like the ClassShutter mechanism would be helpful ... Use contextInstance.setGeneratingSource(false), http://www.mozilla.org/rhino/apidocs/org/mozilla/javascript/Context.html#setGeneratingSource(boolean) Regards, Igor .