Skip to content

Commit 69c0ea1

Browse files
authored
Merge branch 'microsoft:main' into deprecate-namespaces-declared-with-module-keyword
2 parents 981f261 + 09b1c55 commit 69c0ea1

File tree

93 files changed

+16026
-670
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+16026
-670
lines changed

.github/pr_owners.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ gabritto
1212
jakebailey
1313
DanielRosenwasser
1414
navya9singh
15+
iisaduan

package-lock.json

Lines changed: 28 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@
8383
"which": "^2.0.2"
8484
},
8585
"overrides": {
86-
"typescript@*": "$typescript"
86+
"typescript@*": "$typescript",
87+
"@octokit/types": "9.0.0",
88+
"@octokit/openapi-types": "16.0.0"
8789
},
8890
"scripts": {
8991
"test": "hereby runtests-parallel --light=false",

src/compiler/checker.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14543,8 +14543,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
1454314543
}
1454414544
}
1454514545

14546-
const classType = declaration.kind === SyntaxKind.Constructor ?
14547-
getDeclaredTypeOfClassOrInterface(getMergedSymbol((declaration.parent as ClassDeclaration).symbol))
14546+
const hostDeclaration = isJSDocSignature(declaration) ? getEffectiveJSDocHost(declaration) : declaration;
14547+
const classType = hostDeclaration && isConstructorDeclaration(hostDeclaration) ?
14548+
getDeclaredTypeOfClassOrInterface(getMergedSymbol((hostDeclaration.parent as ClassDeclaration).symbol))
1454814549
: undefined;
1454914550
const typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration);
1455014551
if (hasRestParameter(declaration) || isInJSFile(declaration) && maybeAddJsSyntheticRestParameter(declaration, parameters)) {

src/compiler/moduleNameResolver.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,13 +1249,14 @@ function createModuleOrTypeReferenceResolutionCache<T>(
12491249
export function createModuleResolutionCache(
12501250
currentDirectory: string,
12511251
getCanonicalFileName: (s: string) => string,
1252-
options?: CompilerOptions
1252+
options?: CompilerOptions,
1253+
packageJsonInfoCache?: PackageJsonInfoCache,
12531254
): ModuleResolutionCache {
12541255
const result = createModuleOrTypeReferenceResolutionCache(
12551256
currentDirectory,
12561257
getCanonicalFileName,
12571258
options,
1258-
/*packageJsonInfoCache*/ undefined,
1259+
packageJsonInfoCache,
12591260
getOriginalOrResolvedModuleFileName,
12601261
) as ModuleResolutionCache;
12611262
result.getOrCreateCacheForModuleName = (nonRelativeName, mode, redirectedReference) => result.getOrCreateCacheForNonRelativeName(nonRelativeName, mode, redirectedReference);
@@ -1277,6 +1278,16 @@ export function createTypeReferenceDirectiveResolutionCache(
12771278
);
12781279
}
12791280

1281+
/** @internal */
1282+
export function getOptionsForLibraryResolution(options: CompilerOptions) {
1283+
return { moduleResolution: ModuleResolutionKind.Node10, traceResolution: options.traceResolution };
1284+
}
1285+
1286+
/** @internal */
1287+
export function resolveLibrary(libraryName: string, resolveFrom: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache): ResolvedModuleWithFailedLookupLocations {
1288+
return resolveModuleName(libraryName, resolveFrom, getOptionsForLibraryResolution(compilerOptions), host, cache);
1289+
}
1290+
12801291
export function resolveModuleNameFromCache(moduleName: string, containingFile: string, cache: ModuleResolutionCache, mode?: ResolutionMode): ResolvedModuleWithFailedLookupLocations | undefined {
12811292
const containingDirectory = getDirectoryPath(containingFile);
12821293
return cache.getFromDirectoryCache(moduleName, mode, containingDirectory, /*redirectedReference*/ undefined);

src/compiler/parser.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9244,7 +9244,9 @@ namespace Parser {
92449244
const usedBrace = parseOptional(SyntaxKind.OpenBraceToken);
92459245
const pos = getNodePos();
92469246
const expression = parsePropertyAccessEntityNameExpression();
9247+
scanner.setInJSDocType(true);
92479248
const typeArguments = tryParseTypeArguments();
9249+
scanner.setInJSDocType(false);
92489250
const node = factory.createExpressionWithTypeArguments(expression, typeArguments) as ExpressionWithTypeArguments & { expression: Identifier | PropertyAccessEntityNameExpression };
92499251
const res = finishNode(node, pos);
92509252
if (usedBrace) {

0 commit comments

Comments
 (0)