On 2010-07-14, at 22:35, Maxime Chevalier-Boisvert wrote:
I played a bit more with D8, and it's possible that the way variable resolution is now done for the catch statement is still not quite right.
In our system, all variables and functions declared inside the catch part are shown as belonging to the catch part. However, in D8, it seems that only the exception variable belongs to the scope of the catch part, while other declarations found in there are only locals.
Sorry. My intention was to do it like you say. I forgot to change resolve_variable to implement that semantics.
Furthermore, when one inserts a function declaration inside a catch part, in D8, this function declaration will not capture the exception variable. It's as if all function declarations inside a function or the global scope are directly at the beginning of the said function or program (their closure is created once). However, function expressions can capture the exception variable, because a new closure is created each time the expression is evaluated.
OK... some more JS weirdness to contend with.
I suspect that this is conformant to the standard, but we should look to make sure. If this is the correct behavior, Mark, do you want to take another look at variable resolution?
Yes.
Marc