Lines Matching full:current
145 * @param node - node of a current scope in ast.
148 * @param upper - parent scope of the current scope.
155 // node of a current scope in ast.
157 // parent scope of current scope
159 // sub scopes of current scope
162 // symbols define in current scope
165 // labels in current scope
193 * add a sub scope to current scope
202 * add definition symbol into current scope
214 * add label to current scope
306 let current: Scope;
345 current.exportNames.add(def.name);
354 current.addDefinition(def.exportSymbol, true);
362 current.addDefinition(def);
365 current.addDefinition(def);
381 tryAddExportNamesIntoParentScope(originalSymbol, current);
385 current.addDefinition(originalSymbol, true);
517 // try to collect symbol for `A` in `import { A as B } from './file'; into current scope`
524 current.addDefinition(nameSymbol, shouldObfuscateAsImportElement);
528 current.importNames.add(nameText);
549 exportElementsWithoutSymbol.set(propertyNameNode, current.kind === ScopeKind.GLOBAL);
570 current.addDefinition(propertySymbol, shouldObfuscateAsExportElement);
603 current.importNames.add(bindingElement.name.text);
609 let scopeName: string = '$' + current.children.length;
610 current = new Scope(scopeName, node, ScopeKind.OBJECT_LITERAL, false, current);
611 scopes.push(current);
615 current = current.parent || current;
621 current.exportNames.add(curExportName);
640 current.addDefinition(symbol, true);
677 current = root;
678 scopes.push(current);
679 // locals of a node(scope) is symbol that defines in current scope(node).
682 current = current.parent || current;
687 let scopeName: string = '$' + current.children.length;
688 current = new Scope(scopeName, node, ScopeKind.CATCH, false, current);
689 scopes.push(current);
698 current = current.parent || current;
702 for (const def of current.defs) {
704 if (!current.exportNames.has(def.name)) {
705 current.exportNames.add(def.name);
709 if (!current.exportNames.has(name)) {
710 current.exportNames.add(name);
718 let scopeName: string = node.name.text ?? '$' + current.children.length;
719 current = new Scope(scopeName, node, ScopeKind.INTERFACE, true, current);
720 scopes.push(current);
723 current = current.parent || current;
737 let scopeName: string = node.name.text ?? '$' + current.children.length;
738 current = new Scope(scopeName, node, ScopeKind.MODULE, true, current);
739 scopes.push(current);
747 current = current.parent || current;
771 current.defs.forEach((def) => {
773 current.defs.delete(def);
774 current.mangledNames.add(def.name);
796 let scopeName: string = (node?.name as Identifier)?.text ?? '$' + current.children.length;
797 let loc: string = current?.loc ? getNameWithScopeLoc(current, scopeName) : scopeName;
799 for (const sub of current.children) {
802 current = sub;
808 current = new Scope(scopeName, node, ScopeKind.FUNCTION, true, current);
809 scopes.push(current);
831 …if (!(isGetAccessor(node) || isSetAccessor(node)) && symbol && current.parent && !current.parent.d…
835 …The `current` scope is the function's scope, the `current.parent` scope is where the function is d…
838 current.parent.defs.add(symbol);
856 current = current.parent || current;
860 let scopeName: string = '$' + current.children.length;
861 current = new Scope(scopeName, node, ScopeKind.SWITCH, false, current);
862 scopes.push(current);
865 current = current.parent || current;
880 let scopeName: string = node?.name?.text ?? '$' + current.children.length;
881 current = new Scope(scopeName, node, ScopeKind.CLASS, true, current);
882 scopes.push(current);
886 current.addDefinition(symbol);
894 current = current.parent || current;
898 let scopeName: string = '$' + current.children.length;
899 current = new Scope(scopeName, node, ScopeKind.FOR, false, current);
900 scopes.push(current);
903 current = current.parent || current;
908 if ((isFunctionScope(current) && isFunctionLike(node.parent)) || isCatchClause(node.parent)) {
914 let scopeName: string = '$' + current.children.length;
915 current = new Scope(scopeName, node, ScopeKind.BLOCK, false, current);
916 scopes.push(current);
919 current = current.parent || current;
924 current = new Scope(scopeName, node, ScopeKind.INTERFACE, true, current);
925 scopes.push(current);
934 current.addDefinition(elm.symbol);
939 current = current.parent || current;
944 current = new Scope(scopeName, node, ScopeKind.ENUM, true, current);
945 scopes.push(current);
948 current.addDefinition(member.symbol);
953 current = current.parent || current;
981 current.mangledNames.add(node.text);
990 // add def symbol that don't found in current defs.
991 addSymbolIntoDefsIfNeeded(node, symbol, current.defs);
1034 upperLabel = upperLabel ? createLabel(node, current, upperLabel) : createLabel(node, current);
1069 current.exportNames.add(node.name.text);
1073 current.addDefinition(sym, true);
1081 current.exportNames.add(node.name.text);
1086 current.addDefinition(sym, true);
1104 current.mangledNames.add((node as Identifier).text);