Subj : Calling new on objects (Spidermonkey) To : netscape.public.mozilla.jseng From : zakalawe@mac.com (James Turner) Date : Tue May 27 2003 04:02 am I'm trying to get JS to call into a native function when I call 'new' on an object, without success so far. I figure there has to be some magic function I can define on the object (or preferably, in the class the objects belong too) which will get invoked if present. The problem is, it obviously isn't called 'constructor', since that's the built-in 'object that created me' property. So, can I achieve this behavour, and if so, how? (Just to make this a bit clearer) 'Archetype' is a JSClass defined natively. // this works fine var dog_type = new Archetype("dog", ...); // need to make this work too, and be able to run a native function. var dog = new dog_type( .... ); .