Subj : Re: Rhino 1.5R4_1 problem with try/catch, WITH, GETBASE To : Laura Werner From : Brendan Eich Date : Mon Jun 09 2003 04:37 pm > I explained this poorly too, I guess. Or probably, I misread your post. > When I execute the script, I pass in the currently active VXML > scope. For example, when a form-level script is activated during form > initialization, I pass in the "Form Scope" from the diagram above. > Its parent chain leads up to the global scope. Right, I knew VXML nested scopes with nested tags. That seems like a mistake, as an aside. I inflicted some amount of that in the DOM level 0 when I perpetrated JS back in 1995, and the model doesn't scale well. You can't easily tell what "foo" refers to in a deeply-nested scope chain. > The problem happens if one of the functions in the script has a "with" > or "try/catch". In that case, the "calleeScope" variable in > Interpreter.interpret() gets set to the result of getTopLevelScope() > (which is "Global Scope"), and references to other items defined in > the script don't work (or other items in Form Scope if that's where > the script is). That sounds like a Rhino bug. The with's parent scope should be the function's parent, if the function did not require an activation object for its call's scope (and if it did require an activation object, then that should be the parent of the with -- but I assume that case works correctly). /be > > > I hope this is more clear. > > -- Laura > .