fix(compiler): do not recurse to find static symbols of same module (#35262)
To create the symbols of a module, the static symbol resolver first gets all the symbols loaded in the module by an export statement. For `export * from './module'`-like statements, all symbols from `./module` must be loaded. In cases where the exporting module is actually the same module that the export statement is in, this causes an unbounded recursive resolution of the same module. Exports of the same module are not needed, as their symbols will be resolved when the symbols in the module metadata's `metadata` key is explored. This commit resolves the unbounded recursion by loading exporting modules only if they differ from the module currently being resolved. Closes https://github.com/angular/vscode-ng-language-service/issues/593 PR Close #35262
This commit is contained in:

committed by
Andrew Kushnir

parent
79659ee5aa
commit
e179c5827f
@ -313,9 +313,9 @@ export class StaticSymbolResolver {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// handle the symbols via export * directives.
|
||||
// Handle the symbols loaded by 'export *' directives.
|
||||
const resolvedModule = this.resolveModule(moduleExport.from, filePath);
|
||||
if (resolvedModule) {
|
||||
if (resolvedModule && resolvedModule !== filePath) {
|
||||
const nestedExports = this.getSymbolsOf(resolvedModule);
|
||||
nestedExports.forEach((targetSymbol) => {
|
||||
const sourceSymbol = this.getStaticSymbol(filePath, targetSymbol.name);
|
||||
|
Reference in New Issue
Block a user