diff --git a/packages/compiler/src/frontend/lowering/constructor-returns.ts b/packages/compiler/src/frontend/lowering/constructor-returns.ts index 1cc4c6057..bee2e7567 100644 --- a/packages/compiler/src/frontend/lowering/constructor-returns.ts +++ b/packages/compiler/src/frontend/lowering/constructor-returns.ts @@ -153,7 +153,7 @@ function returnsThis( const name = callee.name.text; const symbol = lowerer.checker.getSymbolAtLocation(callee.name); if (symbol === undefined) return false; - const methods: ts.Node[] = [...lowerer.checker.declarationsOf(symbol)]; + const methods: ts.Node[] = [...symbol.declarations]; if (receiver === ts.SyntaxKind.ThisKeyword) { const pending = [...info.subclasses]; while (pending.length > 0) { diff --git a/packages/compiler/src/frontend/lowering/lower-stmts.ts b/packages/compiler/src/frontend/lowering/lower-stmts.ts index 5d8f2ddec..2c36e4973 100644 --- a/packages/compiler/src/frontend/lowering/lower-stmts.ts +++ b/packages/compiler/src/frontend/lowering/lower-stmts.ts @@ -2085,7 +2085,7 @@ function javaScriptAnyOrigin(lowerer: Lowerer, node: ts.Expression, depth: numbe : expr.expression; if (!ts.isIdentifier(callee)) return false; const symbol = lowerer.resolveValueSymbol(callee); - const declarations = symbol ? lowerer.checker.declarationsOf(symbol) : []; + const declarations = symbol ? symbol.declarations : []; return ( declarations.length > 0 && declarations.every((d) => isJsSourceFile(d.getSourceFile()) && ts.isFunctionLike(d)) @@ -2093,7 +2093,7 @@ function javaScriptAnyOrigin(lowerer: Lowerer, node: ts.Expression, depth: numbe } if (ts.isIdentifier(expr) && depth === 0) { const symbol = lowerer.resolveValueSymbol(expr); - const declaration = symbol ? lowerer.checker.valueDeclarationOf(symbol) : undefined; + const declaration = symbol ? symbol.valueDeclaration : undefined; return ( declaration !== undefined && ts.isVariableDeclaration(declaration) && diff --git a/packages/compiler/src/frontend/lowering/lowerer.ts b/packages/compiler/src/frontend/lowering/lowerer.ts index 85568239f..676496def 100644 --- a/packages/compiler/src/frontend/lowering/lowerer.ts +++ b/packages/compiler/src/frontend/lowering/lowerer.ts @@ -3195,8 +3195,7 @@ export class Lowerer { const symbol = part.getSymbol(); return ( (symbol?.name === "WeakMap" || symbol?.name === "WeakSet") && - this.checker - .declarationsOf(symbol) + symbol.declarations .some((d) => ts.isInterfaceDeclaration(d) && this.isStdlibFile(d.getSourceFile())) ); }; diff --git a/packages/compiler/src/frontend/lowering/module-member-this.ts b/packages/compiler/src/frontend/lowering/module-member-this.ts index a29e361d9..205cc63e9 100644 --- a/packages/compiler/src/frontend/lowering/module-member-this.ts +++ b/packages/compiler/src/frontend/lowering/module-member-this.ts @@ -52,7 +52,7 @@ export function refuseModuleMemberThis( if (symbol !== undefined && (symbol.flags & ts.SymbolFlags.Alias) !== 0) symbol = lowerer.checker.getAliasedSymbol(symbol); if (symbol === undefined) return; - for (const decl of lowerer.checker.declarationsOf(symbol)) { + for (const decl of symbol.declarations) { const fn = exportedFunction(decl); if (fn === null || !readsOwnThis(fn)) continue; lowerer.unsupported( diff --git a/packages/compiler/src/frontend/type-mapper.ts b/packages/compiler/src/frontend/type-mapper.ts index 6a7f14778..47b99c7cb 100644 --- a/packages/compiler/src/frontend/type-mapper.ts +++ b/packages/compiler/src/frontend/type-mapper.ts @@ -1360,8 +1360,7 @@ export function mapAsyncGeneratorAnnotation(type: ts.Type, ctx: TypeMapperCtx): if ( !symbol || !["AsyncIterator", "AsyncIterableIterator", "AsyncIterable"].includes(symbol.name) || - !checker - .declarationsOf(symbol) + !symbol.declarations .some((d) => ts.isInterfaceDeclaration(d) && ctx.isStdlibFile(d.getSourceFile())) ) return null; @@ -2505,8 +2504,7 @@ function mapTypeInner(type: ts.Type, ctx: TypeMapperCtx): IrType | null { if ( psym && WEBCRYPTO_DYN_TYPES.has(psym.name) && - checker - .declarationsOf(psym) + psym.declarations .some( (d) => (ts.isClassDeclaration(d) || ts.isInterfaceDeclaration(d)) &&