Skip to content

Commit e1b5d29

Browse files
committed
Merge branch 'main' into dom-update-2025-11-06
2 parents af64efe + ee09569 commit e1b5d29

File tree

17,884 files changed

+190805
-148035
lines changed

Some content is hidden

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

17,884 files changed

+190805
-148035
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -29,71 +29,60 @@ jobs:
2929
fail-fast: ${{ github.event_name == 'merge_group' }}
3030
matrix:
3131
config:
32-
# Main builds
32+
# PRs only check the newest and oldest Node versions.
33+
# macOS only ever checks the neest and oldest Node versions, but never in PR runs.
3334
- os: ubuntu-latest
3435
node-version: '24'
3536
bundle: true
36-
37-
# Other builds (skipped in merge queues)
3837
- os: windows-latest
3938
node-version: '24'
4039
bundle: true
4140
skip: ${{ github.event_name == 'merge_group' }}
4241
- os: macos-latest
4342
node-version: '24'
4443
bundle: true
45-
skip: ${{ github.event_name == 'merge_group' }}
44+
skip: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}
45+
4646
- os: ubuntu-latest
4747
node-version: '22'
4848
bundle: true
49-
skip: ${{ github.event_name == 'merge_group' }}
49+
skip: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}
5050
- os: windows-latest
5151
node-version: '22'
5252
bundle: true
53-
skip: ${{ github.event_name == 'merge_group' }}
54-
# Skip macOS for this version; resources are limited.
55-
# - os: macos-latest
56-
# node-version: '22'
57-
# bundle: true
58-
# skip: ${{ github.event_name == 'merge_group' }}
53+
skip: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}
54+
5955
- os: ubuntu-latest
6056
node-version: '20'
6157
bundle: true
62-
skip: ${{ github.event_name == 'merge_group' }}
58+
skip: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}
6359
- os: windows-latest
6460
node-version: '20'
6561
bundle: true
66-
skip: ${{ github.event_name == 'merge_group' }}
67-
# Skip macOS for this version; resources are limited.
68-
# - os: macos-latest
69-
# node-version: '20'
70-
# bundle: true
71-
# skip: ${{ github.event_name == 'merge_group' }}
62+
skip: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}
63+
7264
- os: ubuntu-latest
7365
node-version: '18'
7466
bundle: true
75-
skip: ${{ github.event_name == 'merge_group' }}
67+
skip: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}
7668
- os: windows-latest
7769
node-version: '18'
7870
bundle: true
79-
skip: ${{ github.event_name == 'merge_group' }}
80-
# Skip macOS for this version; resources are limited.
81-
# - os: macos-latest
82-
# node-version: '18'
83-
# bundle: true
84-
# skip: ${{ github.event_name == 'merge_group' }}
71+
skip: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}
72+
8573
- os: ubuntu-latest
8674
node-version: '16'
8775
bundle: true
88-
skip: ${{ github.event_name == 'merge_group' }}
76+
skip: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}
8977
- os: windows-latest
9078
node-version: '16'
9179
bundle: true
92-
skip: ${{ github.event_name == 'merge_group' }}
80+
skip: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}
9381
- os: macos-latest
9482
node-version: '16'
9583
bundle: true
96-
skip: ${{ github.event_name == 'merge_group' }}
84+
skip: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}
85+
9786
- os: ubuntu-latest
9887
node-version: '14'
9988
bundle: true
@@ -102,12 +91,9 @@ jobs:
10291
node-version: '14'
10392
bundle: true
10493
skip: ${{ github.event_name == 'merge_group' }}
105-
# No Node 14 on ARM macOS
106-
# - os: macos-latest
107-
# node-version: '14'
108-
# bundle: true
109-
# skip: ${{ github.event_name == 'merge_group' }}
94+
# Node 14 does not support macOS ARM.
11095

96+
# --no-bundle build
11197
- os: ubuntu-latest
11298
node-version: 'lts/*'
11399
bundle: false

src/compiler/binder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ import {
8282
FunctionExpression,
8383
FunctionLikeDeclaration,
8484
GetAccessorDeclaration,
85+
getAlwaysStrict,
8586
getAssignedExpandoInitializer,
8687
getAssignmentDeclarationKind,
8788
getAssignmentDeclarationPropertyAccessKind,
@@ -108,7 +109,6 @@ import {
108109
getSourceFileOfNode,
109110
getSourceTextOfNodeFromSourceFile,
110111
getSpanOfTokenAtPosition,
111-
getStrictOptionValue,
112112
getSymbolNameForPrivateIdentifier,
113113
getTextOfIdentifierOrLiteral,
114114
getThisContainer,
@@ -618,7 +618,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
618618
}
619619

620620
function bindInStrictMode(file: SourceFile, opts: CompilerOptions): boolean {
621-
if (getStrictOptionValue(opts, "alwaysStrict") && !file.isDeclarationFile) {
621+
if (getAlwaysStrict(opts) && !file.isDeclarationFile) {
622622
// bind in strict mode source files with alwaysStrict option
623623
return true;
624624
}

src/compiler/checker.ts

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,7 @@ import {
911911
NodeBuilderFlags,
912912
nodeCanBeDecorated,
913913
NodeCheckFlags,
914+
nodeCoreModules,
914915
NodeFlags,
915916
nodeHasName,
916917
nodeIsMissing,
@@ -1121,6 +1122,7 @@ import {
11211122
UnionType,
11221123
UnionTypeNode,
11231124
UniqueESSymbolType,
1125+
usesWildcardTypes,
11241126
usingSingleLineStringWriter,
11251127
VariableDeclaration,
11261128
VariableDeclarationList,
@@ -4708,9 +4710,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
47084710

47094711
function resolveExternalModuleName(location: Node, moduleReferenceExpression: Expression, ignoreErrors?: boolean, errorMessage?: DiagnosticMessage): Symbol | undefined {
47104712
const isClassic = getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.Classic;
4711-
errorMessage ??= isClassic ?
4713+
errorMessage ??= getCannotResolveModuleNameErrorForSpecificModule(moduleReferenceExpression) ?? (isClassic ?
47124714
Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option
4713-
: Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations;
4715+
: Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations);
47144716
return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? undefined : errorMessage, ignoreErrors);
47154717
}
47164718

@@ -27643,27 +27645,29 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
2764327645
case "console":
2764427646
return Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom;
2764527647
case "$":
27646-
return compilerOptions.types
27647-
? Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig
27648-
: Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery;
27648+
return usesWildcardTypes(compilerOptions)
27649+
? Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery
27650+
: Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig;
27651+
case "beforeEach":
2764927652
case "describe":
2765027653
case "suite":
2765127654
case "it":
2765227655
case "test":
27653-
return compilerOptions.types
27654-
? Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig
27655-
: Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha;
27656+
return usesWildcardTypes(compilerOptions)
27657+
? Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha
27658+
: Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig;
2765627659
case "process":
2765727660
case "require":
2765827661
case "Buffer":
2765927662
case "module":
27660-
return compilerOptions.types
27661-
? Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig
27662-
: Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode;
27663+
case "NodeJS":
27664+
return usesWildcardTypes(compilerOptions)
27665+
? Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode
27666+
: Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig;
2766327667
case "Bun":
27664-
return compilerOptions.types
27665-
? Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_and_then_add_bun_to_the_types_field_in_your_tsconfig
27666-
: Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun;
27668+
return usesWildcardTypes(compilerOptions)
27669+
? Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun
27670+
: Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_and_then_add_bun_to_the_types_field_in_your_tsconfig;
2766727671
case "Map":
2766827672
case "Set":
2766927673
case "Promise":
@@ -27698,6 +27702,20 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
2769827702
}
2769927703
}
2770027704

27705+
function getCannotResolveModuleNameErrorForSpecificModule(moduleName: Expression): DiagnosticMessage | undefined {
27706+
if (moduleName.kind === SyntaxKind.StringLiteral) {
27707+
if (nodeCoreModules.has((moduleName as StringLiteral).text)) {
27708+
if (usesWildcardTypes(compilerOptions)) {
27709+
return Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode;
27710+
}
27711+
else {
27712+
return Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig;
27713+
}
27714+
}
27715+
}
27716+
return undefined;
27717+
}
27718+
2770127719
function getResolvedSymbol(node: Identifier): Symbol {
2770227720
const links = getNodeLinks(node);
2770327721
if (!links.resolvedSymbol) {

0 commit comments

Comments
 (0)