-
-
Notifications
You must be signed in to change notification settings - Fork 486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug][scope analysis] A symbol has two owner scopes in the same time #2205
Comments
I put the code in the playground |
The logic here is that these scopes have the variable |
So, is this logic expected? A binding could belong to many scopes in the same time. If this is expected, what's the right way to get a binding's owner scope(the scope that store it in the first place)? |
Wow I didn't thought the playgound is already support visulize the scopes. This is very useful. If the playgound could aslo print out the symbol id for symbols, it will be very useful to distinguash symbols that has the same name. |
The scope output for input (() => {
var b;
function a() {
b()
}
{
var b = () => {}
}
a()
})() is
I'm not sure if this is right or wrong, but it does feel weird to me. |
I think we can't get the binding's owner scope now. Although the |
Yeah, I know that. I just want to know if the current behavior is correct. If it's expected, I will try to solve my problems in user land. If it's not, it becomes a bug that oxc needs to fix. |
I think that is expected. But need @Boshen to confirm this. |
@hyf0 Let me investigate and get back to you. var hoisting logic is complicated :-) |
After the communication, we think the result is expected. |
I notice that symbol
b
belong to two owner scopes after the sematic analysis in[email protected]
.The text was updated successfully, but these errors were encountered: