Subj : Problem with JavaScript functions To : netscape.public.mozilla.jseng From : "Yuraukar" Date : Sat Sep 27 2003 09:36 am Another issue has come up while experimenting with SpiderMonkey. I followed the instructions for a new runtime, context and global class and am now trying to execute JavaScript via JS_EvaluateScript or JS_CompileScript+JS_ExecuteScript. This works fine, except for one thing: user-defined functions in JavaScript. See the following line of code: function f(a) { return a+3; } f(4); This returns "Reference Error: a is not defined" Why this? The same code in jsshell properly returns 7 as expected. Yuraukar .