On Fri Jun 16 16:27:33 2023 +0000, Gabriel Ivăncescu wrote:
Yeah, using the scope object was just an optimization I wanted to make since the variable object is barely used now in such cases, so it feels like a bit of a waste. But as far as I can see `identifier_eval` only treats the "arguments" and the function's name itself as special, though? What I'm talking about is functions in nested scopes getting exposed on the base scope. This call in `detach_scope`:
jsdisp_propput_name(frame->variable_obj, name, ctx->stack[local_off(frame, ref)]);
or the equivalent in `scope_init_locals` when `detached_vars` is true. An example of such tests are in "functions scope" test in mshtml/es5.js, at the beginning of it. Even though it exposes them using same name, so base scope does have locals named `f`, but that's just coincidence I think. That said, probably that should go into separate follow up MR, anyway. Anyway, I'll leave the scope obj optimization out of this MR, do you think I should resend it later or you still don't like it?
If it's done right, sure, it would be nice to have.