Skip to content

Commit

Permalink
Post-rebase cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
weswigham committed May 14, 2024
1 parent 0de1bf9 commit f3eab73
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,8 @@ import {
WideningContext,
WithStatement,
YieldExpression,
LazyNodeCheckFlags,
isClassElement,
} from "./_namespaces/ts.js";
import * as moduleSpecifiers from "./_namespaces/ts.moduleSpecifiers.js";
import * as performance from "./_namespaces/ts.performance.js";
Expand Down Expand Up @@ -29272,9 +29274,6 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
if (isJsxOpeningLikeElement(location) || isJsxOpeningFragment(location)) {
return markJsxAliasReferenced(location);
}
if (isFunctionLikeDeclaration(location) || isMethodSignature(location)) {
return markAsyncFunctionAliasReferenced(location);
}
if (isImportEqualsDeclaration(location)) {
if (isInternalModuleImportEqualsDeclaration(location) || checkExternalImportOrExportDeclaration(location)) {
return markImportEqualsAliasReferenced(location);
Expand All @@ -29284,6 +29283,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
if (isExportSpecifier(location)) {
return markExportSpecifierAliasReferenced(location);
}
if (isFunctionLikeDeclaration(location) || isMethodSignature(location)) {
markAsyncFunctionAliasReferenced(location);
// Might be decorated, fall through to decorator final case
}
if (!compilerOptions.emitDecoratorMetadata) {
return;
}
Expand Down Expand Up @@ -29726,7 +29729,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
addDeprecatedSuggestion(node, targetSymbol.declarations, node.escapedText as string);
}

let declaration = localOrExportSymbol.valueDeclaration;
const declaration = localOrExportSymbol.valueDeclaration;
if (declaration && localOrExportSymbol.flags & SymbolFlags.Class) {
// When we downlevel classes we may emit some code outside of the class body. Due to the fact the
// class name is double-bound, we must ensure we mark references to the class name so that we can
Expand Down Expand Up @@ -48784,7 +48787,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
function checkSingleIdentifier(node: Node) {
const nodeLinks = getNodeLinks(node);
nodeLinks.calculatedFlags |= NodeCheckFlags.ConstructorReference | NodeCheckFlags.CapturedBlockScopedBinding | NodeCheckFlags.BlockScopedBindingInLoop;
if (isIdentifier(node) && isExpressionNode(node) && !isPropertyAccessExpression(node.parent)) {
if (isIdentifier(node) && isExpressionNode(node) && !(isPropertyAccessExpression(node.parent) && node.parent.name === node)) {
const s = getSymbolAtLocation(node, /*ignoreErrors*/ true);
if (s && s !== unknownSymbol) {
checkIdentifierCalculateNodeCheckFlags(node, s);
Expand All @@ -48811,7 +48814,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
checkComputedPropertyName(node);
}
if (isPrivateIdentifier(node) && isClassElement(node.parent)) {
setNodeLinksForPrivateIdentifier(node, node.parent);
setNodeLinksForPrivateIdentifierScope(node.parent as PropertyDeclaration | PropertySignature | MethodDeclaration | MethodSignature | AccessorDeclaration);
}
}
}
Expand Down
13 changes: 13 additions & 0 deletions tests/baselines/reference/importDeclWithDeclareModifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.a = void 0;
exports.a = x.c;
var b;


!!!! File importDeclWithDeclareModifier.js differs from original emit in noCheck emit
//// [importDeclWithDeclareModifier.js]
===================================================================
--- Expected The full check baseline
+++ Actual with noCheck set
@@ -1,5 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-exports.a = void 0;
-exports.a = x.c;
var b;

0 comments on commit f3eab73

Please sign in to comment.