Subj : Re: SM: run a script from a native function To : Shanti Rao From : Brendan Eich Date : Fri Jan 09 2004 12:02 pm Shanti Rao wrote: [. . .] > js_ReportIsNotDefined() gets called back from js_Interpret. > InitExecptionObject() gets called as before, and makes a ReferenceError > exception with the right file name and line number. The pending > exception then has the messgae "asdf is not defined", just as before. > This time, however, when control returns to EvaluateUCScriptFP(), cx->fp > is null, You mean "not null" here. > and it doesn't call js_ReportUncaughtException(). > > EvaluateUCScriptFP() returns false, so I know an error occurred, but the > exception got deleted before I got a chance to see what it was. No, it did not get deleted. JS_IsExceptionPending(cx) will return true, and it will get reported if control flow unwinds from the outermost JS_Evaluate*, JS_Execute*, or JS_Call* API, as I wrote. I don't know why you want to deprive the scripted callers of your native function of the ability to catch errors-as-exceptions by reporting errors prematurely. Why is that? /be .