Skip to content

Commit f3eab73

Browse files
committed
Post-rebase cleanups
1 parent 0de1bf9 commit f3eab73

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

src/compiler/checker.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,8 @@ import {
11051105
WideningContext,
11061106
WithStatement,
11071107
YieldExpression,
1108+
LazyNodeCheckFlags,
1109+
isClassElement,
11081110
} from "./_namespaces/ts.js";
11091111
import * as moduleSpecifiers from "./_namespaces/ts.moduleSpecifiers.js";
11101112
import * as performance from "./_namespaces/ts.performance.js";
@@ -29272,9 +29274,6 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
2927229274
if (isJsxOpeningLikeElement(location) || isJsxOpeningFragment(location)) {
2927329275
return markJsxAliasReferenced(location);
2927429276
}
29275-
if (isFunctionLikeDeclaration(location) || isMethodSignature(location)) {
29276-
return markAsyncFunctionAliasReferenced(location);
29277-
}
2927829277
if (isImportEqualsDeclaration(location)) {
2927929278
if (isInternalModuleImportEqualsDeclaration(location) || checkExternalImportOrExportDeclaration(location)) {
2928029279
return markImportEqualsAliasReferenced(location);
@@ -29284,6 +29283,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
2928429283
if (isExportSpecifier(location)) {
2928529284
return markExportSpecifierAliasReferenced(location);
2928629285
}
29286+
if (isFunctionLikeDeclaration(location) || isMethodSignature(location)) {
29287+
markAsyncFunctionAliasReferenced(location);
29288+
// Might be decorated, fall through to decorator final case
29289+
}
2928729290
if (!compilerOptions.emitDecoratorMetadata) {
2928829291
return;
2928929292
}
@@ -29726,7 +29729,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
2972629729
addDeprecatedSuggestion(node, targetSymbol.declarations, node.escapedText as string);
2972729730
}
2972829731

29729-
let declaration = localOrExportSymbol.valueDeclaration;
29732+
const declaration = localOrExportSymbol.valueDeclaration;
2973029733
if (declaration && localOrExportSymbol.flags & SymbolFlags.Class) {
2973129734
// When we downlevel classes we may emit some code outside of the class body. Due to the fact the
2973229735
// class name is double-bound, we must ensure we mark references to the class name so that we can
@@ -48784,7 +48787,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4878448787
function checkSingleIdentifier(node: Node) {
4878548788
const nodeLinks = getNodeLinks(node);
4878648789
nodeLinks.calculatedFlags |= NodeCheckFlags.ConstructorReference | NodeCheckFlags.CapturedBlockScopedBinding | NodeCheckFlags.BlockScopedBindingInLoop;
48787-
if (isIdentifier(node) && isExpressionNode(node) && !isPropertyAccessExpression(node.parent)) {
48790+
if (isIdentifier(node) && isExpressionNode(node) && !(isPropertyAccessExpression(node.parent) && node.parent.name === node)) {
4878848791
const s = getSymbolAtLocation(node, /*ignoreErrors*/ true);
4878948792
if (s && s !== unknownSymbol) {
4879048793
checkIdentifierCalculateNodeCheckFlags(node, s);
@@ -48811,7 +48814,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4881148814
checkComputedPropertyName(node);
4881248815
}
4881348816
if (isPrivateIdentifier(node) && isClassElement(node.parent)) {
48814-
setNodeLinksForPrivateIdentifier(node, node.parent);
48817+
setNodeLinksForPrivateIdentifierScope(node.parent as PropertyDeclaration | PropertySignature | MethodDeclaration | MethodSignature | AccessorDeclaration);
4881548818
}
4881648819
}
4881748820
}

tests/baselines/reference/importDeclWithDeclareModifier.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
1515
exports.a = void 0;
1616
exports.a = x.c;
1717
var b;
18+
19+
20+
!!!! File importDeclWithDeclareModifier.js differs from original emit in noCheck emit
21+
//// [importDeclWithDeclareModifier.js]
22+
===================================================================
23+
--- Expected The full check baseline
24+
+++ Actual with noCheck set
25+
@@ -1,5 +1,3 @@
26+
"use strict";
27+
Object.defineProperty(exports, "__esModule", { value: true });
28+
-exports.a = void 0;
29+
-exports.a = x.c;
30+
var b;

0 commit comments

Comments
 (0)