Subj : Re: the native() call... To : netscape.public.mozilla.jseng From : Oystein Date : Tue Jun 15 2004 12:56 pm Thanks for the reply Brendan. A couple of more things: What I am trying to do is to get a good overview of the communication between spiderMonkey and other parts of mozilla. I am reading a lot of tutorials and specs, but there are still a lot of things that are unclear to me. Please correct me if I am wrong: Take for example the |document| object. The |document| object is represented in the DOM as an XPCOM object that can be accessed using its idl interface and XPConnect. The |document| object is also an object in the js-engine,where it is a property of the window object. In addition XPConnect will build a wrapper object at runtime for the |document| object, so that it can handle property accesses between XPCOM and javascript objects. So there are actually three objects... I believe the access control(if the executing script can execute a particular method) is done in the DOM, but I havent been able to figure out how this is done. (I thought that one of the parameters in the native() call was one of the determining factors in this...) My ultimate goal is to log every access to the DOM that a downloaded javascript does. For example: var t = document.cookie; document.write("something"); window.open("http...."); I figured I need to completely understand the communication between spidermonkey and mozilla to know where to place my logging function. My initial idea was to place it in spidermonkey, but it seems there is no way to separate between downloaded scripts and chrome scripts in spidermonkey.(and I do not want to log access done by chrome scripts...) Any comments would be great! Oystein "Brendan Eich" wrote in message news:40CE7BD6.1070300@meer.net... > Brendan Eich wrote: > > Oystein wrote: > > > >> I have asked this before, but I still am not able to figure it out... > >> > >> 1. The native() call in jsinterp.c : where are the actual function > >> implementations for this function pointer... > > > > > > All over the place -- grep for 'uintN argc, jsval \*argv'. > > That applies in js/src and js/src/xpconnect/src (and other places), but > if you study xpconnect closely, you'll see that it can invoke native C++ > methods from JS, using XPCOM type libraries. This means that if you are > looking for DOM native method implementations, you can't just grep for > the JSNative signature. > > See http://www.mozilla.org/scriptable/ for the background and specs. > > /be .