Skip to content

Commit

Permalink
rbuckton review
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Feb 5, 2025
1 parent 7b17c31 commit 84c71d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
8 changes: 1 addition & 7 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49756,13 +49756,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
}

if (isExpressionNode(node)) {
try {
return getRegularTypeOfExpression(node as Expression);
}
catch (e) {
console.error("Error while getting the type of", isExpressionNode(node), node.kind, (node as MetaProperty).keywordToken !== SyntaxKind.ImportKeyword, (node as MetaProperty).name?.escapedText);
throw e;
}
return getRegularTypeOfExpression(node as Expression);
}

if (classType && !classDecl.isImplements) {
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12074,7 +12074,7 @@ export function forEachDynamicImportOrRequireCall<IncludeTypeSpaceImports extend
cb: (node: CallExpression | (IncludeTypeSpaceImports extends false ? never : JSDocImportTag | ImportTypeNode), argument: RequireStringLiteralLikeArgument extends true ? StringLiteralLike : Expression) => void,
): void {
const isJavaScriptFile = isInJSFile(file);
const r = /import|defer|require/g;
const r = /import|require/g;
while (r.exec(file.text) !== null) { // eslint-disable-line no-restricted-syntax
const node = getNodeAtPosition(file, r.lastIndex, /*includeJSDoc*/ includeTypeSpaceImports);
if (isJavaScriptFile && isRequireCall(node, requireStringLiteralLikeArgument)) {
Expand Down Expand Up @@ -12106,7 +12106,7 @@ function getNodeAtPosition(sourceFile: SourceFile, position: number, includeJSDo
};
while (true) {
const child = isJavaScriptFile && includeJSDoc && hasJSDocNodes(current) && forEach(current.jsDoc, getContainingChild) || forEachChild(current, getContainingChild);
if (!child) {
if (!child || isMetaProperty(child)) {
return current;
}
current = child;
Expand Down

0 comments on commit 84c71d5

Please sign in to comment.