Subj : 'heavyweight' functions To : netscape.public.mozilla.jseng From : r.knight Date : Tue Jul 13 2004 04:46 am Hi, We're currently in the process of writing a JS debugger for our app. Everything seems to be working great, except for one thing...:) When paused at a breakpoint, we have a 'command' window where the user can type arbitary expressions which will get evaluated in the context of the current stack frame via JS_EvaluateUCInStackFrame. Most of the time this works fine, but with some functions - say something like: function deadSimple(x) { var y=x * 2; return y; } if the stack frame is inside that function, then passing a string "x" or "y" to JS_EvaluateUCInStackFrame results in an error - "x is not defined". However, if I change the function to: function deadSimple(x) { var y=x * 2; return y; debugger; } it works, despite the fact that the debugger keyword will never be reached, and so never executed. Delving into the JS source, it looks like when a function contains a debugger keyword, it gets tagged with a flag TCF_FUN_HEAVYWEIGHT - as far as I can tell thats the only difference between the two. Not sure what this flag does (guessing it disables some optimisation or something), but assuming that is the problem, is there any API I can use to force all functions to be compiled with this flag attached? Thanks! Rich. .