Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
collect() {
const mangler = this;
const { scopeTracker } = mangler;
scopeTracker.addScope(this.program.scope);
/**
* Same usage as in DCE, whichever runs first
*/
if (!isEvalScopesMarked(mangler.program)) {
markEvalScopes(mangler.program);
}
/**
* The visitors to be used in traversal.
*
* Note: BFS traversal supports only the `enter` handlers, `exit`
* handlers are simply dropped without Errors
*
* Collects items defined in the ScopeTracker
*/
const collectVisitor = {
Scopable({ scope }) {
scopeTracker.addScope(scope);
// Collect bindings defined in the scope