Anupama, I couldn't open the zip file. Kevin ________________________________
From: [EMAIL PROTECTED] on behalf of Anupama Joshi Sent: Thu 2/21/2008 1:30 AM To: Attila Szegedi Cc: [email protected] Subject: Re: try -catch problem Hi , Attached is the zip file for the self contained test case. Counter.java containsa method (function) resetCount. When this function is called from the javascript inside a try-catch block , the script throws error - TypeError: Method "resetCount" called on incompatible object. If the try catch block is removed it works fine. pl. let me know if you can not access the zip file. Thanks -Anupama On Fri, Feb 15, 2008 at 11:53 AM, Attila Szegedi <[EMAIL PROTECTED]> wrote: > First off, your example is syntactically incorrect. In JavaScript, the > catch syntax is: > > catch(e) { > } > > not > > catch(exeption e) { > } > > Actually, even in Java you'd use "Exception" (capital "E", and with a > "c" after "x"), not "exeption". > > I have no idea what's wrong, and would need a self-contained > reproducible testcase (with all objects available). Can you produce > one? Are you using interpreted or compiled mode? > > Attila. > > On 2008.02.15., at 19:26, Rhino user wrote: > > > I am posting this message again. Sorry about that . Just to make sure > > that it gets read. > > > > Also , I tried this with the latest RC build which Norris posted > > yesterday .The message is slightly different but the problem remains. > > Hi , > > I have a script like his > > try{ > > var f = this.getOCGS(); > > } > > > > catch(exeption e){ > > logger.println(e);; > > > > } > > > > logger is equivalent of System.out in java. > > I have a scriptable object Doc which is the toplevel object referred > > to as this. > > The getOCGs() method throws a runtime exception . So I would expect > > that the system.out will print that error but instaed it throws an > > error saying that > > TypeError: Method "getOCGs" called on incompatible object. > > If I remove the try- catch block the right error gets thrown. > > what can be wrong? > > Thanks > > > > _______________________________________________ dev-tech-js-engine-rhino mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino
