MCPcopy Index your code
hub / github.com/TypeScriptToLua/TypeScriptToLua / hasReferencedSymbol

Function hasReferencedSymbol

src/transformation/utils/scope.ts:138–148  ·  view source on GitHub ↗
(context: TransformationContext, scope: Scope, symbol: ts.Symbol)

Source from the content-addressed store, hash-verified

136}
137
138export function hasReferencedSymbol(context: TransformationContext, scope: Scope, symbol: ts.Symbol) {
139 if (!scope.referencedSymbols) {
140 return;
141 }
142 for (const nodes of scope.referencedSymbols.values()) {
143 if (nodes.some(node => context.checker.getSymbolAtLocation(node) === symbol)) {
144 return true;
145 }
146 }
147 return false;
148}
149
150export function separateHoistedStatements(context: TransformationContext, statements: lua.Statement[]): HoistingResult {
151 const scope = peekScope(context);

Callers 1

isOptimizedVarArgSpreadFunction · 0.90

Calls 1

valuesMethod · 0.65

Tested by

no test coverage detected