Skip to content

Commit fb59c19

Browse files
Merge remote-tracking branch 'origin/main' into release-5.8
2 parents 6fd1799 + df342b7 commit fb59c19

File tree

9 files changed

+45
-12
lines changed

9 files changed

+45
-12
lines changed

Diff for: .github/workflows/codeql.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646

4747
# Initializes the CodeQL tools for scanning.
4848
- name: Initialize CodeQL
49-
uses: github/codeql-action/init@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
49+
uses: github/codeql-action/init@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # v3.28.9
5050
with:
5151
config-file: ./.github/codeql/codeql-configuration.yml
5252
# Override language selection by uncommenting this and choosing your languages
@@ -56,7 +56,7 @@ jobs:
5656
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5757
# If this step fails, then you should remove it and run the build manually (see below).
5858
- name: Autobuild
59-
uses: github/codeql-action/autobuild@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
59+
uses: github/codeql-action/autobuild@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # v3.28.9
6060

6161
# ℹ️ Command-line programs to run using the OS shell.
6262
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -70,4 +70,4 @@ jobs:
7070
# make release
7171

7272
- name: Perform CodeQL Analysis
73-
uses: github/codeql-action/analyze@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
73+
uses: github/codeql-action/analyze@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # v3.28.9

Diff for: .github/workflows/scorecard.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ jobs:
5555

5656
# Upload the results to GitHub's code scanning dashboard.
5757
- name: 'Upload to code-scanning'
58-
uses: github/codeql-action/upload-sarif@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
58+
uses: github/codeql-action/upload-sarif@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # v3.28.9
5959
with:
6060
sarif_file: results.sarif

Diff for: src/compiler/checker.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -49148,11 +49148,11 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4914849148
}
4914949149
else if (isEntityName(name) && isTypeReferenceIdentifier(name)) {
4915049150
const meaning = name.parent.kind === SyntaxKind.TypeReference ? SymbolFlags.Type : SymbolFlags.Namespace;
49151-
const symbol = resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true);
49151+
const symbol = resolveEntityName(name, meaning, /*ignoreErrors*/ true, /*dontResolveAlias*/ true);
4915249152
return symbol && symbol !== unknownSymbol ? symbol : getUnresolvedSymbolForEntityName(name);
4915349153
}
4915449154
if (name.parent.kind === SyntaxKind.TypePredicate) {
49155-
return resolveEntityName(name as Identifier, /*meaning*/ SymbolFlags.FunctionScopedVariable);
49155+
return resolveEntityName(name as Identifier, /*meaning*/ SymbolFlags.FunctionScopedVariable, /*ignoreErrors*/ true);
4915649156
}
4915749157
return undefined;
4915849158
}
@@ -49383,7 +49383,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4938349383

4938449384
function getShorthandAssignmentValueSymbol(location: Node | undefined): Symbol | undefined {
4938549385
if (location && location.kind === SyntaxKind.ShorthandPropertyAssignment) {
49386-
return resolveEntityName((location as ShorthandPropertyAssignment).name, SymbolFlags.Value | SymbolFlags.Alias);
49386+
return resolveEntityName((location as ShorthandPropertyAssignment).name, SymbolFlags.Value | SymbolFlags.Alias, /*ignoreErrors*/ true);
4938749387
}
4938849388
return undefined;
4938949389
}
@@ -49395,10 +49395,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4939549395
return node.parent.parent.moduleSpecifier ?
4939649396
getExternalModuleMember(node.parent.parent, node) :
4939749397
name.kind === SyntaxKind.StringLiteral ? undefined : // Skip for invalid syntax like this: export { "x" }
49398-
resolveEntityName(name, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace | SymbolFlags.Alias);
49398+
resolveEntityName(name, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace | SymbolFlags.Alias, /*ignoreErrors*/ true);
4939949399
}
4940049400
else {
49401-
return resolveEntityName(node, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace | SymbolFlags.Alias);
49401+
return resolveEntityName(node, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace | SymbolFlags.Alias, /*ignoreErrors*/ true);
4940249402
}
4940349403
}
4940449404

Diff for: src/compiler/transformers/module/esnextAnd2015.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ export function transformECMAScriptModule(context: TransformationContext): (x: S
158158
if (node === importsAndRequiresToRewriteOrShim?.[0]) {
159159
return visitImportOrRequireCall(importsAndRequiresToRewriteOrShim.shift()!);
160160
}
161-
break;
161+
// fallthrough
162162
default:
163163
if (importsAndRequiresToRewriteOrShim?.length && rangeContainsRange(node, importsAndRequiresToRewriteOrShim[0])) {
164164
return visitEachChild(node, visitor, context);

Diff for: tests/baselines/reference/emit(jsx=preserve).errors.txt

+10-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ main.ts(6,22): error TS2307: Cannot find module './foo.ts' or its corresponding
66
main.ts(8,15): error TS2307: Cannot find module './foo.ts' or its corresponding type declarations.
77
main.ts(10,8): error TS2307: Cannot find module './foo.ts' or its corresponding type declarations.
88
main.ts(11,8): error TS2307: Cannot find module './foo.ts' or its corresponding type declarations.
9+
main.ts(13,18): error TS2307: Cannot find module './foo.ts' or its corresponding type declarations.
10+
main.ts(14,8): error TS2307: Cannot find module './foo.ts' or its corresponding type declarations.
911
no.ts(1,16): error TS2307: Cannot find module './foo.ts/foo.js' or its corresponding type declarations.
1012
no.ts(2,16): error TS2307: Cannot find module 'foo.ts' or its corresponding type declarations.
1113
no.ts(3,16): error TS2307: Cannot find module 'pkg/foo.ts' or its corresponding type declarations.
@@ -21,7 +23,7 @@ no.ts(11,8): error TS2307: Cannot find module 'node:path' or its corresponding t
2123
==== globals.d.ts (0 errors) ====
2224
declare function require(module: string): any;
2325

24-
==== main.ts (8 errors) ====
26+
==== main.ts (10 errors) ====
2527
// Rewrite
2628
import {} from "./foo.ts";
2729
~~~~~~~~~~
@@ -45,6 +47,13 @@ no.ts(11,8): error TS2307: Cannot find module 'node:path' or its corresponding t
4547
//Shim
4648
import("./foo.ts");
4749
~~~~~~~~~~
50+
!!! error TS2307: Cannot find module './foo.ts' or its corresponding type declarations.
51+
import("./foo.ts").then(() => {});
52+
~~~~~~~~~~
53+
!!! error TS2307: Cannot find module './foo.ts' or its corresponding type declarations.
54+
function acceptAny(arg: any) {}
55+
acceptAny(import("./foo.ts"));
56+
~~~~~~~~~~
4857
!!! error TS2307: Cannot find module './foo.ts' or its corresponding type declarations.
4958
import("./foo.ts", { with: { attr: "value" } });
5059
~~~~~~~~~~

Diff for: tests/baselines/reference/emit(jsx=preserve).js

+6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ import "./foo.ts";
1414
export * from "./foo.ts";
1515
//Shim
1616
import("./foo.ts");
17+
import("./foo.ts").then(() => {});
18+
function acceptAny(arg: any) {}
19+
acceptAny(import("./foo.ts"));
1720
import("./foo.ts", { with: { attr: "value" } });
1821
import("" + "./foo.ts");
1922
//// [js.js]
@@ -71,6 +74,9 @@ import "./foo.js";
7174
export * from "./foo.js";
7275
//Shim
7376
import("./foo.js");
77+
import("./foo.js").then(() => { });
78+
function acceptAny(arg) { }
79+
acceptAny(import("./foo.js"));
7480
import("./foo.js", { with: { attr: "value" } });
7581
import(__rewriteRelativeImportExtension("" + "./foo.ts", true));
7682
//// [js.js]

Diff for: tests/baselines/reference/emit(jsx=react).errors.txt

+10-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ main.ts(6,22): error TS2307: Cannot find module './foo.ts' or its corresponding
66
main.ts(8,15): error TS2307: Cannot find module './foo.ts' or its corresponding type declarations.
77
main.ts(10,8): error TS2307: Cannot find module './foo.ts' or its corresponding type declarations.
88
main.ts(11,8): error TS2307: Cannot find module './foo.ts' or its corresponding type declarations.
9+
main.ts(13,18): error TS2307: Cannot find module './foo.ts' or its corresponding type declarations.
10+
main.ts(14,8): error TS2307: Cannot find module './foo.ts' or its corresponding type declarations.
911
no.ts(1,16): error TS2307: Cannot find module './foo.ts/foo.js' or its corresponding type declarations.
1012
no.ts(2,16): error TS2307: Cannot find module 'foo.ts' or its corresponding type declarations.
1113
no.ts(3,16): error TS2307: Cannot find module 'pkg/foo.ts' or its corresponding type declarations.
@@ -21,7 +23,7 @@ no.ts(11,8): error TS2307: Cannot find module 'node:path' or its corresponding t
2123
==== globals.d.ts (0 errors) ====
2224
declare function require(module: string): any;
2325

24-
==== main.ts (8 errors) ====
26+
==== main.ts (10 errors) ====
2527
// Rewrite
2628
import {} from "./foo.ts";
2729
~~~~~~~~~~
@@ -45,6 +47,13 @@ no.ts(11,8): error TS2307: Cannot find module 'node:path' or its corresponding t
4547
//Shim
4648
import("./foo.ts");
4749
~~~~~~~~~~
50+
!!! error TS2307: Cannot find module './foo.ts' or its corresponding type declarations.
51+
import("./foo.ts").then(() => {});
52+
~~~~~~~~~~
53+
!!! error TS2307: Cannot find module './foo.ts' or its corresponding type declarations.
54+
function acceptAny(arg: any) {}
55+
acceptAny(import("./foo.ts"));
56+
~~~~~~~~~~
4857
!!! error TS2307: Cannot find module './foo.ts' or its corresponding type declarations.
4958
import("./foo.ts", { with: { attr: "value" } });
5059
~~~~~~~~~~

Diff for: tests/baselines/reference/emit(jsx=react).js

+6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ import "./foo.ts";
1414
export * from "./foo.ts";
1515
//Shim
1616
import("./foo.ts");
17+
import("./foo.ts").then(() => {});
18+
function acceptAny(arg: any) {}
19+
acceptAny(import("./foo.ts"));
1720
import("./foo.ts", { with: { attr: "value" } });
1821
import("" + "./foo.ts");
1922
//// [js.js]
@@ -71,6 +74,9 @@ import "./foo.js";
7174
export * from "./foo.js";
7275
//Shim
7376
import("./foo.js");
77+
import("./foo.js").then(() => { });
78+
function acceptAny(arg) { }
79+
acceptAny(import("./foo.js"));
7480
import("./foo.js", { with: { attr: "value" } });
7581
import(__rewriteRelativeImportExtension("" + "./foo.ts"));
7682
//// [js.js]

Diff for: tests/cases/conformance/externalModules/rewriteRelativeImportExtensions/emit.ts

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ import "./foo.ts";
2121
export * from "./foo.ts";
2222
//Shim
2323
import("./foo.ts");
24+
import("./foo.ts").then(() => {});
25+
function acceptAny(arg: any) {}
26+
acceptAny(import("./foo.ts"));
2427
import("./foo.ts", { with: { attr: "value" } });
2528
import("" + "./foo.ts");
2629
// @Filename: js.js

0 commit comments

Comments
 (0)