Subj : Re: [spidermonkey] JS_CallFunction in Finalize To : netscape.public.mozilla.jseng From : Brendan Eich Date : Mon Aug 29 2005 08:27 pm franck wrote: > > Replacing .Proc('MessageBoxA') with .MessageBoxA, you are talking about > defining getProperty of the JSClass, right ? > But if the dll has a symbol named 'Closed', I cannot make the difference > between the dll's symbol and the Close method of my Module class. Oh, right -- sorry, I misunderstood you. That's one way to avoid that conflict, but it might be better for the common case to do it the other way 'round. Put the methods, if they are rarely called, in some namespace object (or even an E4X namespace). I can give advice on this if you want to pursue it. > My wish is to make the work as simple as possible for these end-users, > for exemple, the only thing they have to do to use libxml2.dll is : > > -- start -- > Load( 'libxml2.js' ); > InitLibxml2(); > ... > < here they can start to use the library > > -- end -- > > It is up to the advanced user to write the libxml2.js file ( using my > library API ) Ok, but if a user writes a bad onClose method, which stores a reference to the object being finalized anywhere live, watch out! There are no safeguards in the JS engine to prevent very bad things from ensuing. /be .