Subj : Re: Function replacement in SM To : netscape.public.mozilla.jseng From : celsoaguiar@hotmail.com (Celso Aguiar) Date : Fri Dec 05 2003 10:00 am Yes, a script (particularly a rogue one) redeclaring a function we defined in JS and which we call via JS_CallfunctionName. My primary concern was security, but I guess in a case like this what can be done is to have the function defined as a 'const' in the first place. Thanks, and also for the very quick fix on 227432, Celso Brendan Eich wrote in message news:<3FCFFB20.3020601@meer.net>... > Celso Aguiar wrote: > > >Is there a way in SpiderMonkey to detect when a script is trying > >to replace a function (previously defined either from C or JS)? > >Thanks, > > > > > > If you mean a global or top-level function, you could define the global > object's setProperty function to catch cases where scripts assign to the > function's name. Are you also trying to catch the case where a script > redeclares the function as a (different) function? > > /be .