Subj : JS_GetFunctionId for an anyomous function To : netscape.public.mozilla.jseng From : Mike Moening Date : Tue Mar 29 2005 02:27 pm When the NewScript hook is fired some of the functions are anonymous and return NULL. In the example below, how do I get the names "execute" and "setN" when their respective NewScript hooks are fired for the functions on lines 14 and 18? Thanks! Here's the script: ------------------------------ function Factorial(n) { if(n!=null) this.n=n; else this.n=0; this.results=0; var self = this; function factor(i) { if (i <= 1) return 1; return i * factor(i-1) } this.execute = function() { /* Line 14 */ this.results = factor(this.n); } } Factorial.prototype.setN = function(n) { /* Line 18*/ this.n = n; } var oFact = new Factorial(); //Create our "object" oFact.setN(5); //Set the private data. oFact.execute(); //Call the method. ---------------------------- .