-
Notifications
You must be signed in to change notification settings - Fork 77
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
References to the explicitly declared variables in the global scope should be resolved as explicitlyResolved #42
Comments
Simple wrapping code into a IIFE fixes the issue, but I believe it should be "resolved" even when not wrapped. |
Thank you for your report. While the minifier requires the very conservative assumption, the other tools (such as linters) requires moderate assumptions. For such cases, scopeManager = escope.analyze(ast, { optimistic: true }); In the above case, Is it good for your use cases? |
NOTE: |
As far as I understand, Where am I wrong? |
In any case, ability to get them as |
Thank you! Strictly speaking, there's a difference. For example, we assume that our global object has var testing = 42;
delete testing; // We can delete this variable since it's pre-defined as `{configurable: true}`
// or delete globalObject.testing also has the same effect...
console.log(testing); // raise ReferenceError So for the minifier, we give up the analysis on the global object now... But I also think it's a little bit too stict ;) |
Thanks for a detailed explanation!
Yeah, I also think that people don't use
This could definitely work, thanks! |
OK, so I'll implement it :) |
resolved: null
Thanks! |
When I try to analyze smth as simple as
I get
localVar
inglobalScope.through
and it'sresolved
property equals tonull
(while the var is obviously local and shouldn't be among unresolved references).The text was updated successfully, but these errors were encountered: