You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use swc to collect valid, in-scope identifiers for a given block in a JS program.
Initially I thought I may be able to use collect_decls_with_context from swc_ecma_utils, but this doesn't seem to achieve exactly what I'm looking for.
e.g. for the following example:
{varx=1;{vary=2;}}
I want to be able to determine that the outer block has x in scope, and the inner block has both x and y in scope. collect_decls_with_context appears to return the opposite result.
Is there a canonical way to do what I am trying to do with swc?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to use swc to collect valid, in-scope identifiers for a given block in a JS program.
Initially I thought I may be able to use
collect_decls_with_context
fromswc_ecma_utils
, but this doesn't seem to achieve exactly what I'm looking for.e.g. for the following example:
I want to be able to determine that the outer block has
x
in scope, and the inner block has bothx
andy
in scope.collect_decls_with_context
appears to return the opposite result.Is there a canonical way to do what I am trying to do with swc?
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions