Subj : JS_GetClass won't return proper class name. To : netscape.public.mozilla.jseng From : Mike Moening Date : Mon Mar 28 2005 10:40 pm See code snipet below. When constructing a properties tree (name, type, value) for the current stack frame and calling JS_GetPropertyDescArray and iterating the jsval's, the Factorial "object" is seen as type JSTYPE_OBJECT (which is expected). After converting the jsval to a JSObject* and calling JS_GetClass() the name member always comes back as "Object". How do I get JS_GetClass() to return "Factorial" so I can show the proper name? What other trick can I use to return the name of the "object"? Note: If I call GetPropertyDescArray() on the jsval representing "Factorial" it gives be back two properties named "n" and "results". After execution each has the proper name, type and value(5 and 120). Thanks in advance! ------------------------------ 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() { this.results = factor(this.n); } } Factorial.prototype.setN = function(n) { this.n = n; } var oFact = new Factorial(); //Create our "object" oFact.setN(5); //Set the private data. oFact.execute(); //Call the method. ---------------------------- .