Subj : Re: Recalculating scope chain (i.e., 'with' statement). To : Christopher M. Balz From : Brendan Eich Date : Sat May 28 2005 03:26 am Christopher M. Balz wrote: > It is said in books of lore that using the 'with' > statement is computationally expensive. But why is > this so, if the scope chain is merely a chain of > object references? Would not using the 'with' > statement merely amount to changing about two > references (that of the child scope, and that of the > parent scope)? Entering and leaving the statement governed by with is not expensive. It's the name lookups inside the with. They must be made at runtime; you cannot optimize a name get or set within a with statement to a stack frame slot for all identifiers that match formal argument and declared local variable names. > Separately, are there any plans to open up access to a > function closure via object references? No. Why do you want to capture the activation object (SpiderMonkey's internal class for this is named Call), exactly? /be .