@typescript-deploys/pr-build 4.9.0-pr-49886-16 → 4.9.0-pr-50592-5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +653 -904
- package/lib/tsserver.js +695 -1013
- package/lib/tsserverlibrary.d.ts +1 -2
- package/lib/tsserverlibrary.js +694 -1012
- package/lib/typescript.d.ts +1 -1
- package/lib/typescript.js +687 -1005
- package/lib/typescriptServices.d.ts +1 -1
- package/lib/typescriptServices.js +687 -1005
- package/lib/typingsInstaller.js +661 -939
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
var ts;
|
|
70
70
|
(function (ts) {
|
|
71
71
|
ts.versionMajorMinor = "4.9";
|
|
72
|
-
ts.version = "".concat(ts.versionMajorMinor, ".0-insiders.
|
|
72
|
+
ts.version = "".concat(ts.versionMajorMinor, ".0-insiders.20220901");
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -2062,10 +2062,6 @@ var ts;
|
|
|
2062
2062
|
}
|
|
2063
2063
|
return s.slice(0, end + 1);
|
|
2064
2064
|
}
|
|
2065
|
-
function is() {
|
|
2066
|
-
return identity;
|
|
2067
|
-
}
|
|
2068
|
-
ts.is = is;
|
|
2069
2065
|
})(ts || (ts = {}));
|
|
2070
2066
|
var ts;
|
|
2071
2067
|
(function (ts) {
|
|
@@ -3608,6 +3604,48 @@ var ts;
|
|
|
3608
3604
|
ModuleKind[ModuleKind["Node16"] = 100] = "Node16";
|
|
3609
3605
|
ModuleKind[ModuleKind["NodeNext"] = 199] = "NodeNext";
|
|
3610
3606
|
})(ModuleKind = ts.ModuleKind || (ts.ModuleKind = {}));
|
|
3607
|
+
ts.commentPragmas = {
|
|
3608
|
+
"reference": {
|
|
3609
|
+
args: [
|
|
3610
|
+
{ name: "types", optional: true, captureSpan: true },
|
|
3611
|
+
{ name: "lib", optional: true, captureSpan: true },
|
|
3612
|
+
{ name: "path", optional: true, captureSpan: true },
|
|
3613
|
+
{ name: "no-default-lib", optional: true },
|
|
3614
|
+
{ name: "resolution-mode", optional: true }
|
|
3615
|
+
],
|
|
3616
|
+
kind: 1
|
|
3617
|
+
},
|
|
3618
|
+
"amd-dependency": {
|
|
3619
|
+
args: [{ name: "path" }, { name: "name", optional: true }],
|
|
3620
|
+
kind: 1
|
|
3621
|
+
},
|
|
3622
|
+
"amd-module": {
|
|
3623
|
+
args: [{ name: "name" }],
|
|
3624
|
+
kind: 1
|
|
3625
|
+
},
|
|
3626
|
+
"ts-check": {
|
|
3627
|
+
kind: 2
|
|
3628
|
+
},
|
|
3629
|
+
"ts-nocheck": {
|
|
3630
|
+
kind: 2
|
|
3631
|
+
},
|
|
3632
|
+
"jsx": {
|
|
3633
|
+
args: [{ name: "factory" }],
|
|
3634
|
+
kind: 4
|
|
3635
|
+
},
|
|
3636
|
+
"jsxfrag": {
|
|
3637
|
+
args: [{ name: "factory" }],
|
|
3638
|
+
kind: 4
|
|
3639
|
+
},
|
|
3640
|
+
"jsximportsource": {
|
|
3641
|
+
args: [{ name: "factory" }],
|
|
3642
|
+
kind: 4
|
|
3643
|
+
},
|
|
3644
|
+
"jsxruntime": {
|
|
3645
|
+
args: [{ name: "factory" }],
|
|
3646
|
+
kind: 4
|
|
3647
|
+
},
|
|
3648
|
+
};
|
|
3611
3649
|
})(ts || (ts = {}));
|
|
3612
3650
|
var ts;
|
|
3613
3651
|
(function (ts) {
|
|
@@ -5584,7 +5622,6 @@ var ts;
|
|
|
5584
5622
|
A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled: diag(1272, ts.DiagnosticCategory.Error, "A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_w_1272", "A type referenced in a decorated signature must be imported with 'import type' or a namespace import when 'isolatedModules' and 'emitDecoratorMetadata' are enabled."),
|
|
5585
5623
|
_0_modifier_cannot_appear_on_a_type_parameter: diag(1273, ts.DiagnosticCategory.Error, "_0_modifier_cannot_appear_on_a_type_parameter_1273", "'{0}' modifier cannot appear on a type parameter"),
|
|
5586
5624
|
_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias: diag(1274, ts.DiagnosticCategory.Error, "_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias_1274", "'{0}' modifier can only appear on a type parameter of a class, interface or type alias"),
|
|
5587
|
-
Duplicate_local_compiler_option_0: diag(1280, ts.DiagnosticCategory.Error, "Duplicate_local_compiler_option_0_1280", "Duplicate local compiler option '{0}'."),
|
|
5588
5625
|
with_statements_are_not_allowed_in_an_async_function_block: diag(1300, ts.DiagnosticCategory.Error, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
|
|
5589
5626
|
await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, ts.DiagnosticCategory.Error, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."),
|
|
5590
5627
|
The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level: diag(1309, ts.DiagnosticCategory.Error, "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309", "The current file is a CommonJS module and cannot use 'await' at the top level."),
|
|
@@ -11579,7 +11616,7 @@ var ts;
|
|
|
11579
11616
|
if (node.isDeclarationFile) {
|
|
11580
11617
|
return false;
|
|
11581
11618
|
}
|
|
11582
|
-
if (getStrictOptionValue(
|
|
11619
|
+
if (getStrictOptionValue(compilerOptions, "alwaysStrict")) {
|
|
11583
11620
|
return true;
|
|
11584
11621
|
}
|
|
11585
11622
|
if (ts.startsWithUseStrict(node.statements)) {
|
|
@@ -11831,17 +11868,13 @@ var ts;
|
|
|
11831
11868
|
}
|
|
11832
11869
|
ts.createDiagnosticMessageChainFromDiagnostic = createDiagnosticMessageChainFromDiagnostic;
|
|
11833
11870
|
function createDiagnosticForRange(sourceFile, range, message) {
|
|
11834
|
-
var text = getLocaleSpecificMessage(message);
|
|
11835
|
-
if (arguments.length > 3) {
|
|
11836
|
-
text = formatStringFromArgs(text, arguments, 3);
|
|
11837
|
-
}
|
|
11838
11871
|
return {
|
|
11839
11872
|
file: sourceFile,
|
|
11840
11873
|
start: range.pos,
|
|
11841
11874
|
length: range.end - range.pos,
|
|
11842
11875
|
code: message.code,
|
|
11843
11876
|
category: message.category,
|
|
11844
|
-
messageText:
|
|
11877
|
+
messageText: message.message,
|
|
11845
11878
|
};
|
|
11846
11879
|
}
|
|
11847
11880
|
ts.createDiagnosticForRange = createDiagnosticForRange;
|
|
@@ -16198,17 +16231,8 @@ var ts;
|
|
|
16198
16231
|
return !!(options.incremental || options.composite);
|
|
16199
16232
|
}
|
|
16200
16233
|
ts.isIncrementalCompilation = isIncrementalCompilation;
|
|
16201
|
-
function
|
|
16202
|
-
|
|
16203
|
-
var strict = localStrictValue === undefined ? opts.strict : localStrictValue;
|
|
16204
|
-
if ((file === null || file === void 0 ? void 0 : file.localOptions) && ts.hasProperty(file.localOptions, name)) {
|
|
16205
|
-
return file.localOptions[name] !== undefined ? file.localOptions[name] : opts[name] !== undefined ? opts[name] : isStrictFlag ? strict : undefined;
|
|
16206
|
-
}
|
|
16207
|
-
return opts[name] !== undefined ? opts[name] : isStrictFlag ? strict : undefined;
|
|
16208
|
-
}
|
|
16209
|
-
ts.getFileLocalCompilerOption = getFileLocalCompilerOption;
|
|
16210
|
-
function getStrictOptionValue(file, compilerOptions, flag) {
|
|
16211
|
-
return !!getFileLocalCompilerOption(file, compilerOptions, flag, true);
|
|
16234
|
+
function getStrictOptionValue(compilerOptions, flag) {
|
|
16235
|
+
return compilerOptions[flag] === undefined ? !!compilerOptions.strict : !!compilerOptions[flag];
|
|
16212
16236
|
}
|
|
16213
16237
|
ts.getStrictOptionValue = getStrictOptionValue;
|
|
16214
16238
|
function getAllowJSCompilerOption(compilerOptions) {
|
|
@@ -16232,7 +16256,7 @@ var ts;
|
|
|
16232
16256
|
}
|
|
16233
16257
|
ts.compilerOptionsAffectDeclarationPath = compilerOptionsAffectDeclarationPath;
|
|
16234
16258
|
function getCompilerOptionValue(options, option) {
|
|
16235
|
-
return option.strictFlag ? options
|
|
16259
|
+
return option.strictFlag ? getStrictOptionValue(options, option.name) : options[option.name];
|
|
16236
16260
|
}
|
|
16237
16261
|
ts.getCompilerOptionValue = getCompilerOptionValue;
|
|
16238
16262
|
function getJSXTransformEnabled(options) {
|
|
@@ -31952,7 +31976,6 @@ var ts;
|
|
|
31952
31976
|
context.amdDependencies = [];
|
|
31953
31977
|
context.hasNoDefaultLib = false;
|
|
31954
31978
|
context.pragmas.forEach(function (entryOrList, key) {
|
|
31955
|
-
var _a;
|
|
31956
31979
|
switch (key) {
|
|
31957
31980
|
case "reference": {
|
|
31958
31981
|
var referencedFiles_1 = context.referencedFiles;
|
|
@@ -32011,55 +32034,12 @@ var ts;
|
|
|
32011
32034
|
});
|
|
32012
32035
|
break;
|
|
32013
32036
|
}
|
|
32014
|
-
case "ts-strict":
|
|
32015
|
-
case "ts-noimplicitany":
|
|
32016
|
-
case "ts-strictnullchecks":
|
|
32017
|
-
case "ts-strictfunctiontypes":
|
|
32018
|
-
case "ts-strictbindcallapply":
|
|
32019
|
-
case "ts-noimplicitthis":
|
|
32020
|
-
case "ts-strictpropertyinitialization":
|
|
32021
|
-
case "ts-useunknownincatchvariables":
|
|
32022
|
-
case "ts-alwaysstrict":
|
|
32023
|
-
case "ts-nounusedlocals":
|
|
32024
|
-
case "ts-nounusedparameters":
|
|
32025
|
-
case "ts-exactoptionalpropertytypes":
|
|
32026
|
-
case "ts-nopropertyaccessfromindexsignature":
|
|
32027
|
-
case "ts-noimplicitreturns":
|
|
32028
|
-
case "ts-nofallthroughcasesinswitch":
|
|
32029
|
-
case "ts-nouncheckedindexedaccess":
|
|
32030
|
-
case "ts-noimplicitoverride": {
|
|
32031
|
-
var optName_1 = key.slice(3);
|
|
32032
|
-
var opt = ts.find(ts.optionsAllowedAsPragmaOption, function (o) { return o.name.toLowerCase() === optName_1; });
|
|
32033
|
-
var entry = (ts.isArray(entryOrList) ? ts.last(entryOrList) : entryOrList);
|
|
32034
|
-
var unparsedValue = entry.arguments.value;
|
|
32035
|
-
var optContainer = {};
|
|
32036
|
-
var errors = [];
|
|
32037
|
-
var parsedValue = unparsedValue === undefined ? true : (ts.parseOptionValue([unparsedValue], 0, undefined, opt, optContainer, errors), optContainer[opt.name]);
|
|
32038
|
-
if (unparsedValue === undefined && opt.type !== "boolean") {
|
|
32039
|
-
errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_expects_an_argument, optName_1));
|
|
32040
|
-
}
|
|
32041
|
-
for (var _b = 0, errors_1 = errors; _b < errors_1.length; _b++) {
|
|
32042
|
-
var err = errors_1[_b];
|
|
32043
|
-
reportDiagnostic(entry.range.pos, entry.range.end - entry.range.pos, {
|
|
32044
|
-
category: err.category,
|
|
32045
|
-
code: err.code,
|
|
32046
|
-
message: err.messageText,
|
|
32047
|
-
reportsDeprecated: err.reportsDeprecated,
|
|
32048
|
-
reportsUnnecessary: err.reportsUnnecessary,
|
|
32049
|
-
key: err.messageText
|
|
32050
|
-
});
|
|
32051
|
-
}
|
|
32052
|
-
if (!ts.length(errors)) {
|
|
32053
|
-
((_a = context.localOptions) !== null && _a !== void 0 ? _a : (context.localOptions = {}))[opt.name] = parsedValue;
|
|
32054
|
-
}
|
|
32055
|
-
break;
|
|
32056
|
-
}
|
|
32057
32037
|
case "jsx":
|
|
32058
32038
|
case "jsxfrag":
|
|
32059
32039
|
case "jsximportsource":
|
|
32060
32040
|
case "jsxruntime":
|
|
32061
32041
|
return;
|
|
32062
|
-
default: ts.Debug.
|
|
32042
|
+
default: ts.Debug.fail("Unhandled pragma kind");
|
|
32063
32043
|
}
|
|
32064
32044
|
});
|
|
32065
32045
|
}
|
|
@@ -32181,7 +32161,6 @@ var ts;
|
|
|
32181
32161
|
name: "compileOnSave",
|
|
32182
32162
|
type: "boolean",
|
|
32183
32163
|
defaultValueDescription: false,
|
|
32184
|
-
category: ts.Diagnostics.Editor_Support
|
|
32185
32164
|
};
|
|
32186
32165
|
var jsxOptionMap = new ts.Map(ts.getEntries({
|
|
32187
32166
|
"preserve": 1,
|
|
@@ -32318,7 +32297,6 @@ var ts;
|
|
|
32318
32297
|
type: "list",
|
|
32319
32298
|
element: {
|
|
32320
32299
|
name: "excludeDirectory",
|
|
32321
|
-
category: ts.Diagnostics.Watch_and_Build_Modes,
|
|
32322
32300
|
type: "string",
|
|
32323
32301
|
isFilePath: true,
|
|
32324
32302
|
extraValidation: specToDiagnostic
|
|
@@ -32331,7 +32309,6 @@ var ts;
|
|
|
32331
32309
|
type: "list",
|
|
32332
32310
|
element: {
|
|
32333
32311
|
name: "excludeFile",
|
|
32334
|
-
category: ts.Diagnostics.Watch_and_Build_Modes,
|
|
32335
32312
|
type: "string",
|
|
32336
32313
|
isFilePath: true,
|
|
32337
32314
|
extraValidation: specToDiagnostic
|
|
@@ -32340,7 +32317,7 @@ var ts;
|
|
|
32340
32317
|
description: ts.Diagnostics.Remove_a_list_of_files_from_the_watch_mode_s_processing,
|
|
32341
32318
|
},
|
|
32342
32319
|
];
|
|
32343
|
-
ts.commonOptionsWithBuild =
|
|
32320
|
+
ts.commonOptionsWithBuild = [
|
|
32344
32321
|
{
|
|
32345
32322
|
name: "help",
|
|
32346
32323
|
shortName: "h",
|
|
@@ -32355,7 +32332,6 @@ var ts;
|
|
|
32355
32332
|
shortName: "?",
|
|
32356
32333
|
type: "boolean",
|
|
32357
32334
|
defaultValueDescription: false,
|
|
32358
|
-
category: ts.Diagnostics.Command_line_Options,
|
|
32359
32335
|
},
|
|
32360
32336
|
{
|
|
32361
32337
|
name: "watch",
|
|
@@ -32470,8 +32446,8 @@ var ts;
|
|
|
32470
32446
|
description: ts.Diagnostics.Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit,
|
|
32471
32447
|
defaultValueDescription: ts.Diagnostics.Platform_specific
|
|
32472
32448
|
},
|
|
32473
|
-
]
|
|
32474
|
-
ts.targetOptionDeclaration =
|
|
32449
|
+
];
|
|
32450
|
+
ts.targetOptionDeclaration = {
|
|
32475
32451
|
name: "target",
|
|
32476
32452
|
shortName: "t",
|
|
32477
32453
|
type: new ts.Map(ts.getEntries({
|
|
@@ -32497,8 +32473,8 @@ var ts;
|
|
|
32497
32473
|
category: ts.Diagnostics.Language_and_Environment,
|
|
32498
32474
|
description: ts.Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,
|
|
32499
32475
|
defaultValueDescription: 0,
|
|
32500
|
-
}
|
|
32501
|
-
ts.moduleOptionDeclaration =
|
|
32476
|
+
};
|
|
32477
|
+
ts.moduleOptionDeclaration = {
|
|
32502
32478
|
name: "module",
|
|
32503
32479
|
shortName: "m",
|
|
32504
32480
|
type: new ts.Map(ts.getEntries({
|
|
@@ -32523,8 +32499,8 @@ var ts;
|
|
|
32523
32499
|
category: ts.Diagnostics.Modules,
|
|
32524
32500
|
description: ts.Diagnostics.Specify_what_module_code_is_generated,
|
|
32525
32501
|
defaultValueDescription: undefined,
|
|
32526
|
-
}
|
|
32527
|
-
var commandOptionsWithoutBuild =
|
|
32502
|
+
};
|
|
32503
|
+
var commandOptionsWithoutBuild = [
|
|
32528
32504
|
{
|
|
32529
32505
|
name: "all",
|
|
32530
32506
|
type: "boolean",
|
|
@@ -32597,7 +32573,6 @@ var ts;
|
|
|
32597
32573
|
element: {
|
|
32598
32574
|
name: "lib",
|
|
32599
32575
|
type: ts.libMap,
|
|
32600
|
-
category: ts.Diagnostics.Language_and_Environment,
|
|
32601
32576
|
defaultValueDescription: undefined,
|
|
32602
32577
|
},
|
|
32603
32578
|
affectsProgramStructure: true,
|
|
@@ -32810,7 +32785,6 @@ var ts;
|
|
|
32810
32785
|
category: ts.Diagnostics.Type_Checking,
|
|
32811
32786
|
description: ts.Diagnostics.Enable_all_strict_type_checking_options,
|
|
32812
32787
|
defaultValueDescription: false,
|
|
32813
|
-
allowedAsPragma: true,
|
|
32814
32788
|
},
|
|
32815
32789
|
{
|
|
32816
32790
|
name: "noImplicitAny",
|
|
@@ -32820,8 +32794,7 @@ var ts;
|
|
|
32820
32794
|
strictFlag: true,
|
|
32821
32795
|
category: ts.Diagnostics.Type_Checking,
|
|
32822
32796
|
description: ts.Diagnostics.Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type,
|
|
32823
|
-
defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set
|
|
32824
|
-
allowedAsPragma: true,
|
|
32797
|
+
defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set
|
|
32825
32798
|
},
|
|
32826
32799
|
{
|
|
32827
32800
|
name: "strictNullChecks",
|
|
@@ -32831,8 +32804,7 @@ var ts;
|
|
|
32831
32804
|
strictFlag: true,
|
|
32832
32805
|
category: ts.Diagnostics.Type_Checking,
|
|
32833
32806
|
description: ts.Diagnostics.When_type_checking_take_into_account_null_and_undefined,
|
|
32834
|
-
defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set
|
|
32835
|
-
allowedAsPragma: true,
|
|
32807
|
+
defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set
|
|
32836
32808
|
},
|
|
32837
32809
|
{
|
|
32838
32810
|
name: "strictFunctionTypes",
|
|
@@ -32842,8 +32814,7 @@ var ts;
|
|
|
32842
32814
|
strictFlag: true,
|
|
32843
32815
|
category: ts.Diagnostics.Type_Checking,
|
|
32844
32816
|
description: ts.Diagnostics.When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible,
|
|
32845
|
-
defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set
|
|
32846
|
-
allowedAsPragma: true,
|
|
32817
|
+
defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set
|
|
32847
32818
|
},
|
|
32848
32819
|
{
|
|
32849
32820
|
name: "strictBindCallApply",
|
|
@@ -32853,8 +32824,7 @@ var ts;
|
|
|
32853
32824
|
strictFlag: true,
|
|
32854
32825
|
category: ts.Diagnostics.Type_Checking,
|
|
32855
32826
|
description: ts.Diagnostics.Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function,
|
|
32856
|
-
defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set
|
|
32857
|
-
allowedAsPragma: true,
|
|
32827
|
+
defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set
|
|
32858
32828
|
},
|
|
32859
32829
|
{
|
|
32860
32830
|
name: "strictPropertyInitialization",
|
|
@@ -32864,8 +32834,7 @@ var ts;
|
|
|
32864
32834
|
strictFlag: true,
|
|
32865
32835
|
category: ts.Diagnostics.Type_Checking,
|
|
32866
32836
|
description: ts.Diagnostics.Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor,
|
|
32867
|
-
defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set
|
|
32868
|
-
allowedAsPragma: true,
|
|
32837
|
+
defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set
|
|
32869
32838
|
},
|
|
32870
32839
|
{
|
|
32871
32840
|
name: "noImplicitThis",
|
|
@@ -32875,8 +32844,7 @@ var ts;
|
|
|
32875
32844
|
strictFlag: true,
|
|
32876
32845
|
category: ts.Diagnostics.Type_Checking,
|
|
32877
32846
|
description: ts.Diagnostics.Enable_error_reporting_when_this_is_given_the_type_any,
|
|
32878
|
-
defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set
|
|
32879
|
-
allowedAsPragma: true,
|
|
32847
|
+
defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set
|
|
32880
32848
|
},
|
|
32881
32849
|
{
|
|
32882
32850
|
name: "useUnknownInCatchVariables",
|
|
@@ -32887,7 +32855,6 @@ var ts;
|
|
|
32887
32855
|
category: ts.Diagnostics.Type_Checking,
|
|
32888
32856
|
description: ts.Diagnostics.Default_catch_clause_variables_as_unknown_instead_of_any,
|
|
32889
32857
|
defaultValueDescription: false,
|
|
32890
|
-
allowedAsPragma: true,
|
|
32891
32858
|
},
|
|
32892
32859
|
{
|
|
32893
32860
|
name: "alwaysStrict",
|
|
@@ -32898,8 +32865,7 @@ var ts;
|
|
|
32898
32865
|
strictFlag: true,
|
|
32899
32866
|
category: ts.Diagnostics.Type_Checking,
|
|
32900
32867
|
description: ts.Diagnostics.Ensure_use_strict_is_always_emitted,
|
|
32901
|
-
defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set
|
|
32902
|
-
allowedAsPragma: true,
|
|
32868
|
+
defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set
|
|
32903
32869
|
},
|
|
32904
32870
|
{
|
|
32905
32871
|
name: "noUnusedLocals",
|
|
@@ -32909,7 +32875,6 @@ var ts;
|
|
|
32909
32875
|
category: ts.Diagnostics.Type_Checking,
|
|
32910
32876
|
description: ts.Diagnostics.Enable_error_reporting_when_local_variables_aren_t_read,
|
|
32911
32877
|
defaultValueDescription: false,
|
|
32912
|
-
allowedAsPragma: true,
|
|
32913
32878
|
},
|
|
32914
32879
|
{
|
|
32915
32880
|
name: "noUnusedParameters",
|
|
@@ -32919,7 +32884,6 @@ var ts;
|
|
|
32919
32884
|
category: ts.Diagnostics.Type_Checking,
|
|
32920
32885
|
description: ts.Diagnostics.Raise_an_error_when_a_function_parameter_isn_t_read,
|
|
32921
32886
|
defaultValueDescription: false,
|
|
32922
|
-
allowedAsPragma: true,
|
|
32923
32887
|
},
|
|
32924
32888
|
{
|
|
32925
32889
|
name: "exactOptionalPropertyTypes",
|
|
@@ -32929,7 +32893,6 @@ var ts;
|
|
|
32929
32893
|
category: ts.Diagnostics.Type_Checking,
|
|
32930
32894
|
description: ts.Diagnostics.Interpret_optional_property_types_as_written_rather_than_adding_undefined,
|
|
32931
32895
|
defaultValueDescription: false,
|
|
32932
|
-
allowedAsPragma: true,
|
|
32933
32896
|
},
|
|
32934
32897
|
{
|
|
32935
32898
|
name: "noImplicitReturns",
|
|
@@ -32939,7 +32902,6 @@ var ts;
|
|
|
32939
32902
|
category: ts.Diagnostics.Type_Checking,
|
|
32940
32903
|
description: ts.Diagnostics.Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function,
|
|
32941
32904
|
defaultValueDescription: false,
|
|
32942
|
-
allowedAsPragma: true,
|
|
32943
32905
|
},
|
|
32944
32906
|
{
|
|
32945
32907
|
name: "noFallthroughCasesInSwitch",
|
|
@@ -32950,7 +32912,6 @@ var ts;
|
|
|
32950
32912
|
category: ts.Diagnostics.Type_Checking,
|
|
32951
32913
|
description: ts.Diagnostics.Enable_error_reporting_for_fallthrough_cases_in_switch_statements,
|
|
32952
32914
|
defaultValueDescription: false,
|
|
32953
|
-
allowedAsPragma: true,
|
|
32954
32915
|
},
|
|
32955
32916
|
{
|
|
32956
32917
|
name: "noUncheckedIndexedAccess",
|
|
@@ -32960,7 +32921,6 @@ var ts;
|
|
|
32960
32921
|
category: ts.Diagnostics.Type_Checking,
|
|
32961
32922
|
description: ts.Diagnostics.Add_undefined_to_a_type_when_accessed_using_an_index,
|
|
32962
32923
|
defaultValueDescription: false,
|
|
32963
|
-
allowedAsPragma: true,
|
|
32964
32924
|
},
|
|
32965
32925
|
{
|
|
32966
32926
|
name: "noImplicitOverride",
|
|
@@ -32970,7 +32930,6 @@ var ts;
|
|
|
32970
32930
|
category: ts.Diagnostics.Type_Checking,
|
|
32971
32931
|
description: ts.Diagnostics.Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier,
|
|
32972
32932
|
defaultValueDescription: false,
|
|
32973
|
-
allowedAsPragma: true,
|
|
32974
32933
|
},
|
|
32975
32934
|
{
|
|
32976
32935
|
name: "noPropertyAccessFromIndexSignature",
|
|
@@ -32981,7 +32940,6 @@ var ts;
|
|
|
32981
32940
|
category: ts.Diagnostics.Type_Checking,
|
|
32982
32941
|
description: ts.Diagnostics.Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type,
|
|
32983
32942
|
defaultValueDescription: false,
|
|
32984
|
-
allowedAsPragma: true,
|
|
32985
32943
|
},
|
|
32986
32944
|
{
|
|
32987
32945
|
name: "moduleResolution",
|
|
@@ -33021,7 +32979,6 @@ var ts;
|
|
|
33021
32979
|
element: {
|
|
33022
32980
|
name: "rootDirs",
|
|
33023
32981
|
type: "string",
|
|
33024
|
-
category: ts.Diagnostics.Modules,
|
|
33025
32982
|
isFilePath: true
|
|
33026
32983
|
},
|
|
33027
32984
|
affectsModuleResolution: true,
|
|
@@ -33036,7 +32993,6 @@ var ts;
|
|
|
33036
32993
|
element: {
|
|
33037
32994
|
name: "typeRoots",
|
|
33038
32995
|
type: "string",
|
|
33039
|
-
category: ts.Diagnostics.Modules,
|
|
33040
32996
|
isFilePath: true
|
|
33041
32997
|
},
|
|
33042
32998
|
affectsModuleResolution: true,
|
|
@@ -33048,7 +33004,6 @@ var ts;
|
|
|
33048
33004
|
type: "list",
|
|
33049
33005
|
element: {
|
|
33050
33006
|
name: "types",
|
|
33051
|
-
category: ts.Diagnostics.Modules,
|
|
33052
33007
|
type: "string"
|
|
33053
33008
|
},
|
|
33054
33009
|
affectsProgramStructure: true,
|
|
@@ -33098,7 +33053,6 @@ var ts;
|
|
|
33098
33053
|
type: "list",
|
|
33099
33054
|
element: {
|
|
33100
33055
|
name: "suffix",
|
|
33101
|
-
category: ts.Diagnostics.Modules,
|
|
33102
33056
|
type: "string",
|
|
33103
33057
|
},
|
|
33104
33058
|
listPreserveFalsyValues: true,
|
|
@@ -33473,7 +33427,6 @@ var ts;
|
|
|
33473
33427
|
isTSConfigOnly: true,
|
|
33474
33428
|
element: {
|
|
33475
33429
|
name: "plugin",
|
|
33476
|
-
category: ts.Diagnostics.Editor_Support,
|
|
33477
33430
|
type: "object"
|
|
33478
33431
|
},
|
|
33479
33432
|
description: ts.Diagnostics.Specify_a_list_of_language_service_plugins_to_include,
|
|
@@ -33491,83 +33444,16 @@ var ts;
|
|
|
33491
33444
|
category: ts.Diagnostics.Language_and_Environment,
|
|
33492
33445
|
defaultValueDescription: ts.Diagnostics.auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules,
|
|
33493
33446
|
}
|
|
33494
|
-
]
|
|
33495
|
-
ts.optionDeclarations =
|
|
33496
|
-
function
|
|
33497
|
-
|
|
33498
|
-
}
|
|
33499
|
-
ts.
|
|
33500
|
-
function
|
|
33501
|
-
return !!option.affectsEmit;
|
|
33502
|
-
}
|
|
33503
|
-
ts.affectsEmitOptionDeclarations = ts.optionDeclarations.filter(isAffectsEmitOption);
|
|
33504
|
-
function isAffectsDeclarationPathOption(option) {
|
|
33505
|
-
return !!option.affectsDeclarationPath;
|
|
33506
|
-
}
|
|
33507
|
-
ts.affectsDeclarationPathOptionDeclarations = ts.optionDeclarations.filter(isAffectsDeclarationPathOption);
|
|
33508
|
-
function isAffectsModuleResolutionOption(option) {
|
|
33509
|
-
return !!option.affectsModuleResolution;
|
|
33510
|
-
}
|
|
33511
|
-
ts.moduleResolutionOptionDeclarations = ts.optionDeclarations.filter(isAffectsModuleResolutionOption);
|
|
33512
|
-
function isSourceFileAffectingOptions(option) {
|
|
33447
|
+
];
|
|
33448
|
+
ts.optionDeclarations = __spreadArray(__spreadArray([], ts.commonOptionsWithBuild, true), commandOptionsWithoutBuild, true);
|
|
33449
|
+
ts.semanticDiagnosticsOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsSemanticDiagnostics; });
|
|
33450
|
+
ts.affectsEmitOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsEmit; });
|
|
33451
|
+
ts.affectsDeclarationPathOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsDeclarationPath; });
|
|
33452
|
+
ts.moduleResolutionOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsModuleResolution; });
|
|
33453
|
+
ts.sourceFileAffectingCompilerOptions = ts.optionDeclarations.filter(function (option) {
|
|
33513
33454
|
return !!option.affectsSourceFile || !!option.affectsModuleResolution || !!option.affectsBindDiagnostics;
|
|
33514
|
-
}
|
|
33515
|
-
ts.
|
|
33516
|
-
function isAffectsProgramStructureOption(option) {
|
|
33517
|
-
return !!option.affectsProgramStructure;
|
|
33518
|
-
}
|
|
33519
|
-
ts.optionsAffectingProgramStructure = ts.optionDeclarations.filter(isAffectsProgramStructureOption);
|
|
33520
|
-
function isStrictOption(option) {
|
|
33521
|
-
return !!option.strictFlag === true;
|
|
33522
|
-
}
|
|
33523
|
-
ts.isStrictOption = isStrictOption;
|
|
33524
|
-
function isAllowedAsPragmaOption(option) {
|
|
33525
|
-
return !!option.allowedAsPragma;
|
|
33526
|
-
}
|
|
33527
|
-
ts.optionsAllowedAsPragmaOption = ts.optionDeclarations.filter(isAllowedAsPragmaOption);
|
|
33528
|
-
function convertCompilerOptionsIntoPragmasSpecs(options) {
|
|
33529
|
-
var result = {};
|
|
33530
|
-
for (var _i = 0, options_1 = options; _i < options_1.length; _i++) {
|
|
33531
|
-
var elem = options_1[_i];
|
|
33532
|
-
result["ts-".concat(elem.name.toLowerCase())] = {
|
|
33533
|
-
args: [{ name: "value", optional: true }],
|
|
33534
|
-
kind: 2 | 4
|
|
33535
|
-
};
|
|
33536
|
-
}
|
|
33537
|
-
return result;
|
|
33538
|
-
}
|
|
33539
|
-
ts.commentPragmas = __assign({ "reference": {
|
|
33540
|
-
args: [
|
|
33541
|
-
{ name: "types", optional: true, captureSpan: true },
|
|
33542
|
-
{ name: "lib", optional: true, captureSpan: true },
|
|
33543
|
-
{ name: "path", optional: true, captureSpan: true },
|
|
33544
|
-
{ name: "no-default-lib", optional: true },
|
|
33545
|
-
{ name: "resolution-mode", optional: true }
|
|
33546
|
-
],
|
|
33547
|
-
kind: 1
|
|
33548
|
-
}, "amd-dependency": {
|
|
33549
|
-
args: [{ name: "path" }, { name: "name", optional: true }],
|
|
33550
|
-
kind: 1
|
|
33551
|
-
}, "amd-module": {
|
|
33552
|
-
args: [{ name: "name" }],
|
|
33553
|
-
kind: 1
|
|
33554
|
-
}, "ts-check": {
|
|
33555
|
-
kind: 2
|
|
33556
|
-
}, "ts-nocheck": {
|
|
33557
|
-
kind: 2
|
|
33558
|
-
}, "jsx": {
|
|
33559
|
-
args: [{ name: "factory" }],
|
|
33560
|
-
kind: 4
|
|
33561
|
-
}, "jsxfrag": {
|
|
33562
|
-
args: [{ name: "factory" }],
|
|
33563
|
-
kind: 4
|
|
33564
|
-
}, "jsximportsource": {
|
|
33565
|
-
args: [{ name: "factory" }],
|
|
33566
|
-
kind: 4
|
|
33567
|
-
}, "jsxruntime": {
|
|
33568
|
-
args: [{ name: "factory" }],
|
|
33569
|
-
kind: 4
|
|
33570
|
-
} }, convertCompilerOptionsIntoPragmasSpecs(ts.optionsAllowedAsPragmaOption));
|
|
33455
|
+
});
|
|
33456
|
+
ts.optionsAffectingProgramStructure = ts.optionDeclarations.filter(function (option) { return !!option.affectsProgramStructure; });
|
|
33571
33457
|
ts.transpileOptionValueCompilerOptions = ts.optionDeclarations.filter(function (option) {
|
|
33572
33458
|
return ts.hasProperty(option, "transpileOptionValue");
|
|
33573
33459
|
});
|
|
@@ -33609,13 +33495,11 @@ var ts;
|
|
|
33609
33495
|
{
|
|
33610
33496
|
name: "enableAutoDiscovery",
|
|
33611
33497
|
type: "boolean",
|
|
33612
|
-
category: ts.Diagnostics.File_Management,
|
|
33613
33498
|
defaultValueDescription: false,
|
|
33614
33499
|
},
|
|
33615
33500
|
{
|
|
33616
33501
|
name: "enable",
|
|
33617
33502
|
type: "boolean",
|
|
33618
|
-
category: ts.Diagnostics.File_Management,
|
|
33619
33503
|
defaultValueDescription: false,
|
|
33620
33504
|
},
|
|
33621
33505
|
{
|
|
@@ -33623,25 +33507,20 @@ var ts;
|
|
|
33623
33507
|
type: "list",
|
|
33624
33508
|
element: {
|
|
33625
33509
|
name: "include",
|
|
33626
|
-
category: ts.Diagnostics.File_Management,
|
|
33627
33510
|
type: "string"
|
|
33628
|
-
}
|
|
33629
|
-
category: ts.Diagnostics.File_Management,
|
|
33511
|
+
}
|
|
33630
33512
|
},
|
|
33631
33513
|
{
|
|
33632
33514
|
name: "exclude",
|
|
33633
33515
|
type: "list",
|
|
33634
33516
|
element: {
|
|
33635
33517
|
name: "exclude",
|
|
33636
|
-
category: ts.Diagnostics.File_Management,
|
|
33637
33518
|
type: "string"
|
|
33638
|
-
}
|
|
33639
|
-
category: ts.Diagnostics.File_Management,
|
|
33519
|
+
}
|
|
33640
33520
|
},
|
|
33641
33521
|
{
|
|
33642
33522
|
name: "disableFilenameBasedTypeAcquisition",
|
|
33643
33523
|
type: "boolean",
|
|
33644
|
-
category: ts.Diagnostics.File_Management,
|
|
33645
33524
|
defaultValueDescription: false,
|
|
33646
33525
|
},
|
|
33647
33526
|
];
|
|
@@ -33832,7 +33711,7 @@ var ts;
|
|
|
33832
33711
|
}
|
|
33833
33712
|
}
|
|
33834
33713
|
else {
|
|
33835
|
-
if (!args[i] && opt.type !== "boolean"
|
|
33714
|
+
if (!args[i] && opt.type !== "boolean") {
|
|
33836
33715
|
errors.push(ts.createCompilerDiagnostic(diagnostics.optionTypeMismatchDiagnostic, opt.name, getCompilerOptionValueTypeString(opt)));
|
|
33837
33716
|
}
|
|
33838
33717
|
if (args[i] !== "null") {
|
|
@@ -33872,7 +33751,6 @@ var ts;
|
|
|
33872
33751
|
}
|
|
33873
33752
|
return i;
|
|
33874
33753
|
}
|
|
33875
|
-
ts.parseOptionValue = parseOptionValue;
|
|
33876
33754
|
ts.compilerOptionsDidYouMeanDiagnostics = {
|
|
33877
33755
|
alternateMode: compilerOptionsAlternateMode,
|
|
33878
33756
|
getOptionsNameMap: getOptionsNameMap,
|
|
@@ -34027,35 +33905,30 @@ var ts;
|
|
|
34027
33905
|
_tsconfigRootOptions = {
|
|
34028
33906
|
name: undefined,
|
|
34029
33907
|
type: "object",
|
|
34030
|
-
category: ts.Diagnostics.Command_line_Options,
|
|
34031
33908
|
elementOptions: commandLineOptionsToMap([
|
|
34032
33909
|
{
|
|
34033
33910
|
name: "compilerOptions",
|
|
34034
33911
|
type: "object",
|
|
34035
33912
|
elementOptions: getCommandLineCompilerOptionsMap(),
|
|
34036
33913
|
extraKeyDiagnostics: ts.compilerOptionsDidYouMeanDiagnostics,
|
|
34037
|
-
category: ts.Diagnostics.Command_line_Options,
|
|
34038
33914
|
},
|
|
34039
33915
|
{
|
|
34040
33916
|
name: "watchOptions",
|
|
34041
33917
|
type: "object",
|
|
34042
33918
|
elementOptions: getCommandLineWatchOptionsMap(),
|
|
34043
33919
|
extraKeyDiagnostics: watchOptionsDidYouMeanDiagnostics,
|
|
34044
|
-
category: ts.Diagnostics.Command_line_Options,
|
|
34045
33920
|
},
|
|
34046
33921
|
{
|
|
34047
33922
|
name: "typingOptions",
|
|
34048
33923
|
type: "object",
|
|
34049
33924
|
elementOptions: getCommandLineTypeAcquisitionMap(),
|
|
34050
33925
|
extraKeyDiagnostics: typeAcquisitionDidYouMeanDiagnostics,
|
|
34051
|
-
category: ts.Diagnostics.Command_line_Options,
|
|
34052
33926
|
},
|
|
34053
33927
|
{
|
|
34054
33928
|
name: "typeAcquisition",
|
|
34055
33929
|
type: "object",
|
|
34056
33930
|
elementOptions: getCommandLineTypeAcquisitionMap(),
|
|
34057
|
-
extraKeyDiagnostics: typeAcquisitionDidYouMeanDiagnostics
|
|
34058
|
-
category: ts.Diagnostics.Command_line_Options,
|
|
33931
|
+
extraKeyDiagnostics: typeAcquisitionDidYouMeanDiagnostics
|
|
34059
33932
|
},
|
|
34060
33933
|
{
|
|
34061
33934
|
name: "extends",
|
|
@@ -34067,7 +33940,6 @@ var ts;
|
|
|
34067
33940
|
type: "list",
|
|
34068
33941
|
element: {
|
|
34069
33942
|
name: "references",
|
|
34070
|
-
category: ts.Diagnostics.Projects,
|
|
34071
33943
|
type: "object"
|
|
34072
33944
|
},
|
|
34073
33945
|
category: ts.Diagnostics.Projects,
|
|
@@ -34077,7 +33949,6 @@ var ts;
|
|
|
34077
33949
|
type: "list",
|
|
34078
33950
|
element: {
|
|
34079
33951
|
name: "files",
|
|
34080
|
-
category: ts.Diagnostics.File_Management,
|
|
34081
33952
|
type: "string"
|
|
34082
33953
|
},
|
|
34083
33954
|
category: ts.Diagnostics.File_Management,
|
|
@@ -34087,7 +33958,6 @@ var ts;
|
|
|
34087
33958
|
type: "list",
|
|
34088
33959
|
element: {
|
|
34089
33960
|
name: "include",
|
|
34090
|
-
category: ts.Diagnostics.File_Management,
|
|
34091
33961
|
type: "string"
|
|
34092
33962
|
},
|
|
34093
33963
|
category: ts.Diagnostics.File_Management,
|
|
@@ -34098,7 +33968,6 @@ var ts;
|
|
|
34098
33968
|
type: "list",
|
|
34099
33969
|
element: {
|
|
34100
33970
|
name: "exclude",
|
|
34101
|
-
category: ts.Diagnostics.File_Management,
|
|
34102
33971
|
type: "string"
|
|
34103
33972
|
},
|
|
34104
33973
|
category: ts.Diagnostics.File_Management,
|
|
@@ -34461,8 +34330,8 @@ var ts;
|
|
|
34461
34330
|
entries.push({ value: "" });
|
|
34462
34331
|
}
|
|
34463
34332
|
entries.push({ value: "/* ".concat(category, " */") });
|
|
34464
|
-
for (var _i = 0,
|
|
34465
|
-
var option =
|
|
34333
|
+
for (var _i = 0, options_1 = options; _i < options_1.length; _i++) {
|
|
34334
|
+
var option = options_1[_i];
|
|
34466
34335
|
var optionName = void 0;
|
|
34467
34336
|
if (compilerOptionsMap.has(option.name)) {
|
|
34468
34337
|
optionName = "\"".concat(option.name, "\": ").concat(JSON.stringify(compilerOptionsMap.get(option.name))).concat((seenKnownKeys += 1) === compilerOptionsMap.size ? "" : ",");
|
|
@@ -36911,7 +36780,7 @@ var ts;
|
|
|
36911
36780
|
var _a, _b;
|
|
36912
36781
|
if (path === undefined)
|
|
36913
36782
|
return path;
|
|
36914
|
-
return ts.
|
|
36783
|
+
return ts.getNormalizedAbsolutePath(path, (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a));
|
|
36915
36784
|
}
|
|
36916
36785
|
function combineDirectoryPath(root, dir) {
|
|
36917
36786
|
return ts.ensureTrailingDirectorySeparator(ts.combinePaths(root, dir));
|
|
@@ -36926,7 +36795,7 @@ var ts;
|
|
|
36926
36795
|
if ((extensions === Extensions.TypeScript || extensions === Extensions.JavaScript || extensions === Extensions.Json)
|
|
36927
36796
|
&& (state.compilerOptions.declarationDir || state.compilerOptions.outDir)
|
|
36928
36797
|
&& finalPath.indexOf("/node_modules/") === -1
|
|
36929
|
-
&& (state.compilerOptions.configFile ? ts.
|
|
36798
|
+
&& (state.compilerOptions.configFile ? ts.containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames()) : true)) {
|
|
36930
36799
|
var getCanonicalFileName = ts.hostGetCanonicalFileName({ useCaseSensitiveFileNames: useCaseSensitiveFileNames });
|
|
36931
36800
|
var commonSourceDirGuesses = [];
|
|
36932
36801
|
if (state.compilerOptions.rootDir || (state.compilerOptions.composite && state.compilerOptions.configFilePath)) {
|
|
@@ -36956,7 +36825,7 @@ var ts;
|
|
|
36956
36825
|
var candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess);
|
|
36957
36826
|
for (var _e = 0, candidateDirectories_1 = candidateDirectories; _e < candidateDirectories_1.length; _e++) {
|
|
36958
36827
|
var candidateDir = candidateDirectories_1[_e];
|
|
36959
|
-
if (ts.
|
|
36828
|
+
if (ts.containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames())) {
|
|
36960
36829
|
var pathFragment = finalPath.slice(candidateDir.length + 1);
|
|
36961
36830
|
var possibleInputBase = ts.combinePaths(commonSourceDirGuess, pathFragment);
|
|
36962
36831
|
var jsAndDtsExtensions = [".mjs", ".cjs", ".js", ".json", ".d.mts", ".d.cts", ".d.ts"];
|
|
@@ -37444,7 +37313,7 @@ var ts;
|
|
|
37444
37313
|
}
|
|
37445
37314
|
return bindSourceFile;
|
|
37446
37315
|
function bindInStrictMode(file, opts) {
|
|
37447
|
-
if (ts.getStrictOptionValue(
|
|
37316
|
+
if (ts.getStrictOptionValue(opts, "alwaysStrict") && !file.isDeclarationFile) {
|
|
37448
37317
|
return true;
|
|
37449
37318
|
}
|
|
37450
37319
|
else {
|
|
@@ -38294,7 +38163,7 @@ var ts;
|
|
|
38294
38163
|
var clause = clauses[i];
|
|
38295
38164
|
bind(clause);
|
|
38296
38165
|
fallthroughFlow = currentFlow;
|
|
38297
|
-
if (!(currentFlow.flags & 1) && i !== clauses.length - 1 &&
|
|
38166
|
+
if (!(currentFlow.flags & 1) && i !== clauses.length - 1 && options.noFallthroughCasesInSwitch) {
|
|
38298
38167
|
clause.fallthroughFlowNode = currentFlow;
|
|
38299
38168
|
}
|
|
38300
38169
|
}
|
|
@@ -40281,16 +40150,16 @@ var ts;
|
|
|
40281
40150
|
var moduleKind = ts.getEmitModuleKind(compilerOptions);
|
|
40282
40151
|
var useDefineForClassFields = ts.getUseDefineForClassFields(compilerOptions);
|
|
40283
40152
|
var allowSyntheticDefaultImports = ts.getAllowSyntheticDefaultImports(compilerOptions);
|
|
40284
|
-
var strictNullChecks =
|
|
40285
|
-
var strictFunctionTypes =
|
|
40286
|
-
var strictBindCallApply =
|
|
40287
|
-
var strictPropertyInitialization =
|
|
40288
|
-
var noImplicitAny =
|
|
40289
|
-
var noImplicitThis =
|
|
40290
|
-
var useUnknownInCatchVariables =
|
|
40153
|
+
var strictNullChecks = ts.getStrictOptionValue(compilerOptions, "strictNullChecks");
|
|
40154
|
+
var strictFunctionTypes = ts.getStrictOptionValue(compilerOptions, "strictFunctionTypes");
|
|
40155
|
+
var strictBindCallApply = ts.getStrictOptionValue(compilerOptions, "strictBindCallApply");
|
|
40156
|
+
var strictPropertyInitialization = ts.getStrictOptionValue(compilerOptions, "strictPropertyInitialization");
|
|
40157
|
+
var noImplicitAny = ts.getStrictOptionValue(compilerOptions, "noImplicitAny");
|
|
40158
|
+
var noImplicitThis = ts.getStrictOptionValue(compilerOptions, "noImplicitThis");
|
|
40159
|
+
var useUnknownInCatchVariables = ts.getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
|
|
40291
40160
|
var keyofStringsOnly = !!compilerOptions.keyofStringsOnly;
|
|
40292
40161
|
var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8192;
|
|
40293
|
-
var exactOptionalPropertyTypes =
|
|
40162
|
+
var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes;
|
|
40294
40163
|
var checkBinaryExpression = createCheckBinaryExpression();
|
|
40295
40164
|
var emitResolver = createResolver();
|
|
40296
40165
|
var nodeBuilder = createNodeBuilder();
|
|
@@ -40535,8 +40404,8 @@ var ts;
|
|
|
40535
40404
|
getFalseType: function (fresh) { return fresh ? falseType : regularFalseType; },
|
|
40536
40405
|
getTrueType: function (fresh) { return fresh ? trueType : regularTrueType; },
|
|
40537
40406
|
getVoidType: function () { return voidType; },
|
|
40538
|
-
getUndefinedType: function (
|
|
40539
|
-
getNullType: function (
|
|
40407
|
+
getUndefinedType: function () { return undefinedType; },
|
|
40408
|
+
getNullType: function () { return nullType; },
|
|
40540
40409
|
getESSymbolType: function () { return esSymbolType; },
|
|
40541
40410
|
getNeverType: function () { return neverType; },
|
|
40542
40411
|
getOptionalType: function () { return optionalType; },
|
|
@@ -40594,7 +40463,7 @@ var ts;
|
|
|
40594
40463
|
ts.Debug.assert(!!(getNodeLinks(file).flags & 1));
|
|
40595
40464
|
diagnostics = ts.addRange(diagnostics, suggestionDiagnostics.getDiagnostics(file.fileName));
|
|
40596
40465
|
checkUnusedIdentifiers(getPotentiallyUnusedIdentifiers(file), function (containingNode, kind, diag) {
|
|
40597
|
-
if (!ts.containsParseError(containingNode) && !unusedIsError(kind, !!(containingNode.flags & 16777216)
|
|
40466
|
+
if (!ts.containsParseError(containingNode) && !unusedIsError(kind, !!(containingNode.flags & 16777216))) {
|
|
40598
40467
|
(diagnostics || (diagnostics = [])).push(__assign(__assign({}, diag), { category: ts.DiagnosticCategory.Suggestion }));
|
|
40599
40468
|
}
|
|
40600
40469
|
});
|
|
@@ -40679,16 +40548,11 @@ var ts;
|
|
|
40679
40548
|
var unknownType = createIntrinsicType(2, "unknown");
|
|
40680
40549
|
var nonNullUnknownType = createIntrinsicType(2, "unknown");
|
|
40681
40550
|
var undefinedType = createIntrinsicType(32768, "undefined");
|
|
40682
|
-
var
|
|
40683
|
-
var undefinedWideningType = createIntrinsicType(32768, "undefined", 65536);
|
|
40684
|
-
var getUndefinedWideningType = function (context) { return strictNullChecks(context) ? undefinedType : undefinedWideningType; };
|
|
40551
|
+
var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768, "undefined", 65536);
|
|
40685
40552
|
var optionalType = createIntrinsicType(32768, "undefined");
|
|
40686
|
-
var missingType = createIntrinsicType(32768, "undefined");
|
|
40687
|
-
var getMissingOrUndefinedType = function (context) { return exactOptionalPropertyTypes(context) ? missingType : undefinedType; };
|
|
40553
|
+
var missingType = exactOptionalPropertyTypes ? createIntrinsicType(32768, "undefined") : undefinedType;
|
|
40688
40554
|
var nullType = createIntrinsicType(65536, "null");
|
|
40689
|
-
var nullWideningType = createIntrinsicType(65536, "null", 65536);
|
|
40690
|
-
var nullPermissiveType = createIntrinsicType(65536, "null");
|
|
40691
|
-
var getNullWideningType = function (context) { return strictNullChecks(context) ? nullType : nullWideningType; };
|
|
40555
|
+
var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536, "null", 65536);
|
|
40692
40556
|
var stringType = createIntrinsicType(4, "string");
|
|
40693
40557
|
var numberType = createIntrinsicType(8, "number");
|
|
40694
40558
|
var bigintType = createIntrinsicType(64, "bigint");
|
|
@@ -40741,7 +40605,7 @@ var ts;
|
|
|
40741
40605
|
var emptyTypeLiteralSymbol = createSymbol(2048, "__type");
|
|
40742
40606
|
emptyTypeLiteralSymbol.members = ts.createSymbolTable();
|
|
40743
40607
|
var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
40744
|
-
var unknownUnionType = getUnionType([undefinedType, nullType, createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray)]);
|
|
40608
|
+
var unknownUnionType = strictNullChecks ? getUnionType([undefinedType, nullType, createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray)]) : unknownType;
|
|
40745
40609
|
var emptyGenericType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
40746
40610
|
emptyGenericType.instantiations = new ts.Map();
|
|
40747
40611
|
var anyFunctionType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
@@ -40904,15 +40768,6 @@ var ts;
|
|
|
40904
40768
|
];
|
|
40905
40769
|
initializeTypeChecker();
|
|
40906
40770
|
return checker;
|
|
40907
|
-
function getSourceFileOfNode(node) {
|
|
40908
|
-
if (!node)
|
|
40909
|
-
return node;
|
|
40910
|
-
var links = getNodeLinks(node);
|
|
40911
|
-
if (!ts.hasProperty(links, "sourceFile")) {
|
|
40912
|
-
links.sourceFile = ts.getSourceFileOfNode(node);
|
|
40913
|
-
}
|
|
40914
|
-
return links.sourceFile;
|
|
40915
|
-
}
|
|
40916
40771
|
function getCachedType(key) {
|
|
40917
40772
|
return key ? cachedTypes.get(key) : undefined;
|
|
40918
40773
|
}
|
|
@@ -40923,7 +40778,7 @@ var ts;
|
|
|
40923
40778
|
}
|
|
40924
40779
|
function getJsxNamespace(location) {
|
|
40925
40780
|
if (location) {
|
|
40926
|
-
var file = getSourceFileOfNode(location);
|
|
40781
|
+
var file = ts.getSourceFileOfNode(location);
|
|
40927
40782
|
if (file) {
|
|
40928
40783
|
if (ts.isJsxOpeningFragment(location)) {
|
|
40929
40784
|
if (file.localJsxFragmentNamespace) {
|
|
@@ -41033,7 +40888,7 @@ var ts;
|
|
|
41033
40888
|
if (!isError) {
|
|
41034
40889
|
return;
|
|
41035
40890
|
}
|
|
41036
|
-
var file = getSourceFileOfNode(location);
|
|
40891
|
+
var file = ts.getSourceFileOfNode(location);
|
|
41037
40892
|
addErrorOrSuggestion(isError, "message" in message ? ts.createFileDiagnostic(file, 0, 0, message, arg0, arg1, arg2, arg3) : ts.createDiagnosticForFileFromMessageChain(file, message));
|
|
41038
40893
|
return;
|
|
41039
40894
|
}
|
|
@@ -41179,8 +41034,8 @@ var ts;
|
|
|
41179
41034
|
var message = isEitherEnum ? ts.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations
|
|
41180
41035
|
: isEitherBlockScoped_1 ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0
|
|
41181
41036
|
: ts.Diagnostics.Duplicate_identifier_0;
|
|
41182
|
-
var sourceSymbolFile = source.declarations && getSourceFileOfNode(source.declarations[0]);
|
|
41183
|
-
var targetSymbolFile = target.declarations && getSourceFileOfNode(target.declarations[0]);
|
|
41037
|
+
var sourceSymbolFile = source.declarations && ts.getSourceFileOfNode(source.declarations[0]);
|
|
41038
|
+
var targetSymbolFile = target.declarations && ts.getSourceFileOfNode(target.declarations[0]);
|
|
41184
41039
|
var isSourcePlainJs = ts.isPlainJsFile(sourceSymbolFile, compilerOptions.checkJs);
|
|
41185
41040
|
var isTargetPlainJs = ts.isPlainJsFile(targetSymbolFile, compilerOptions.checkJs);
|
|
41186
41041
|
var symbolName_1 = symbolToString(source);
|
|
@@ -41356,8 +41211,8 @@ var ts;
|
|
|
41356
41211
|
return ts.Debug.fail("There should exist two symbols, one as property declaration and one as parameter declaration");
|
|
41357
41212
|
}
|
|
41358
41213
|
function isBlockScopedNameDeclaredBeforeUse(declaration, usage) {
|
|
41359
|
-
var declarationFile = getSourceFileOfNode(declaration);
|
|
41360
|
-
var useFile = getSourceFileOfNode(usage);
|
|
41214
|
+
var declarationFile = ts.getSourceFileOfNode(declaration);
|
|
41215
|
+
var useFile = ts.getSourceFileOfNode(usage);
|
|
41361
41216
|
var declContainer = ts.getEnclosingBlockScopeContainer(declaration);
|
|
41362
41217
|
if (declarationFile !== useFile) {
|
|
41363
41218
|
if ((moduleKind && (declarationFile.externalModuleIndicator || useFile.externalModuleIndicator)) ||
|
|
@@ -42241,7 +42096,7 @@ var ts;
|
|
|
42241
42096
|
return ((ts.isExportAssignment(node) && !node.isExportEquals) || ts.hasSyntacticModifier(node, 512) || ts.isExportSpecifier(node));
|
|
42242
42097
|
}
|
|
42243
42098
|
function getUsageModeForExpression(usage) {
|
|
42244
|
-
return ts.isStringLiteralLike(usage) ? ts.getModeForUsageLocation(getSourceFileOfNode(usage), usage) : undefined;
|
|
42099
|
+
return ts.isStringLiteralLike(usage) ? ts.getModeForUsageLocation(ts.getSourceFileOfNode(usage), usage) : undefined;
|
|
42245
42100
|
}
|
|
42246
42101
|
function isESMFormatImportImportingCommonjsFormatFile(usageMode, targetMode) {
|
|
42247
42102
|
return usageMode === ts.ModuleKind.ESNext && targetMode === ts.ModuleKind.CommonJS;
|
|
@@ -42910,7 +42765,7 @@ var ts;
|
|
|
42910
42765
|
if (ambientModule) {
|
|
42911
42766
|
return ambientModule;
|
|
42912
42767
|
}
|
|
42913
|
-
var currentSourceFile = getSourceFileOfNode(location);
|
|
42768
|
+
var currentSourceFile = ts.getSourceFileOfNode(location);
|
|
42914
42769
|
var contextSpecifier = ts.isStringLiteralLike(location)
|
|
42915
42770
|
? location
|
|
42916
42771
|
: ((_a = ts.findAncestor(location, ts.isImportCall)) === null || _a === void 0 ? void 0 : _a.arguments[0]) ||
|
|
@@ -42921,7 +42776,7 @@ var ts;
|
|
|
42921
42776
|
((_f = (ts.isLiteralImportTypeNode(location) ? location : undefined)) === null || _f === void 0 ? void 0 : _f.argument.literal);
|
|
42922
42777
|
var mode = contextSpecifier && ts.isStringLiteralLike(contextSpecifier) ? ts.getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
|
|
42923
42778
|
var resolvedModule = ts.getResolvedModule(currentSourceFile, moduleReference, mode);
|
|
42924
|
-
var resolutionDiagnostic = resolvedModule && ts.getResolutionDiagnostic(
|
|
42779
|
+
var resolutionDiagnostic = resolvedModule && ts.getResolutionDiagnostic(compilerOptions, resolvedModule);
|
|
42925
42780
|
var sourceFile = resolvedModule
|
|
42926
42781
|
&& (!resolutionDiagnostic || resolutionDiagnostic === ts.Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set)
|
|
42927
42782
|
&& host.getSourceFile(resolvedModule.resolvedFileName);
|
|
@@ -42991,7 +42846,7 @@ var ts;
|
|
|
42991
42846
|
error(errorNode, diag, moduleReference, resolvedModule.resolvedFileName);
|
|
42992
42847
|
}
|
|
42993
42848
|
else {
|
|
42994
|
-
errorOnImplicitAnyModule(noImplicitAny
|
|
42849
|
+
errorOnImplicitAnyModule(noImplicitAny && !!moduleNotFoundError, errorNode, resolvedModule, moduleReference);
|
|
42995
42850
|
}
|
|
42996
42851
|
return undefined;
|
|
42997
42852
|
}
|
|
@@ -43289,7 +43144,7 @@ var ts;
|
|
|
43289
43144
|
return getMergedSymbol(symbol.parent && getLateBoundSymbol(symbol.parent));
|
|
43290
43145
|
}
|
|
43291
43146
|
function getAlternativeContainingModules(symbol, enclosingDeclaration) {
|
|
43292
|
-
var containingFile = getSourceFileOfNode(enclosingDeclaration);
|
|
43147
|
+
var containingFile = ts.getSourceFileOfNode(enclosingDeclaration);
|
|
43293
43148
|
var id = getNodeId(containingFile);
|
|
43294
43149
|
var links = getSymbolLinks(symbol);
|
|
43295
43150
|
var results;
|
|
@@ -43368,7 +43223,7 @@ var ts;
|
|
|
43368
43223
|
}
|
|
43369
43224
|
if (ts.isClassExpression(d) && ts.isBinaryExpression(d.parent) && d.parent.operatorToken.kind === 63 && ts.isAccessExpression(d.parent.left) && ts.isEntityNameExpression(d.parent.left.expression)) {
|
|
43370
43225
|
if (ts.isModuleExportsAccessExpression(d.parent.left) || ts.isExportsIdentifier(d.parent.left.expression)) {
|
|
43371
|
-
return getSymbolOfNode(getSourceFileOfNode(d));
|
|
43226
|
+
return getSymbolOfNode(ts.getSourceFileOfNode(d));
|
|
43372
43227
|
}
|
|
43373
43228
|
checkExpressionCached(d.parent.left.expression);
|
|
43374
43229
|
return getNodeLinks(d.parent.left.expression).resolvedSymbol;
|
|
@@ -43612,7 +43467,7 @@ var ts;
|
|
|
43612
43467
|
if (symbolFromSymbolTable.flags & 2097152
|
|
43613
43468
|
&& symbolFromSymbolTable.escapedName !== "export="
|
|
43614
43469
|
&& symbolFromSymbolTable.escapedName !== "default"
|
|
43615
|
-
&& !(ts.isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && ts.isExternalModule(getSourceFileOfNode(enclosingDeclaration)))
|
|
43470
|
+
&& !(ts.isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && ts.isExternalModule(ts.getSourceFileOfNode(enclosingDeclaration)))
|
|
43616
43471
|
&& (!useOnlyExternalAliasing || ts.some(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration))
|
|
43617
43472
|
&& (isLocalNameLookup ? !ts.some(symbolFromSymbolTable.declarations, ts.isNamespaceReexportDeclaration) : true)
|
|
43618
43473
|
&& (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 277))) {
|
|
@@ -43881,7 +43736,7 @@ var ts;
|
|
|
43881
43736
|
function symbolToStringWorker(writer) {
|
|
43882
43737
|
var entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags);
|
|
43883
43738
|
var printer = (enclosingDeclaration === null || enclosingDeclaration === void 0 ? void 0 : enclosingDeclaration.kind) === 307 ? ts.createPrinter({ removeComments: true, neverAsciiEscape: true }) : ts.createPrinter({ removeComments: true });
|
|
43884
|
-
var sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
43739
|
+
var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration);
|
|
43885
43740
|
printer.writeNode(4, entity, sourceFile, writer);
|
|
43886
43741
|
return writer;
|
|
43887
43742
|
}
|
|
@@ -43899,7 +43754,7 @@ var ts;
|
|
|
43899
43754
|
}
|
|
43900
43755
|
var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 | 512);
|
|
43901
43756
|
var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true });
|
|
43902
|
-
var sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
43757
|
+
var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration);
|
|
43903
43758
|
printer.writeNode(4, sig, sourceFile, ts.getTrailingSemicolonDeferringWriter(writer));
|
|
43904
43759
|
return writer;
|
|
43905
43760
|
}
|
|
@@ -43913,7 +43768,7 @@ var ts;
|
|
|
43913
43768
|
return ts.Debug.fail("should always get typenode");
|
|
43914
43769
|
var options = { removeComments: type !== unresolvedType };
|
|
43915
43770
|
var printer = ts.createPrinter(options);
|
|
43916
|
-
var sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
43771
|
+
var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration);
|
|
43917
43772
|
printer.writeNode(4, typeNode, sourceFile, writer);
|
|
43918
43773
|
var result = writer.getText();
|
|
43919
43774
|
var maxLength = noTruncation ? ts.noTruncationMaximumTruncationLength * 2 : ts.defaultMaximumTruncationLength * 2;
|
|
@@ -44964,7 +44819,7 @@ var ts;
|
|
|
44964
44819
|
}
|
|
44965
44820
|
var parameterType = getTypeOfSymbol(parameterSymbol);
|
|
44966
44821
|
if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) {
|
|
44967
|
-
parameterType = getOptionalType(parameterType
|
|
44822
|
+
parameterType = getOptionalType(parameterType);
|
|
44968
44823
|
}
|
|
44969
44824
|
var parameterTypeNode = serializeTypeForDeclaration(context, parameterType, parameterSymbol, context.enclosingDeclaration, privateSymbolVisitor, bundledImports);
|
|
44970
44825
|
var modifiers = !(context.flags & 8192) && preserveModifierFlags && parameterDeclaration && ts.canHaveModifiers(parameterDeclaration) ? ts.map(ts.getModifiers(parameterDeclaration), ts.factory.cloneNode) : undefined;
|
|
@@ -45151,9 +45006,9 @@ var ts;
|
|
|
45151
45006
|
if (ambientModuleSymbolRegex.test(symbol.escapedName)) {
|
|
45152
45007
|
return symbol.escapedName.substring(1, symbol.escapedName.length - 1);
|
|
45153
45008
|
}
|
|
45154
|
-
return getSourceFileOfNode(ts.getNonAugmentationDeclaration(symbol)).fileName;
|
|
45009
|
+
return ts.getSourceFileOfNode(ts.getNonAugmentationDeclaration(symbol)).fileName;
|
|
45155
45010
|
}
|
|
45156
|
-
var contextFile = getSourceFileOfNode(ts.getOriginalNode(context.enclosingDeclaration));
|
|
45011
|
+
var contextFile = ts.getSourceFileOfNode(ts.getOriginalNode(context.enclosingDeclaration));
|
|
45157
45012
|
var resolutionMode = overrideImportMode || (contextFile === null || contextFile === void 0 ? void 0 : contextFile.impliedNodeFormat);
|
|
45158
45013
|
var cacheKey = getSpecifierCacheKey(contextFile.path, resolutionMode);
|
|
45159
45014
|
var links = getSymbolLinks(symbol);
|
|
@@ -45187,7 +45042,7 @@ var ts;
|
|
|
45187
45042
|
if (ts.some(chain[0].declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {
|
|
45188
45043
|
var nonRootParts = chain.length > 1 ? createAccessFromSymbolChain(chain, chain.length - 1, 1) : undefined;
|
|
45189
45044
|
var typeParameterNodes = overrideTypeArguments || lookupTypeParameterNodes(chain, 0, context);
|
|
45190
|
-
var contextFile = getSourceFileOfNode(ts.getOriginalNode(context.enclosingDeclaration));
|
|
45045
|
+
var contextFile = ts.getSourceFileOfNode(ts.getOriginalNode(context.enclosingDeclaration));
|
|
45191
45046
|
var targetFile = ts.getSourceFileOfModule(chain[0]);
|
|
45192
45047
|
var specifier = void 0;
|
|
45193
45048
|
var assertion = void 0;
|
|
@@ -45490,7 +45345,7 @@ var ts;
|
|
|
45490
45345
|
}
|
|
45491
45346
|
var oldFlags = context.flags;
|
|
45492
45347
|
if (type.flags & 8192 &&
|
|
45493
|
-
type.symbol === symbol && (!context.enclosingDeclaration || ts.some(symbol.declarations, function (d) { return getSourceFileOfNode(d) === getSourceFileOfNode(context.enclosingDeclaration); }))) {
|
|
45348
|
+
type.symbol === symbol && (!context.enclosingDeclaration || ts.some(symbol.declarations, function (d) { return ts.getSourceFileOfNode(d) === ts.getSourceFileOfNode(context.enclosingDeclaration); }))) {
|
|
45494
45349
|
context.flags |= 1048576;
|
|
45495
45350
|
}
|
|
45496
45351
|
var result = typeToTypeNodeHelper(type, context);
|
|
@@ -45503,7 +45358,7 @@ var ts;
|
|
|
45503
45358
|
return true;
|
|
45504
45359
|
}
|
|
45505
45360
|
if (ts.isParameter(annotatedDeclaration) && annotatedDeclaration.questionToken) {
|
|
45506
|
-
return getTypeWithFacts(type, 524288
|
|
45361
|
+
return getTypeWithFacts(type, 524288) === typeFromTypeNode;
|
|
45507
45362
|
}
|
|
45508
45363
|
return false;
|
|
45509
45364
|
}
|
|
@@ -45554,7 +45409,7 @@ var ts;
|
|
|
45554
45409
|
cancellationToken.throwIfCancellationRequested();
|
|
45555
45410
|
}
|
|
45556
45411
|
var hadError = false;
|
|
45557
|
-
var file = getSourceFileOfNode(existing);
|
|
45412
|
+
var file = ts.getSourceFileOfNode(existing);
|
|
45558
45413
|
var transformed = ts.visitNode(existing, visitExistingNodeTreeSymbols);
|
|
45559
45414
|
if (hadError) {
|
|
45560
45415
|
return undefined;
|
|
@@ -45982,7 +45837,7 @@ var ts;
|
|
|
45982
45837
|
if (ts.canHaveModifiers(node)) {
|
|
45983
45838
|
var newModifierFlags = 0;
|
|
45984
45839
|
var enclosingDeclaration_1 = context.enclosingDeclaration &&
|
|
45985
|
-
(ts.isJSDocTypeAlias(context.enclosingDeclaration) ? getSourceFileOfNode(context.enclosingDeclaration) : context.enclosingDeclaration);
|
|
45840
|
+
(ts.isJSDocTypeAlias(context.enclosingDeclaration) ? ts.getSourceFileOfNode(context.enclosingDeclaration) : context.enclosingDeclaration);
|
|
45986
45841
|
if (additionalModifierFlags & 1 &&
|
|
45987
45842
|
enclosingDeclaration_1 && (isExportingScope(enclosingDeclaration_1) || ts.isModuleDeclaration(enclosingDeclaration_1)) &&
|
|
45988
45843
|
canHaveExportModifier(node)) {
|
|
@@ -46050,14 +45905,14 @@ var ts;
|
|
|
46050
45905
|
serializeAsNamespaceDeclaration(realMembers, localName, modifierFlags, !!(symbol.flags & (16 | 67108864)));
|
|
46051
45906
|
}
|
|
46052
45907
|
if (ts.length(mergedMembers)) {
|
|
46053
|
-
var containingFile_1 = getSourceFileOfNode(context.enclosingDeclaration);
|
|
45908
|
+
var containingFile_1 = ts.getSourceFileOfNode(context.enclosingDeclaration);
|
|
46054
45909
|
var localName = getInternalSymbolName(symbol, symbolName);
|
|
46055
45910
|
var nsBody = ts.factory.createModuleBlock([ts.factory.createExportDeclaration(undefined, false, ts.factory.createNamedExports(ts.mapDefined(ts.filter(mergedMembers, function (n) { return n.escapedName !== "export="; }), function (s) {
|
|
46056
45911
|
var _a, _b;
|
|
46057
45912
|
var name = ts.unescapeLeadingUnderscores(s.escapedName);
|
|
46058
45913
|
var localName = getInternalSymbolName(s, name);
|
|
46059
45914
|
var aliasDecl = s.declarations && getDeclarationOfAliasSymbol(s);
|
|
46060
|
-
if (containingFile_1 && (aliasDecl ? containingFile_1 !== getSourceFileOfNode(aliasDecl) : !ts.some(s.declarations, function (d) { return getSourceFileOfNode(d) === containingFile_1; }))) {
|
|
45915
|
+
if (containingFile_1 && (aliasDecl ? containingFile_1 !== ts.getSourceFileOfNode(aliasDecl) : !ts.some(s.declarations, function (d) { return ts.getSourceFileOfNode(d) === containingFile_1; }))) {
|
|
46061
45916
|
(_b = (_a = context.tracker) === null || _a === void 0 ? void 0 : _a.reportNonlocalAugmentation) === null || _b === void 0 ? void 0 : _b.call(_a, containingFile_1, symbol, s);
|
|
46062
45917
|
return undefined;
|
|
46063
45918
|
}
|
|
@@ -46104,7 +45959,7 @@ var ts;
|
|
|
46104
45959
|
if (ts.length(props)) {
|
|
46105
45960
|
var localVsRemoteMap = ts.arrayToMultiMap(props, function (p) {
|
|
46106
45961
|
return !ts.length(p.declarations) || ts.some(p.declarations, function (d) {
|
|
46107
|
-
return getSourceFileOfNode(d) === getSourceFileOfNode(context.enclosingDeclaration);
|
|
45962
|
+
return ts.getSourceFileOfNode(d) === ts.getSourceFileOfNode(context.enclosingDeclaration);
|
|
46108
45963
|
}) ? "local" : "remote";
|
|
46109
45964
|
});
|
|
46110
45965
|
var localProps = localVsRemoteMap.get("local") || ts.emptyArray;
|
|
@@ -46327,7 +46182,7 @@ var ts;
|
|
|
46327
46182
|
var isExportAssignmentCompatibleSymbolName = isExportEquals || isDefault;
|
|
46328
46183
|
var aliasDecl = symbol.declarations && getDeclarationOfAliasSymbol(symbol);
|
|
46329
46184
|
var target = aliasDecl && getTargetOfAliasDeclaration(aliasDecl, true);
|
|
46330
|
-
if (target && ts.length(target.declarations) && ts.some(target.declarations, function (d) { return getSourceFileOfNode(d) === getSourceFileOfNode(enclosingDeclaration); })) {
|
|
46185
|
+
if (target && ts.length(target.declarations) && ts.some(target.declarations, function (d) { return ts.getSourceFileOfNode(d) === ts.getSourceFileOfNode(enclosingDeclaration); })) {
|
|
46331
46186
|
var expr = aliasDecl && ((ts.isExportAssignment(aliasDecl) || ts.isBinaryExpression(aliasDecl)) ? ts.getExportAssignmentExpression(aliasDecl) : ts.getPropertyAssignmentAliasLikeExpression(aliasDecl));
|
|
46332
46187
|
var first_1 = expr && ts.isEntityNameExpression(expr) ? getFirstNonModuleExportsIdentifier(expr) : undefined;
|
|
46333
46188
|
var referenced = first_1 && resolveEntityName(first_1, 67108863, true, true, enclosingDeclaration);
|
|
@@ -46381,16 +46236,16 @@ var ts;
|
|
|
46381
46236
|
}
|
|
46382
46237
|
}
|
|
46383
46238
|
function isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, hostSymbol) {
|
|
46384
|
-
var ctxSrc = getSourceFileOfNode(context.enclosingDeclaration);
|
|
46239
|
+
var ctxSrc = ts.getSourceFileOfNode(context.enclosingDeclaration);
|
|
46385
46240
|
return ts.getObjectFlags(typeToSerialize) & (16 | 32) &&
|
|
46386
46241
|
!ts.length(getIndexInfosOfType(typeToSerialize)) &&
|
|
46387
46242
|
!isClassInstanceSide(typeToSerialize) &&
|
|
46388
46243
|
!!(ts.length(ts.filter(getPropertiesOfType(typeToSerialize), isNamespaceMember)) || ts.length(getSignaturesOfType(typeToSerialize, 0))) &&
|
|
46389
46244
|
!ts.length(getSignaturesOfType(typeToSerialize, 1)) &&
|
|
46390
46245
|
!getDeclarationWithTypeAnnotation(hostSymbol, enclosingDeclaration) &&
|
|
46391
|
-
!(typeToSerialize.symbol && ts.some(typeToSerialize.symbol.declarations, function (d) { return getSourceFileOfNode(d) !== ctxSrc; })) &&
|
|
46246
|
+
!(typeToSerialize.symbol && ts.some(typeToSerialize.symbol.declarations, function (d) { return ts.getSourceFileOfNode(d) !== ctxSrc; })) &&
|
|
46392
46247
|
!ts.some(getPropertiesOfType(typeToSerialize), function (p) { return isLateBoundName(p.escapedName); }) &&
|
|
46393
|
-
!ts.some(getPropertiesOfType(typeToSerialize), function (p) { return ts.some(p.declarations, function (d) { return getSourceFileOfNode(d) !== ctxSrc; }); }) &&
|
|
46248
|
+
!ts.some(getPropertiesOfType(typeToSerialize), function (p) { return ts.some(p.declarations, function (d) { return ts.getSourceFileOfNode(d) !== ctxSrc; }); }) &&
|
|
46394
46249
|
ts.every(getPropertiesOfType(typeToSerialize), function (p) { return ts.isIdentifierText(ts.symbolName(p), languageVersion); });
|
|
46395
46250
|
}
|
|
46396
46251
|
function makeSerializePropertySymbol(createProperty, methodKind, useAccessors) {
|
|
@@ -46601,7 +46456,7 @@ var ts;
|
|
|
46601
46456
|
function typePredicateToStringWorker(writer) {
|
|
46602
46457
|
var predicate = ts.factory.createTypePredicateNode(typePredicate.kind === 2 || typePredicate.kind === 3 ? ts.factory.createToken(128) : undefined, typePredicate.kind === 1 || typePredicate.kind === 3 ? ts.factory.createIdentifier(typePredicate.parameterName) : ts.factory.createThisTypeNode(), typePredicate.type && nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 | 512));
|
|
46603
46458
|
var printer = ts.createPrinter({ removeComments: true });
|
|
46604
|
-
var sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
46459
|
+
var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration);
|
|
46605
46460
|
printer.writeNode(4, predicate, sourceFile, writer);
|
|
46606
46461
|
return writer;
|
|
46607
46462
|
}
|
|
@@ -46980,9 +46835,9 @@ var ts;
|
|
|
46980
46835
|
function isGenericTypeWithUndefinedConstraint(type) {
|
|
46981
46836
|
return !!(type.flags & 465829888) && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 32768);
|
|
46982
46837
|
}
|
|
46983
|
-
function getNonUndefinedType(type
|
|
46838
|
+
function getNonUndefinedType(type) {
|
|
46984
46839
|
var typeOrConstraint = someType(type, isGenericTypeWithUndefinedConstraint) ? mapType(type, function (t) { return t.flags & 465829888 ? getBaseConstraintOrType(t) : t; }) : type;
|
|
46985
|
-
return getTypeWithFacts(typeOrConstraint, 524288
|
|
46840
|
+
return getTypeWithFacts(typeOrConstraint, 524288);
|
|
46986
46841
|
}
|
|
46987
46842
|
function getFlowTypeOfDestructuring(node, declaredType) {
|
|
46988
46843
|
var reference = getSyntheticElementAccess(node);
|
|
@@ -47044,17 +46899,17 @@ var ts;
|
|
|
47044
46899
|
return parentType;
|
|
47045
46900
|
}
|
|
47046
46901
|
var pattern = declaration.parent;
|
|
47047
|
-
if (strictNullChecks
|
|
47048
|
-
parentType = getNonNullableType(parentType
|
|
46902
|
+
if (strictNullChecks && declaration.flags & 16777216 && ts.isParameterDeclaration(declaration)) {
|
|
46903
|
+
parentType = getNonNullableType(parentType);
|
|
47049
46904
|
}
|
|
47050
|
-
else if (strictNullChecks
|
|
47051
|
-
parentType = getTypeWithFacts(parentType, 524288
|
|
46905
|
+
else if (strictNullChecks && pattern.parent.initializer && !(getTypeFacts(getTypeOfInitializer(pattern.parent.initializer)) & 65536)) {
|
|
46906
|
+
parentType = getTypeWithFacts(parentType, 524288);
|
|
47052
46907
|
}
|
|
47053
46908
|
var type;
|
|
47054
46909
|
if (pattern.kind === 202) {
|
|
47055
46910
|
if (declaration.dotDotDotToken) {
|
|
47056
46911
|
parentType = getReducedType(parentType);
|
|
47057
|
-
if (parentType.flags & 2 || !isValidSpreadType(parentType
|
|
46912
|
+
if (parentType.flags & 2 || !isValidSpreadType(parentType)) {
|
|
47058
46913
|
error(declaration, ts.Diagnostics.Rest_types_may_only_be_created_from_object_types);
|
|
47059
46914
|
return errorType;
|
|
47060
46915
|
}
|
|
@@ -47096,9 +46951,9 @@ var ts;
|
|
|
47096
46951
|
return type;
|
|
47097
46952
|
}
|
|
47098
46953
|
if (ts.getEffectiveTypeAnnotationNode(ts.walkUpBindingElementsAndPatterns(declaration))) {
|
|
47099
|
-
return strictNullChecks
|
|
46954
|
+
return strictNullChecks && !(getTypeFacts(checkDeclarationInitializer(declaration, 0)) & 16777216) ? getNonUndefinedType(type) : type;
|
|
47100
46955
|
}
|
|
47101
|
-
return widenTypeInferredFromInitializer(declaration, getUnionType([getNonUndefinedType(type
|
|
46956
|
+
return widenTypeInferredFromInitializer(declaration, getUnionType([getNonUndefinedType(type), checkDeclarationInitializer(declaration, 0)], 2));
|
|
47102
46957
|
}
|
|
47103
46958
|
function getTypeForDeclarationFromJSDocComment(declaration) {
|
|
47104
46959
|
var jsdocType = ts.getJSDocType(declaration);
|
|
@@ -47115,14 +46970,14 @@ var ts;
|
|
|
47115
46970
|
var expr = ts.skipParentheses(node, true);
|
|
47116
46971
|
return expr.kind === 205 && expr.elements.length === 0;
|
|
47117
46972
|
}
|
|
47118
|
-
function addOptionality(type,
|
|
46973
|
+
function addOptionality(type, isProperty, isOptional) {
|
|
47119
46974
|
if (isProperty === void 0) { isProperty = false; }
|
|
47120
46975
|
if (isOptional === void 0) { isOptional = true; }
|
|
47121
|
-
return strictNullChecks
|
|
46976
|
+
return strictNullChecks && isOptional ? getOptionalType(type, isProperty) : type;
|
|
47122
46977
|
}
|
|
47123
46978
|
function getTypeForVariableLikeDeclaration(declaration, includeOptionality, checkMode) {
|
|
47124
46979
|
if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 245) {
|
|
47125
|
-
var indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression, checkMode)
|
|
46980
|
+
var indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression, checkMode)));
|
|
47126
46981
|
return indexType.flags & (262144 | 4194304) ? getExtractStringType(indexType) : stringType;
|
|
47127
46982
|
}
|
|
47128
46983
|
if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 246) {
|
|
@@ -47138,9 +46993,9 @@ var ts;
|
|
|
47138
46993
|
isOptionalJSDocPropertyLikeTag(declaration));
|
|
47139
46994
|
var declaredType = tryGetTypeFromEffectiveTypeNode(declaration);
|
|
47140
46995
|
if (declaredType) {
|
|
47141
|
-
return addOptionality(declaredType,
|
|
46996
|
+
return addOptionality(declaredType, isProperty, isOptional);
|
|
47142
46997
|
}
|
|
47143
|
-
if ((noImplicitAny
|
|
46998
|
+
if ((noImplicitAny || ts.isInJSFile(declaration)) &&
|
|
47144
46999
|
ts.isVariableDeclaration(declaration) && !ts.isBindingPattern(declaration.name) &&
|
|
47145
47000
|
!(ts.getCombinedModifierFlags(declaration) & 1) && !(declaration.flags & 16777216)) {
|
|
47146
47001
|
if (!(ts.getCombinedNodeFlags(declaration) & 2) && (!declaration.initializer || isNullOrUndefined(declaration.initializer))) {
|
|
@@ -47169,7 +47024,7 @@ var ts;
|
|
|
47169
47024
|
return parameterTypeOfTypeTag;
|
|
47170
47025
|
var type = declaration.symbol.escapedName === "this" ? getContextualThisParameterType(func) : getContextuallyTypedParameterType(declaration);
|
|
47171
47026
|
if (type) {
|
|
47172
|
-
return addOptionality(type,
|
|
47027
|
+
return addOptionality(type, false, isOptional);
|
|
47173
47028
|
}
|
|
47174
47029
|
}
|
|
47175
47030
|
if (ts.hasOnlyExpressionInitializer(declaration) && !!declaration.initializer) {
|
|
@@ -47180,22 +47035,22 @@ var ts;
|
|
|
47180
47035
|
}
|
|
47181
47036
|
}
|
|
47182
47037
|
var type = widenTypeInferredFromInitializer(declaration, checkDeclarationInitializer(declaration, checkMode));
|
|
47183
|
-
return addOptionality(type,
|
|
47038
|
+
return addOptionality(type, isProperty, isOptional);
|
|
47184
47039
|
}
|
|
47185
|
-
if (ts.isPropertyDeclaration(declaration) && (noImplicitAny
|
|
47040
|
+
if (ts.isPropertyDeclaration(declaration) && (noImplicitAny || ts.isInJSFile(declaration))) {
|
|
47186
47041
|
if (!ts.hasStaticModifier(declaration)) {
|
|
47187
47042
|
var constructor = findConstructorDeclaration(declaration.parent);
|
|
47188
47043
|
var type = constructor ? getFlowTypeInConstructor(declaration.symbol, constructor) :
|
|
47189
47044
|
ts.getEffectiveModifierFlags(declaration) & 2 ? getTypeOfPropertyInBaseClass(declaration.symbol) :
|
|
47190
47045
|
undefined;
|
|
47191
|
-
return type && addOptionality(type,
|
|
47046
|
+
return type && addOptionality(type, true, isOptional);
|
|
47192
47047
|
}
|
|
47193
47048
|
else {
|
|
47194
47049
|
var staticBlocks = ts.filter(declaration.parent.members, ts.isClassStaticBlockDeclaration);
|
|
47195
47050
|
var type = staticBlocks.length ? getFlowTypeInStaticBlocks(declaration.symbol, staticBlocks) :
|
|
47196
47051
|
ts.getEffectiveModifierFlags(declaration) & 2 ? getTypeOfPropertyInBaseClass(declaration.symbol) :
|
|
47197
47052
|
undefined;
|
|
47198
|
-
return type && addOptionality(type,
|
|
47053
|
+
return type && addOptionality(type, true, isOptional);
|
|
47199
47054
|
}
|
|
47200
47055
|
}
|
|
47201
47056
|
if (ts.isJsxAttribute(declaration)) {
|
|
@@ -47225,7 +47080,7 @@ var ts;
|
|
|
47225
47080
|
function isAutoTypedProperty(symbol) {
|
|
47226
47081
|
var declaration = symbol.valueDeclaration;
|
|
47227
47082
|
return declaration && ts.isPropertyDeclaration(declaration) && !ts.getEffectiveTypeAnnotationNode(declaration) &&
|
|
47228
|
-
!declaration.initializer && (noImplicitAny
|
|
47083
|
+
!declaration.initializer && (noImplicitAny || ts.isInJSFile(declaration));
|
|
47229
47084
|
}
|
|
47230
47085
|
function getDeclaringConstructor(symbol) {
|
|
47231
47086
|
if (!symbol.declarations) {
|
|
@@ -47241,7 +47096,7 @@ var ts;
|
|
|
47241
47096
|
;
|
|
47242
47097
|
}
|
|
47243
47098
|
function getFlowTypeFromCommonJSExport(symbol) {
|
|
47244
|
-
var file = getSourceFileOfNode(symbol.declarations[0]);
|
|
47099
|
+
var file = ts.getSourceFileOfNode(symbol.declarations[0]);
|
|
47245
47100
|
var accessName = ts.unescapeLeadingUnderscores(symbol.escapedName);
|
|
47246
47101
|
var areAllModuleExports = symbol.declarations.every(function (d) { return ts.isInJSFile(d) && ts.isAccessExpression(d) && ts.isModuleExportsAccessExpression(d.expression); });
|
|
47247
47102
|
var reference = areAllModuleExports
|
|
@@ -47259,25 +47114,20 @@ var ts;
|
|
|
47259
47114
|
var accessName = ts.startsWith(symbol.escapedName, "__#")
|
|
47260
47115
|
? ts.factory.createPrivateIdentifier(symbol.escapedName.split("@")[1])
|
|
47261
47116
|
: ts.unescapeLeadingUnderscores(symbol.escapedName);
|
|
47262
|
-
var
|
|
47117
|
+
for (var _i = 0, staticBlocks_1 = staticBlocks; _i < staticBlocks_1.length; _i++) {
|
|
47118
|
+
var staticBlock = staticBlocks_1[_i];
|
|
47263
47119
|
var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), accessName);
|
|
47264
47120
|
ts.setParent(reference.expression, reference);
|
|
47265
47121
|
ts.setParent(reference, staticBlock);
|
|
47266
47122
|
reference.flowNode = staticBlock.returnFlowNode;
|
|
47267
47123
|
var flowType = getFlowTypeOfProperty(reference, symbol);
|
|
47268
|
-
if (noImplicitAny
|
|
47124
|
+
if (noImplicitAny && (flowType === autoType || flowType === autoArrayType)) {
|
|
47269
47125
|
error(symbol.valueDeclaration, ts.Diagnostics.Member_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(flowType));
|
|
47270
47126
|
}
|
|
47271
|
-
if (everyType(flowType,
|
|
47272
|
-
|
|
47127
|
+
if (everyType(flowType, isNullableType)) {
|
|
47128
|
+
continue;
|
|
47273
47129
|
}
|
|
47274
|
-
return
|
|
47275
|
-
};
|
|
47276
|
-
for (var _i = 0, staticBlocks_1 = staticBlocks; _i < staticBlocks_1.length; _i++) {
|
|
47277
|
-
var staticBlock = staticBlocks_1[_i];
|
|
47278
|
-
var state_3 = _loop_10(staticBlock);
|
|
47279
|
-
if (typeof state_3 === "object")
|
|
47280
|
-
return state_3.value;
|
|
47130
|
+
return convertAutoToAny(flowType);
|
|
47281
47131
|
}
|
|
47282
47132
|
}
|
|
47283
47133
|
function getFlowTypeInConstructor(symbol, constructor) {
|
|
@@ -47289,10 +47139,10 @@ var ts;
|
|
|
47289
47139
|
ts.setParent(reference, constructor);
|
|
47290
47140
|
reference.flowNode = constructor.returnFlowNode;
|
|
47291
47141
|
var flowType = getFlowTypeOfProperty(reference, symbol);
|
|
47292
|
-
if (noImplicitAny
|
|
47142
|
+
if (noImplicitAny && (flowType === autoType || flowType === autoArrayType)) {
|
|
47293
47143
|
error(symbol.valueDeclaration, ts.Diagnostics.Member_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(flowType));
|
|
47294
47144
|
}
|
|
47295
|
-
return everyType(flowType,
|
|
47145
|
+
return everyType(flowType, isNullableType) ? undefined : convertAutoToAny(flowType);
|
|
47296
47146
|
}
|
|
47297
47147
|
function getFlowTypeOfProperty(reference, prop) {
|
|
47298
47148
|
var initialType = (prop === null || prop === void 0 ? void 0 : prop.valueDeclaration)
|
|
@@ -47365,7 +47215,7 @@ var ts;
|
|
|
47365
47215
|
type = getUnionType(sourceTypes);
|
|
47366
47216
|
}
|
|
47367
47217
|
}
|
|
47368
|
-
var widened = getWidenedType(addOptionality(type,
|
|
47218
|
+
var widened = getWidenedType(addOptionality(type, false, definedInMethod && !definedInConstructor));
|
|
47369
47219
|
if (symbol.valueDeclaration && filterType(widened, function (t) { return !!(t.flags & ~98304); }) === neverType) {
|
|
47370
47220
|
reportImplicitAny(symbol.valueDeclaration, anyType);
|
|
47371
47221
|
return anyType;
|
|
@@ -47464,7 +47314,7 @@ var ts;
|
|
|
47464
47314
|
var exportedMember = members_4.get(name);
|
|
47465
47315
|
if (exportedMember && exportedMember !== s && !(s.flags & 2097152)) {
|
|
47466
47316
|
if (s.flags & 111551 && exportedMember.flags & 111551) {
|
|
47467
|
-
if (s.valueDeclaration && exportedMember.valueDeclaration && getSourceFileOfNode(s.valueDeclaration) !== getSourceFileOfNode(exportedMember.valueDeclaration)) {
|
|
47317
|
+
if (s.valueDeclaration && exportedMember.valueDeclaration && ts.getSourceFileOfNode(s.valueDeclaration) !== ts.getSourceFileOfNode(exportedMember.valueDeclaration)) {
|
|
47468
47318
|
var unescapedName = ts.unescapeLeadingUnderscores(s.escapedName);
|
|
47469
47319
|
var exportedMemberName = ((_a = ts.tryCast(exportedMember.valueDeclaration, ts.isNamedDeclaration)) === null || _a === void 0 ? void 0 : _a.name) || exportedMember.valueDeclaration;
|
|
47470
47320
|
ts.addRelatedInfo(error(s.valueDeclaration, ts.Diagnostics.Duplicate_identifier_0, unescapedName), ts.createDiagnosticForNode(exportedMemberName, ts.Diagnostics._0_was_also_declared_here, unescapedName));
|
|
@@ -47531,7 +47381,7 @@ var ts;
|
|
|
47531
47381
|
function getTypeFromBindingElement(element, includePatternInType, reportErrors) {
|
|
47532
47382
|
if (element.initializer) {
|
|
47533
47383
|
var contextualType = ts.isBindingPattern(element.name) ? getTypeFromBindingPattern(element.name, true, false) : unknownType;
|
|
47534
|
-
return addOptionality(widenTypeInferredFromInitializer(element, checkDeclarationInitializer(element, 0, contextualType))
|
|
47384
|
+
return addOptionality(widenTypeInferredFromInitializer(element, checkDeclarationInitializer(element, 0, contextualType)));
|
|
47535
47385
|
}
|
|
47536
47386
|
if (ts.isBindingPattern(element.name)) {
|
|
47537
47387
|
return getTypeFromBindingPattern(element.name, includePatternInType, reportErrors);
|
|
@@ -47654,7 +47504,7 @@ var ts;
|
|
|
47654
47504
|
return anyType;
|
|
47655
47505
|
}
|
|
47656
47506
|
if (symbol.flags & 134217728 && symbol.valueDeclaration) {
|
|
47657
|
-
var fileSymbol = getSymbolOfNode(getSourceFileOfNode(symbol.valueDeclaration));
|
|
47507
|
+
var fileSymbol = getSymbolOfNode(ts.getSourceFileOfNode(symbol.valueDeclaration));
|
|
47658
47508
|
var result = createSymbol(fileSymbol.flags, "exports");
|
|
47659
47509
|
result.declarations = fileSymbol.declarations ? fileSymbol.declarations.slice() : [];
|
|
47660
47510
|
result.parent = symbol;
|
|
@@ -47674,7 +47524,7 @@ var ts;
|
|
|
47674
47524
|
if (ts.isCatchClauseVariableDeclarationOrBindingElement(declaration)) {
|
|
47675
47525
|
var typeNode = ts.getEffectiveTypeAnnotationNode(declaration);
|
|
47676
47526
|
if (typeNode === undefined) {
|
|
47677
|
-
return useUnknownInCatchVariables
|
|
47527
|
+
return useUnknownInCatchVariables ? unknownType : anyType;
|
|
47678
47528
|
}
|
|
47679
47529
|
var type_1 = getTypeOfNode(typeNode);
|
|
47680
47530
|
return isTypeAny(type_1) || type_1 === unknownType ? type_1 : errorType;
|
|
@@ -47795,10 +47645,10 @@ var ts;
|
|
|
47795
47645
|
getter && getter.body && getReturnTypeFromBody(getter);
|
|
47796
47646
|
if (!type) {
|
|
47797
47647
|
if (setter && !isPrivateWithinAmbient(setter)) {
|
|
47798
|
-
errorOrSuggestion(noImplicitAny
|
|
47648
|
+
errorOrSuggestion(noImplicitAny, setter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation, symbolToString(symbol));
|
|
47799
47649
|
}
|
|
47800
47650
|
else if (getter && !isPrivateWithinAmbient(getter)) {
|
|
47801
|
-
errorOrSuggestion(noImplicitAny
|
|
47651
|
+
errorOrSuggestion(noImplicitAny, getter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation, symbolToString(symbol));
|
|
47802
47652
|
}
|
|
47803
47653
|
type = anyType;
|
|
47804
47654
|
}
|
|
@@ -47809,7 +47659,7 @@ var ts;
|
|
|
47809
47659
|
else if (getAnnotatedAccessorTypeNode(setter)) {
|
|
47810
47660
|
error(setter, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol));
|
|
47811
47661
|
}
|
|
47812
|
-
else if (getter && noImplicitAny
|
|
47662
|
+
else if (getter && noImplicitAny) {
|
|
47813
47663
|
error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol));
|
|
47814
47664
|
}
|
|
47815
47665
|
type = anyType;
|
|
@@ -47887,7 +47737,7 @@ var ts;
|
|
|
47887
47737
|
return baseTypeVariable ? getIntersectionType([type, baseTypeVariable]) : type;
|
|
47888
47738
|
}
|
|
47889
47739
|
else {
|
|
47890
|
-
return strictNullChecks
|
|
47740
|
+
return strictNullChecks && symbol.flags & 16777216 ? getOptionalType(type) : type;
|
|
47891
47741
|
}
|
|
47892
47742
|
}
|
|
47893
47743
|
function getTypeOfEnumMember(symbol) {
|
|
@@ -47922,7 +47772,7 @@ var ts;
|
|
|
47922
47772
|
error(symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol));
|
|
47923
47773
|
return errorType;
|
|
47924
47774
|
}
|
|
47925
|
-
if (noImplicitAny
|
|
47775
|
+
if (noImplicitAny && (declaration.kind !== 165 || declaration.initializer)) {
|
|
47926
47776
|
error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol));
|
|
47927
47777
|
}
|
|
47928
47778
|
return anyType;
|
|
@@ -49032,7 +48882,7 @@ var ts;
|
|
|
49032
48882
|
if (!ts.length(result) && indexWithLengthOverOne !== -1) {
|
|
49033
48883
|
var masterList = signatureLists[indexWithLengthOverOne !== undefined ? indexWithLengthOverOne : 0];
|
|
49034
48884
|
var results = masterList.slice();
|
|
49035
|
-
var
|
|
48885
|
+
var _loop_10 = function (signatures) {
|
|
49036
48886
|
if (signatures !== masterList) {
|
|
49037
48887
|
var signature_1 = signatures[0];
|
|
49038
48888
|
ts.Debug.assert(!!signature_1, "getUnionSignatures bails early on empty signature lists and should not have empty lists on second pass");
|
|
@@ -49044,8 +48894,8 @@ var ts;
|
|
|
49044
48894
|
};
|
|
49045
48895
|
for (var _b = 0, signatureLists_1 = signatureLists; _b < signatureLists_1.length; _b++) {
|
|
49046
48896
|
var signatures = signatureLists_1[_b];
|
|
49047
|
-
var
|
|
49048
|
-
if (
|
|
48897
|
+
var state_3 = _loop_10(signatures);
|
|
48898
|
+
if (state_3 === "break")
|
|
49049
48899
|
break;
|
|
49050
48900
|
}
|
|
49051
48901
|
result = results;
|
|
@@ -49140,7 +48990,7 @@ var ts;
|
|
|
49140
48990
|
var sourceInfos = getIndexInfosOfType(types[0]);
|
|
49141
48991
|
if (sourceInfos) {
|
|
49142
48992
|
var result = [];
|
|
49143
|
-
var
|
|
48993
|
+
var _loop_11 = function (info) {
|
|
49144
48994
|
var indexType = info.keyType;
|
|
49145
48995
|
if (ts.every(types, function (t) { return !!getIndexInfoOfType(t, indexType); })) {
|
|
49146
48996
|
result.push(createIndexInfo(indexType, getUnionType(ts.map(types, function (t) { return getIndexTypeOfType(t, indexType); })), ts.some(types, function (t) { return getIndexInfoOfType(t, indexType).isReadonly; })));
|
|
@@ -49148,7 +48998,7 @@ var ts;
|
|
|
49148
48998
|
};
|
|
49149
48999
|
for (var _i = 0, sourceInfos_1 = sourceInfos; _i < sourceInfos_1.length; _i++) {
|
|
49150
49000
|
var info = sourceInfos_1[_i];
|
|
49151
|
-
|
|
49001
|
+
_loop_11(info);
|
|
49152
49002
|
}
|
|
49153
49003
|
return result;
|
|
49154
49004
|
}
|
|
@@ -49191,7 +49041,7 @@ var ts;
|
|
|
49191
49041
|
var types = type.types;
|
|
49192
49042
|
var mixinFlags = findMixins(types);
|
|
49193
49043
|
var mixinCount = ts.countWhere(mixinFlags, function (b) { return b; });
|
|
49194
|
-
var
|
|
49044
|
+
var _loop_12 = function (i) {
|
|
49195
49045
|
var t = type.types[i];
|
|
49196
49046
|
if (!mixinFlags[i]) {
|
|
49197
49047
|
var signatures = getSignaturesOfType(t, 1);
|
|
@@ -49208,19 +49058,19 @@ var ts;
|
|
|
49208
49058
|
indexInfos = ts.reduceLeft(getIndexInfosOfType(t), function (infos, newInfo) { return appendIndexInfo(infos, newInfo, false); }, indexInfos);
|
|
49209
49059
|
};
|
|
49210
49060
|
for (var i = 0; i < types.length; i++) {
|
|
49211
|
-
|
|
49061
|
+
_loop_12(i);
|
|
49212
49062
|
}
|
|
49213
49063
|
setStructuredTypeMembers(type, emptySymbols, callSignatures || ts.emptyArray, constructSignatures || ts.emptyArray, indexInfos || ts.emptyArray);
|
|
49214
49064
|
}
|
|
49215
49065
|
function appendSignatures(signatures, newSignatures) {
|
|
49216
|
-
var
|
|
49066
|
+
var _loop_13 = function (sig) {
|
|
49217
49067
|
if (!signatures || ts.every(signatures, function (s) { return !compareSignaturesIdentical(s, sig, false, false, false, compareTypesIdentical); })) {
|
|
49218
49068
|
signatures = ts.append(signatures, sig);
|
|
49219
49069
|
}
|
|
49220
49070
|
};
|
|
49221
49071
|
for (var _i = 0, newSignatures_1 = newSignatures; _i < newSignatures_1.length; _i++) {
|
|
49222
49072
|
var sig = newSignatures_1[_i];
|
|
49223
|
-
|
|
49073
|
+
_loop_13(sig);
|
|
49224
49074
|
}
|
|
49225
49075
|
return signatures;
|
|
49226
49076
|
}
|
|
@@ -49427,7 +49277,7 @@ var ts;
|
|
|
49427
49277
|
!(templateModifiers & 8) && modifiersProp && modifiersProp.flags & 16777216);
|
|
49428
49278
|
var isReadonly = !!(templateModifiers & 1 ||
|
|
49429
49279
|
!(templateModifiers & 2) && modifiersProp && isReadonlySymbol(modifiersProp));
|
|
49430
|
-
var stripOptional = strictNullChecks
|
|
49280
|
+
var stripOptional = strictNullChecks && !isOptional && modifiersProp && modifiersProp.flags & 16777216;
|
|
49431
49281
|
var lateFlag = modifiersProp ? getIsLateCheckFlag(modifiersProp) : 0;
|
|
49432
49282
|
var prop = createSymbol(4 | (isOptional ? 16777216 : 0), propName, lateFlag | 262144 | (isReadonly ? 8 : 0) | (stripOptional ? 524288 : 0));
|
|
49433
49283
|
prop.mappedType = type;
|
|
@@ -49460,8 +49310,8 @@ var ts;
|
|
|
49460
49310
|
var templateType = getTemplateTypeFromMappedType(mappedType.target || mappedType);
|
|
49461
49311
|
var mapper = appendTypeMapping(mappedType.mapper, getTypeParameterFromMappedType(mappedType), symbol.keyType);
|
|
49462
49312
|
var propType = instantiateType(templateType, mapper);
|
|
49463
|
-
var type = strictNullChecks
|
|
49464
|
-
symbol.checkFlags & 524288 ? removeMissingOrUndefinedType(propType
|
|
49313
|
+
var type = strictNullChecks && symbol.flags & 16777216 && !maybeTypeOfKind(propType, 32768 | 16384) ? getOptionalType(propType, true) :
|
|
49314
|
+
symbol.checkFlags & 524288 ? removeMissingOrUndefinedType(propType) :
|
|
49465
49315
|
propType;
|
|
49466
49316
|
if (!popTypeResolution()) {
|
|
49467
49317
|
error(currentNode, ts.Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1, symbolToString(symbol), typeToString(mappedType));
|
|
@@ -49487,7 +49337,7 @@ var ts;
|
|
|
49487
49337
|
function getTemplateTypeFromMappedType(type) {
|
|
49488
49338
|
return type.templateType ||
|
|
49489
49339
|
(type.templateType = type.declaration.type ?
|
|
49490
|
-
instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type),
|
|
49340
|
+
instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), true, !!(getMappedTypeModifiers(type) & 4)), type.mapper) :
|
|
49491
49341
|
errorType);
|
|
49492
49342
|
}
|
|
49493
49343
|
function getConstraintDeclarationForMappedType(type) {
|
|
@@ -49653,10 +49503,6 @@ var ts;
|
|
|
49653
49503
|
type.flags & 16777216 ? getConstraintOfConditionalType(type) :
|
|
49654
49504
|
getBaseConstraintOfType(type);
|
|
49655
49505
|
}
|
|
49656
|
-
function getUnknownConstraintForType(type) {
|
|
49657
|
-
var _a, _b, _c, _d;
|
|
49658
|
-
return !strictNullChecks(((_b = (_a = type.symbol) === null || _a === void 0 ? void 0 : _a.declarations) === null || _b === void 0 ? void 0 : _b[0]) || ((_d = (_c = type.aliasSymbol) === null || _c === void 0 ? void 0 : _c.declarations) === null || _d === void 0 ? void 0 : _d[0])) ? nonNullUnknownType : unknownType;
|
|
49659
|
-
}
|
|
49660
49506
|
function getConstraintOfTypeParameter(typeParameter) {
|
|
49661
49507
|
return hasNonCircularBaseConstraint(typeParameter) ? getConstraintFromTypeParameter(typeParameter) : undefined;
|
|
49662
49508
|
}
|
|
@@ -49911,7 +49757,7 @@ var ts;
|
|
|
49911
49757
|
!(getMappedTypeModifiers(objectType) & 8) && !objectType.declaration.nameType);
|
|
49912
49758
|
}
|
|
49913
49759
|
function getApparentType(type) {
|
|
49914
|
-
var t = !(type.flags & 465829888) ? type : getBaseConstraintOfType(type) ||
|
|
49760
|
+
var t = !(type.flags & 465829888) ? type : getBaseConstraintOfType(type) || unknownType;
|
|
49915
49761
|
return ts.getObjectFlags(t) & 32 ? getApparentTypeOfMappedType(t) :
|
|
49916
49762
|
t.flags & 2097152 ? getApparentTypeOfIntersectionType(t) :
|
|
49917
49763
|
t.flags & 402653316 ? globalStringType :
|
|
@@ -49921,7 +49767,7 @@ var ts;
|
|
|
49921
49767
|
t.flags & 12288 ? getGlobalESSymbolType() :
|
|
49922
49768
|
t.flags & 67108864 ? emptyObjectType :
|
|
49923
49769
|
t.flags & 4194304 ? keyofConstraintType :
|
|
49924
|
-
t
|
|
49770
|
+
t.flags & 2 && !strictNullChecks ? emptyObjectType :
|
|
49925
49771
|
t;
|
|
49926
49772
|
}
|
|
49927
49773
|
function getReducedApparentType(type) {
|
|
@@ -49987,11 +49833,11 @@ var ts;
|
|
|
49987
49833
|
var indexInfo = !isLateBoundName(name) && getApplicableIndexInfoForName(type, name);
|
|
49988
49834
|
if (indexInfo) {
|
|
49989
49835
|
checkFlags |= 32 | (indexInfo.isReadonly ? 8 : 0);
|
|
49990
|
-
indexTypes = ts.append(indexTypes, isTupleType(type) ? getRestTypeOfTupleType(type) ||
|
|
49836
|
+
indexTypes = ts.append(indexTypes, isTupleType(type) ? getRestTypeOfTupleType(type) || undefinedType : indexInfo.type);
|
|
49991
49837
|
}
|
|
49992
49838
|
else if (isObjectLiteralType(type) && !(ts.getObjectFlags(type) & 2097152)) {
|
|
49993
49839
|
checkFlags |= 32;
|
|
49994
|
-
indexTypes = ts.append(indexTypes,
|
|
49840
|
+
indexTypes = ts.append(indexTypes, undefinedType);
|
|
49995
49841
|
}
|
|
49996
49842
|
else {
|
|
49997
49843
|
checkFlags |= 16;
|
|
@@ -50142,7 +49988,6 @@ var ts;
|
|
|
50142
49988
|
return errorInfo;
|
|
50143
49989
|
}
|
|
50144
49990
|
function getPropertyOfType(type, name, skipObjectFunctionPropertyAugment, includeTypeOnlyMembers) {
|
|
50145
|
-
var _a, _b;
|
|
50146
49991
|
type = getReducedApparentType(type);
|
|
50147
49992
|
if (type.flags & 524288) {
|
|
50148
49993
|
var resolved = resolveStructuredTypeMembers(type);
|
|
@@ -50152,10 +49997,9 @@ var ts;
|
|
|
50152
49997
|
}
|
|
50153
49998
|
if (skipObjectFunctionPropertyAugment)
|
|
50154
49999
|
return undefined;
|
|
50155
|
-
var file = ((_b = (_a = resolved.symbol) === null || _a === void 0 ? void 0 : _a.declarations) === null || _b === void 0 ? void 0 : _b[0]) && getSourceFileOfNode(resolved.symbol.declarations[0]);
|
|
50156
50000
|
var functionType = resolved === anyFunctionType ? globalFunctionType :
|
|
50157
|
-
resolved.callSignatures.length ? globalCallableFunctionType
|
|
50158
|
-
resolved.constructSignatures.length ? globalNewableFunctionType
|
|
50001
|
+
resolved.callSignatures.length ? globalCallableFunctionType :
|
|
50002
|
+
resolved.constructSignatures.length ? globalNewableFunctionType :
|
|
50159
50003
|
undefined;
|
|
50160
50004
|
if (functionType) {
|
|
50161
50005
|
var symbol_1 = getPropertyOfObjectType(functionType, name);
|
|
@@ -50562,10 +50406,10 @@ var ts;
|
|
|
50562
50406
|
getReturnTypeFromAnnotation(signature.declaration) ||
|
|
50563
50407
|
(ts.nodeIsMissing(signature.declaration.body) ? anyType : getReturnTypeFromBody(signature.declaration));
|
|
50564
50408
|
if (signature.flags & 8) {
|
|
50565
|
-
type = addOptionalTypeMarker(type
|
|
50409
|
+
type = addOptionalTypeMarker(type);
|
|
50566
50410
|
}
|
|
50567
50411
|
else if (signature.flags & 16) {
|
|
50568
|
-
type =
|
|
50412
|
+
type = getOptionalType(type);
|
|
50569
50413
|
}
|
|
50570
50414
|
if (!popTypeResolution()) {
|
|
50571
50415
|
if (signature.declaration) {
|
|
@@ -50573,7 +50417,7 @@ var ts;
|
|
|
50573
50417
|
if (typeNode) {
|
|
50574
50418
|
error(typeNode, ts.Diagnostics.Return_type_annotation_circularly_references_itself);
|
|
50575
50419
|
}
|
|
50576
|
-
else if (noImplicitAny
|
|
50420
|
+
else if (noImplicitAny) {
|
|
50577
50421
|
var declaration = signature.declaration;
|
|
50578
50422
|
var name = ts.getNameOfDeclaration(declaration);
|
|
50579
50423
|
if (name) {
|
|
@@ -50721,7 +50565,7 @@ var ts;
|
|
|
50721
50565
|
function getIndexInfosOfIndexSymbol(indexSymbol) {
|
|
50722
50566
|
if (indexSymbol.declarations) {
|
|
50723
50567
|
var indexInfos_4 = [];
|
|
50724
|
-
var
|
|
50568
|
+
var _loop_14 = function (declaration) {
|
|
50725
50569
|
if (declaration.parameters.length === 1) {
|
|
50726
50570
|
var parameter = declaration.parameters[0];
|
|
50727
50571
|
if (parameter.type) {
|
|
@@ -50735,7 +50579,7 @@ var ts;
|
|
|
50735
50579
|
};
|
|
50736
50580
|
for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
|
|
50737
50581
|
var declaration = _a[_i];
|
|
50738
|
-
|
|
50582
|
+
_loop_14(declaration);
|
|
50739
50583
|
}
|
|
50740
50584
|
return indexInfos_4;
|
|
50741
50585
|
}
|
|
@@ -50752,7 +50596,7 @@ var ts;
|
|
|
50752
50596
|
var _a;
|
|
50753
50597
|
var inferences;
|
|
50754
50598
|
if ((_a = typeParameter.symbol) === null || _a === void 0 ? void 0 : _a.declarations) {
|
|
50755
|
-
var
|
|
50599
|
+
var _loop_15 = function (declaration) {
|
|
50756
50600
|
if (declaration.parent.kind === 191) {
|
|
50757
50601
|
var _c = ts.walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent), _d = _c[0], childTypeParameter = _d === void 0 ? declaration.parent : _d, grandParent = _c[1];
|
|
50758
50602
|
if (grandParent.kind === 179 && !omitTypeReferences) {
|
|
@@ -50797,7 +50641,7 @@ var ts;
|
|
|
50797
50641
|
};
|
|
50798
50642
|
for (var _i = 0, _b = typeParameter.symbol.declarations; _i < _b.length; _i++) {
|
|
50799
50643
|
var declaration = _b[_i];
|
|
50800
|
-
|
|
50644
|
+
_loop_15(declaration);
|
|
50801
50645
|
}
|
|
50802
50646
|
}
|
|
50803
50647
|
return inferences && getIntersectionType(inferences);
|
|
@@ -50930,7 +50774,7 @@ var ts;
|
|
|
50930
50774
|
var numTypeArguments = ts.length(node.typeArguments);
|
|
50931
50775
|
var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters);
|
|
50932
50776
|
var isJs = ts.isInJSFile(node);
|
|
50933
|
-
var isJsImplicitAny = !noImplicitAny
|
|
50777
|
+
var isJsImplicitAny = !noImplicitAny && isJs;
|
|
50934
50778
|
if (!isJsImplicitAny && (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length)) {
|
|
50935
50779
|
var missingAugmentsTag = isJs && ts.isExpressionWithTypeArguments(node) && !ts.isJSDocAugmentsTag(node.parent);
|
|
50936
50780
|
var diag = minTypeArgumentCount === typeParameters.length ?
|
|
@@ -51183,9 +51027,9 @@ var ts;
|
|
|
51183
51027
|
checkNoTypeArguments(node);
|
|
51184
51028
|
return globalFunctionType;
|
|
51185
51029
|
case "array":
|
|
51186
|
-
return (!typeArgs || !typeArgs.length) && !noImplicitAny
|
|
51030
|
+
return (!typeArgs || !typeArgs.length) && !noImplicitAny ? anyArrayType : undefined;
|
|
51187
51031
|
case "promise":
|
|
51188
|
-
return (!typeArgs || !typeArgs.length) && !noImplicitAny
|
|
51032
|
+
return (!typeArgs || !typeArgs.length) && !noImplicitAny ? createPromiseType(anyType) : undefined;
|
|
51189
51033
|
case "Object":
|
|
51190
51034
|
if (typeArgs && typeArgs.length === 2) {
|
|
51191
51035
|
if (ts.isJSDocIndexSignature(node)) {
|
|
@@ -51197,13 +51041,13 @@ var ts;
|
|
|
51197
51041
|
return anyType;
|
|
51198
51042
|
}
|
|
51199
51043
|
checkNoTypeArguments(node);
|
|
51200
|
-
return !noImplicitAny
|
|
51044
|
+
return !noImplicitAny ? anyType : undefined;
|
|
51201
51045
|
}
|
|
51202
51046
|
}
|
|
51203
51047
|
}
|
|
51204
51048
|
function getTypeFromJSDocNullableTypeNode(node) {
|
|
51205
51049
|
var type = getTypeFromTypeNode(node.type);
|
|
51206
|
-
return strictNullChecks
|
|
51050
|
+
return strictNullChecks ? getNullableType(type, 65536) : type;
|
|
51207
51051
|
}
|
|
51208
51052
|
function getTypeFromTypeReference(node) {
|
|
51209
51053
|
var links = getNodeLinks(node);
|
|
@@ -51609,7 +51453,7 @@ var ts;
|
|
|
51609
51453
|
var lastRequiredIndex = -1;
|
|
51610
51454
|
var firstRestIndex = -1;
|
|
51611
51455
|
var lastOptionalOrRestIndex = -1;
|
|
51612
|
-
var
|
|
51456
|
+
var _loop_16 = function (i) {
|
|
51613
51457
|
var type = elementTypes[i];
|
|
51614
51458
|
var flags = target.elementFlags[i];
|
|
51615
51459
|
if (flags & 8) {
|
|
@@ -51635,9 +51479,9 @@ var ts;
|
|
|
51635
51479
|
}
|
|
51636
51480
|
};
|
|
51637
51481
|
for (var i = 0; i < elementTypes.length; i++) {
|
|
51638
|
-
var
|
|
51639
|
-
if (typeof
|
|
51640
|
-
return
|
|
51482
|
+
var state_4 = _loop_16(i);
|
|
51483
|
+
if (typeof state_4 === "object")
|
|
51484
|
+
return state_4.value;
|
|
51641
51485
|
}
|
|
51642
51486
|
for (var i = 0; i < lastRequiredIndex; i++) {
|
|
51643
51487
|
if (expandedFlags[i] & 2)
|
|
@@ -51691,7 +51535,7 @@ var ts;
|
|
|
51691
51535
|
return type.elementFlags.length - ts.findLastIndex(type.elementFlags, function (f) { return !(f & flags); }) - 1;
|
|
51692
51536
|
}
|
|
51693
51537
|
function getTypeFromOptionalTypeNode(node) {
|
|
51694
|
-
return addOptionality(getTypeFromTypeNode(node.type),
|
|
51538
|
+
return addOptionality(getTypeFromTypeNode(node.type), true);
|
|
51695
51539
|
}
|
|
51696
51540
|
function getTypeId(type) {
|
|
51697
51541
|
return type.id;
|
|
@@ -51707,62 +51551,37 @@ var ts;
|
|
|
51707
51551
|
}
|
|
51708
51552
|
return false;
|
|
51709
51553
|
}
|
|
51710
|
-
function
|
|
51711
|
-
var
|
|
51712
|
-
|
|
51713
|
-
|
|
51714
|
-
|
|
51715
|
-
|
|
51716
|
-
|
|
51717
|
-
|
|
51718
|
-
|
|
51719
|
-
|
|
51720
|
-
|
|
51721
|
-
if (
|
|
51722
|
-
|
|
51723
|
-
|
|
51724
|
-
}
|
|
51725
|
-
if (includes & 32768) {
|
|
51726
|
-
if (includes & 536870912) {
|
|
51727
|
-
addTypeToListSorted(typeSet, includes & 536870912 ? undefinedVariant || undefinedType : undefinedWideningType);
|
|
51554
|
+
function addTypeToUnion(typeSet, includes, type) {
|
|
51555
|
+
var flags = type.flags;
|
|
51556
|
+
if (flags & 1048576) {
|
|
51557
|
+
return addTypesToUnion(typeSet, includes | (isNamedUnionType(type) ? 1048576 : 0), type.types);
|
|
51558
|
+
}
|
|
51559
|
+
if (!(flags & 131072)) {
|
|
51560
|
+
includes |= flags & 205258751;
|
|
51561
|
+
if (flags & 465829888)
|
|
51562
|
+
includes |= 33554432;
|
|
51563
|
+
if (type === wildcardType)
|
|
51564
|
+
includes |= 8388608;
|
|
51565
|
+
if (!strictNullChecks && flags & 98304) {
|
|
51566
|
+
if (!(ts.getObjectFlags(type) & 65536))
|
|
51567
|
+
includes |= 4194304;
|
|
51728
51568
|
}
|
|
51729
|
-
|
|
51730
|
-
|
|
51731
|
-
|
|
51732
|
-
|
|
51733
|
-
|
|
51734
|
-
return addTypesToUnionWorker(typeSet, includes | (isNamedUnionType(type) ? 1048576 : 0), type.types);
|
|
51735
|
-
}
|
|
51736
|
-
if (!(flags & 131072)) {
|
|
51737
|
-
includes |= flags & 477888511;
|
|
51738
|
-
if (flags & 465829888)
|
|
51739
|
-
includes |= 33554432;
|
|
51740
|
-
if (type === wildcardType)
|
|
51741
|
-
includes |= 8388608;
|
|
51742
|
-
if (flags & 98304) {
|
|
51743
|
-
if (!(ts.getObjectFlags(type) & 65536)) {
|
|
51744
|
-
includes |= 536870912;
|
|
51745
|
-
if (flags & 32768) {
|
|
51746
|
-
if (!undefinedVariant)
|
|
51747
|
-
undefinedVariant = type;
|
|
51748
|
-
else
|
|
51749
|
-
undefinedVariant = undefinedType;
|
|
51750
|
-
}
|
|
51751
|
-
}
|
|
51752
|
-
}
|
|
51753
|
-
else {
|
|
51754
|
-
addTypeToListSorted(typeSet, type);
|
|
51569
|
+
else {
|
|
51570
|
+
var len = typeSet.length;
|
|
51571
|
+
var index = len && type.id > typeSet[len - 1].id ? ~len : ts.binarySearch(typeSet, type, getTypeId, ts.compareValues);
|
|
51572
|
+
if (index < 0) {
|
|
51573
|
+
typeSet.splice(~index, 0, type);
|
|
51755
51574
|
}
|
|
51756
51575
|
}
|
|
51757
|
-
return includes;
|
|
51758
51576
|
}
|
|
51759
|
-
|
|
51760
|
-
|
|
51761
|
-
|
|
51762
|
-
|
|
51763
|
-
|
|
51764
|
-
|
|
51577
|
+
return includes;
|
|
51578
|
+
}
|
|
51579
|
+
function addTypesToUnion(typeSet, includes, types) {
|
|
51580
|
+
for (var _i = 0, types_9 = types; _i < types_9.length; _i++) {
|
|
51581
|
+
var type = types_9[_i];
|
|
51582
|
+
includes = addTypeToUnion(typeSet, includes, type);
|
|
51765
51583
|
}
|
|
51584
|
+
return includes;
|
|
51766
51585
|
}
|
|
51767
51586
|
function removeSubtypes(types, hasObjectTypes) {
|
|
51768
51587
|
if (types.length < 2) {
|
|
@@ -51837,7 +51656,7 @@ var ts;
|
|
|
51837
51656
|
var templates = ts.filter(types, isPatternLiteralType);
|
|
51838
51657
|
if (templates.length) {
|
|
51839
51658
|
var i = types.length;
|
|
51840
|
-
var
|
|
51659
|
+
var _loop_17 = function () {
|
|
51841
51660
|
i--;
|
|
51842
51661
|
var t = types[i];
|
|
51843
51662
|
if (t.flags & 128 && ts.some(templates, function (template) { return isTypeMatchedByTemplateLiteralType(t, template); })) {
|
|
@@ -51845,7 +51664,7 @@ var ts;
|
|
|
51845
51664
|
}
|
|
51846
51665
|
};
|
|
51847
51666
|
while (i > 0) {
|
|
51848
|
-
|
|
51667
|
+
_loop_17();
|
|
51849
51668
|
}
|
|
51850
51669
|
}
|
|
51851
51670
|
}
|
|
@@ -51887,7 +51706,7 @@ var ts;
|
|
|
51887
51706
|
includes & 8388608 ? wildcardType : anyType :
|
|
51888
51707
|
includes & 65536 || containsType(typeSet, unknownType) ? unknownType : nonNullUnknownType;
|
|
51889
51708
|
}
|
|
51890
|
-
if (includes & 32768) {
|
|
51709
|
+
if (exactOptionalPropertyTypes && includes & 32768) {
|
|
51891
51710
|
var missingIndex = ts.binarySearch(typeSet, missingType, getTypeId, ts.compareValues);
|
|
51892
51711
|
if (missingIndex >= 0 && containsType(typeSet, undefinedType)) {
|
|
51893
51712
|
ts.orderedRemoveItemAt(typeSet, missingIndex);
|
|
@@ -51906,8 +51725,8 @@ var ts;
|
|
|
51906
51725
|
}
|
|
51907
51726
|
}
|
|
51908
51727
|
if (typeSet.length === 0) {
|
|
51909
|
-
return includes & 65536 ? includes &
|
|
51910
|
-
includes & 32768 ? includes &
|
|
51728
|
+
return includes & 65536 ? includes & 4194304 ? nullType : nullWideningType :
|
|
51729
|
+
includes & 32768 ? includes & 4194304 ? undefinedType : undefinedWideningType :
|
|
51911
51730
|
neverType;
|
|
51912
51731
|
}
|
|
51913
51732
|
}
|
|
@@ -51915,14 +51734,14 @@ var ts;
|
|
|
51915
51734
|
var namedUnions = [];
|
|
51916
51735
|
addNamedUnions(namedUnions, types);
|
|
51917
51736
|
var reducedTypes = [];
|
|
51918
|
-
var
|
|
51737
|
+
var _loop_18 = function (t) {
|
|
51919
51738
|
if (!ts.some(namedUnions, function (union) { return containsType(union.types, t); })) {
|
|
51920
51739
|
reducedTypes.push(t);
|
|
51921
51740
|
}
|
|
51922
51741
|
};
|
|
51923
51742
|
for (var _i = 0, typeSet_1 = typeSet; _i < typeSet_1.length; _i++) {
|
|
51924
51743
|
var t = typeSet_1[_i];
|
|
51925
|
-
|
|
51744
|
+
_loop_18(t);
|
|
51926
51745
|
}
|
|
51927
51746
|
if (!aliasSymbol && namedUnions.length === 1 && reducedTypes.length === 0) {
|
|
51928
51747
|
return namedUnions[0];
|
|
@@ -52005,16 +51824,10 @@ var ts;
|
|
|
52005
51824
|
var links = getNodeLinks(node);
|
|
52006
51825
|
if (!links.resolvedType) {
|
|
52007
51826
|
var aliasSymbol = getAliasSymbolForTypeNode(node);
|
|
52008
|
-
links.resolvedType = getUnionType(ts.map(node.types,
|
|
51827
|
+
links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNode), 1, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol));
|
|
52009
51828
|
}
|
|
52010
51829
|
return links.resolvedType;
|
|
52011
51830
|
}
|
|
52012
|
-
function getTypeFromUnionMemberTypeNode(node) {
|
|
52013
|
-
if (strictNullChecks(node) || !((ts.isLiteralTypeNode(node) && isNullOrUndefined(node.literal)) || isNullOrUndefined(node) || node.kind === 154)) {
|
|
52014
|
-
return getTypeFromTypeNode(node);
|
|
52015
|
-
}
|
|
52016
|
-
return neverType;
|
|
52017
|
-
}
|
|
52018
51831
|
function addTypeToIntersection(typeSet, includes, type) {
|
|
52019
51832
|
var flags = type.flags;
|
|
52020
51833
|
if (flags & 2097152) {
|
|
@@ -52031,8 +51844,8 @@ var ts;
|
|
|
52031
51844
|
if (type === wildcardType)
|
|
52032
51845
|
includes |= 8388608;
|
|
52033
51846
|
}
|
|
52034
|
-
else {
|
|
52035
|
-
if (type === missingType) {
|
|
51847
|
+
else if (strictNullChecks || !(flags & 98304)) {
|
|
51848
|
+
if (exactOptionalPropertyTypes && type === missingType) {
|
|
52036
51849
|
includes |= 262144;
|
|
52037
51850
|
type = undefinedType;
|
|
52038
51851
|
}
|
|
@@ -52043,7 +51856,7 @@ var ts;
|
|
|
52043
51856
|
typeSet.set(type.id.toString(), type);
|
|
52044
51857
|
}
|
|
52045
51858
|
}
|
|
52046
|
-
includes |= flags &
|
|
51859
|
+
includes |= flags & 205258751;
|
|
52047
51860
|
}
|
|
52048
51861
|
return includes;
|
|
52049
51862
|
}
|
|
@@ -52166,14 +51979,13 @@ var ts;
|
|
|
52166
51979
|
if (includes & 131072) {
|
|
52167
51980
|
return ts.contains(typeSet, silentNeverType) ? silentNeverType : neverType;
|
|
52168
51981
|
}
|
|
52169
|
-
if (includes & 98304 && includes & (524288 | 67108864 | 16777216) ||
|
|
51982
|
+
if (strictNullChecks && includes & 98304 && includes & (524288 | 67108864 | 16777216) ||
|
|
52170
51983
|
includes & 67108864 && includes & (469892092 & ~67108864) ||
|
|
52171
51984
|
includes & 402653316 && includes & (469892092 & ~402653316) ||
|
|
52172
51985
|
includes & 296 && includes & (469892092 & ~296) ||
|
|
52173
51986
|
includes & 2112 && includes & (469892092 & ~2112) ||
|
|
52174
51987
|
includes & 12288 && includes & (469892092 & ~12288) ||
|
|
52175
|
-
includes & 49152 && includes & (469892092 & ~49152)
|
|
52176
|
-
includes & 4194304 && includes & (98304 | 2112)) {
|
|
51988
|
+
includes & 49152 && includes & (469892092 & ~49152)) {
|
|
52177
51989
|
return neverType;
|
|
52178
51990
|
}
|
|
52179
51991
|
if (includes & 134217728 && includes & 128 && extractRedundantTemplateLiterals(typeSet)) {
|
|
@@ -52182,6 +51994,9 @@ var ts;
|
|
|
52182
51994
|
if (includes & 1) {
|
|
52183
51995
|
return includes & 8388608 ? wildcardType : anyType;
|
|
52184
51996
|
}
|
|
51997
|
+
if (!strictNullChecks && includes & 98304) {
|
|
51998
|
+
return includes & 32768 ? undefinedType : nullType;
|
|
51999
|
+
}
|
|
52185
52000
|
if (includes & 4 && includes & (128 | 134217728 | 268435456) ||
|
|
52186
52001
|
includes & 8 && includes & 256 ||
|
|
52187
52002
|
includes & 64 && includes & 2048 ||
|
|
@@ -52208,7 +52023,7 @@ var ts;
|
|
|
52208
52023
|
result = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
|
|
52209
52024
|
}
|
|
52210
52025
|
else if (eachIsUnionContaining(typeSet, 32768)) {
|
|
52211
|
-
var undefinedOrMissingType = ts.some(typeSet, function (t) { return containsType(t.types, missingType); }) ? missingType : undefinedType;
|
|
52026
|
+
var undefinedOrMissingType = exactOptionalPropertyTypes && ts.some(typeSet, function (t) { return containsType(t.types, missingType); }) ? missingType : undefinedType;
|
|
52212
52027
|
removeFromEach(typeSet, 32768);
|
|
52213
52028
|
result = getUnionType([getIntersectionType(typeSet), undefinedOrMissingType], 1, aliasSymbol, aliasTypeArguments);
|
|
52214
52029
|
}
|
|
@@ -52564,15 +52379,15 @@ var ts;
|
|
|
52564
52379
|
type.aliasTypeArguments = aliasTypeArguments;
|
|
52565
52380
|
return type;
|
|
52566
52381
|
}
|
|
52567
|
-
function isJSLiteralType(type
|
|
52568
|
-
if (noImplicitAny
|
|
52382
|
+
function isJSLiteralType(type) {
|
|
52383
|
+
if (noImplicitAny) {
|
|
52569
52384
|
return false;
|
|
52570
52385
|
}
|
|
52571
52386
|
if (ts.getObjectFlags(type) & 4096) {
|
|
52572
52387
|
return true;
|
|
52573
52388
|
}
|
|
52574
52389
|
if (type.flags & 1048576) {
|
|
52575
|
-
return ts.every(type.types,
|
|
52390
|
+
return ts.every(type.types, isJSLiteralType);
|
|
52576
52391
|
}
|
|
52577
52392
|
if (type.flags & 2097152) {
|
|
52578
52393
|
return ts.some(type.types, isJSLiteralType);
|
|
@@ -52679,12 +52494,12 @@ var ts;
|
|
|
52679
52494
|
if (indexType.flags & 131072) {
|
|
52680
52495
|
return neverType;
|
|
52681
52496
|
}
|
|
52682
|
-
if (isJSLiteralType(objectType
|
|
52497
|
+
if (isJSLiteralType(objectType)) {
|
|
52683
52498
|
return anyType;
|
|
52684
52499
|
}
|
|
52685
52500
|
if (accessExpression && !isConstEnumObjectType(objectType)) {
|
|
52686
52501
|
if (isObjectLiteralType(objectType)) {
|
|
52687
|
-
if (noImplicitAny
|
|
52502
|
+
if (noImplicitAny && indexType.flags & (128 | 256)) {
|
|
52688
52503
|
diagnostics.add(ts.createDiagnosticForNode(accessExpression, ts.Diagnostics.Property_0_does_not_exist_on_type_1, indexType.value, typeToString(objectType)));
|
|
52689
52504
|
return undefinedType;
|
|
52690
52505
|
}
|
|
@@ -52698,7 +52513,7 @@ var ts;
|
|
|
52698
52513
|
if (objectType.symbol === globalThisSymbol && propName !== undefined && globalThisSymbol.exports.has(propName) && (globalThisSymbol.exports.get(propName).flags & 418)) {
|
|
52699
52514
|
error(accessExpression, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.unescapeLeadingUnderscores(propName), typeToString(objectType));
|
|
52700
52515
|
}
|
|
52701
|
-
else if (noImplicitAny
|
|
52516
|
+
else if (noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors && !(accessFlags & 128)) {
|
|
52702
52517
|
if (propName !== undefined && typeHasStaticProperty(propName, objectType)) {
|
|
52703
52518
|
var typeName = typeToString(objectType);
|
|
52704
52519
|
error(accessExpression, ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead, propName, typeName, typeName + "[" + ts.getTextOfNode(accessExpression.argumentExpression) + "]");
|
|
@@ -52745,7 +52560,7 @@ var ts;
|
|
|
52745
52560
|
return undefined;
|
|
52746
52561
|
}
|
|
52747
52562
|
}
|
|
52748
|
-
if (isJSLiteralType(objectType
|
|
52563
|
+
if (isJSLiteralType(objectType)) {
|
|
52749
52564
|
return anyType;
|
|
52750
52565
|
}
|
|
52751
52566
|
if (accessNode) {
|
|
@@ -52815,7 +52630,7 @@ var ts;
|
|
|
52815
52630
|
type;
|
|
52816
52631
|
}
|
|
52817
52632
|
function distributeIndexOverObjectType(objectType, indexType, writing) {
|
|
52818
|
-
if (objectType.flags &
|
|
52633
|
+
if (objectType.flags & 1048576 || objectType.flags & 2097152 && !shouldDeferIndexType(objectType)) {
|
|
52819
52634
|
var types = ts.map(objectType.types, function (t) { return getSimplifiedType(getIndexedAccessType(t, indexType), writing); });
|
|
52820
52635
|
return objectType.flags & 2097152 || writing ? getIntersectionType(types) : getUnionType(types);
|
|
52821
52636
|
}
|
|
@@ -52913,7 +52728,7 @@ var ts;
|
|
|
52913
52728
|
if (isStringIndexSignatureOnlyType(objectType) && !(indexType.flags & 98304) && isTypeAssignableToKind(indexType, 4 | 8)) {
|
|
52914
52729
|
indexType = stringType;
|
|
52915
52730
|
}
|
|
52916
|
-
if (
|
|
52731
|
+
if (compilerOptions.noUncheckedIndexedAccess && accessFlags & 32)
|
|
52917
52732
|
accessFlags |= 1;
|
|
52918
52733
|
if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 195 ?
|
|
52919
52734
|
isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target.fixedLength) :
|
|
@@ -52930,9 +52745,6 @@ var ts;
|
|
|
52930
52745
|
return type;
|
|
52931
52746
|
}
|
|
52932
52747
|
var apparentObjectType = getReducedApparentType(objectType);
|
|
52933
|
-
if (!strictNullChecks(accessNode) && apparentObjectType.flags & 2) {
|
|
52934
|
-
apparentObjectType = emptyObjectType;
|
|
52935
|
-
}
|
|
52936
52748
|
if (indexType.flags & 1048576 && !(indexType.flags & 16)) {
|
|
52937
52749
|
var propTypes = [];
|
|
52938
52750
|
var wasMissingProp = false;
|
|
@@ -53011,7 +52823,7 @@ var ts;
|
|
|
53011
52823
|
var result;
|
|
53012
52824
|
var extraTypes;
|
|
53013
52825
|
var tailCount = 0;
|
|
53014
|
-
var
|
|
52826
|
+
var _loop_19 = function () {
|
|
53015
52827
|
if (tailCount === 1000) {
|
|
53016
52828
|
error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite);
|
|
53017
52829
|
result = errorType;
|
|
@@ -53085,10 +52897,10 @@ var ts;
|
|
|
53085
52897
|
return "break";
|
|
53086
52898
|
};
|
|
53087
52899
|
while (true) {
|
|
53088
|
-
var
|
|
53089
|
-
if (typeof
|
|
53090
|
-
return
|
|
53091
|
-
if (
|
|
52900
|
+
var state_5 = _loop_19();
|
|
52901
|
+
if (typeof state_5 === "object")
|
|
52902
|
+
return state_5.value;
|
|
52903
|
+
if (state_5 === "break")
|
|
53092
52904
|
break;
|
|
53093
52905
|
}
|
|
53094
52906
|
return extraTypes ? getUnionType(ts.append(extraTypes, result)) : result;
|
|
@@ -53303,17 +53115,16 @@ var ts;
|
|
|
53303
53115
|
}
|
|
53304
53116
|
return getAnonymousPartialType(firstType);
|
|
53305
53117
|
function getAnonymousPartialType(type) {
|
|
53306
|
-
var _a;
|
|
53307
53118
|
var members = ts.createSymbolTable();
|
|
53308
|
-
for (var _i = 0,
|
|
53309
|
-
var prop =
|
|
53119
|
+
for (var _i = 0, _a = getPropertiesOfType(type); _i < _a.length; _i++) {
|
|
53120
|
+
var prop = _a[_i];
|
|
53310
53121
|
if (ts.getDeclarationModifierFlagsFromSymbol(prop) & (8 | 16)) {
|
|
53311
53122
|
}
|
|
53312
53123
|
else if (isSpreadableProperty(prop)) {
|
|
53313
53124
|
var isSetonlyAccessor = prop.flags & 65536 && !(prop.flags & 32768);
|
|
53314
53125
|
var flags = 4 | 16777216;
|
|
53315
53126
|
var result = createSymbol(flags, prop.escapedName, getIsLateCheckFlag(prop) | (readonly ? 8 : 0));
|
|
53316
|
-
result.type = isSetonlyAccessor ? undefinedType : addOptionality(getTypeOfSymbol(prop),
|
|
53127
|
+
result.type = isSetonlyAccessor ? undefinedType : addOptionality(getTypeOfSymbol(prop), true);
|
|
53317
53128
|
result.declarations = prop.declarations;
|
|
53318
53129
|
result.nameType = getSymbolLinks(prop).nameType;
|
|
53319
53130
|
result.syntheticOrigin = prop;
|
|
@@ -53390,7 +53201,7 @@ var ts;
|
|
|
53390
53201
|
var declarations = ts.concatenate(leftProp.declarations, rightProp.declarations);
|
|
53391
53202
|
var flags = 4 | (leftProp.flags & 16777216);
|
|
53392
53203
|
var result = createSymbol(flags, leftProp.escapedName);
|
|
53393
|
-
result.type = getUnionType([getTypeOfSymbol(leftProp), removeMissingOrUndefinedType(rightType
|
|
53204
|
+
result.type = getUnionType([getTypeOfSymbol(leftProp), removeMissingOrUndefinedType(rightType)], 2);
|
|
53394
53205
|
result.leftSpread = leftProp;
|
|
53395
53206
|
result.rightSpread = rightProp;
|
|
53396
53207
|
result.declarations = declarations;
|
|
@@ -53480,7 +53291,7 @@ var ts;
|
|
|
53480
53291
|
}
|
|
53481
53292
|
function getTypeFromLiteralTypeNode(node) {
|
|
53482
53293
|
if (node.literal.kind === 104) {
|
|
53483
|
-
return
|
|
53294
|
+
return nullType;
|
|
53484
53295
|
}
|
|
53485
53296
|
var links = getNodeLinks(node);
|
|
53486
53297
|
if (!links.resolvedType) {
|
|
@@ -53557,7 +53368,7 @@ var ts;
|
|
|
53557
53368
|
var links = getNodeLinks(node);
|
|
53558
53369
|
return links.resolvedType || (links.resolvedType =
|
|
53559
53370
|
node.dotDotDotToken ? getTypeFromRestTypeNode(node) :
|
|
53560
|
-
addOptionality(getTypeFromTypeNode(node.type),
|
|
53371
|
+
addOptionality(getTypeFromTypeNode(node.type), true, !!node.questionToken));
|
|
53561
53372
|
}
|
|
53562
53373
|
function getTypeFromTypeNode(node) {
|
|
53563
53374
|
return getConditionalFlowTypeOfType(getTypeFromTypeNodeWorker(node), node);
|
|
@@ -53583,13 +53394,13 @@ var ts;
|
|
|
53583
53394
|
case 114:
|
|
53584
53395
|
return voidType;
|
|
53585
53396
|
case 154:
|
|
53586
|
-
return
|
|
53397
|
+
return undefinedType;
|
|
53587
53398
|
case 104:
|
|
53588
|
-
return
|
|
53399
|
+
return nullType;
|
|
53589
53400
|
case 143:
|
|
53590
53401
|
return neverType;
|
|
53591
53402
|
case 148:
|
|
53592
|
-
return node.flags & 262144 && !noImplicitAny
|
|
53403
|
+
return node.flags & 262144 && !noImplicitAny ? anyType : nonPrimitiveType;
|
|
53593
53404
|
case 138:
|
|
53594
53405
|
return intrinsicMarkerType;
|
|
53595
53406
|
case 193:
|
|
@@ -53617,7 +53428,7 @@ var ts;
|
|
|
53617
53428
|
case 316:
|
|
53618
53429
|
return getTypeFromJSDocNullableTypeNode(node);
|
|
53619
53430
|
case 318:
|
|
53620
|
-
return addOptionality(getTypeFromTypeNode(node.type)
|
|
53431
|
+
return addOptionality(getTypeFromTypeNode(node.type));
|
|
53621
53432
|
case 198:
|
|
53622
53433
|
return getTypeFromNamedTupleTypeNode(node);
|
|
53623
53434
|
case 192:
|
|
@@ -53954,8 +53765,8 @@ var ts;
|
|
|
53954
53765
|
var templateMapper = appendTypeMapping(mapper, getTypeParameterFromMappedType(type), key);
|
|
53955
53766
|
var propType = instantiateType(getTemplateTypeFromMappedType(type.target || type), templateMapper);
|
|
53956
53767
|
var modifiers = getMappedTypeModifiers(type);
|
|
53957
|
-
return modifiers & 4 && !maybeTypeOfKind(propType, 32768 | 16384) ? getOptionalType(propType,
|
|
53958
|
-
modifiers & 8 && isOptional ? getTypeWithFacts(propType, 524288
|
|
53768
|
+
return strictNullChecks && modifiers & 4 && !maybeTypeOfKind(propType, 32768 | 16384) ? getOptionalType(propType, true) :
|
|
53769
|
+
strictNullChecks && modifiers & 8 && isOptional ? getTypeWithFacts(propType, 524288) :
|
|
53959
53770
|
propType;
|
|
53960
53771
|
}
|
|
53961
53772
|
function instantiateAnonymousType(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
@@ -54352,7 +54163,7 @@ var ts;
|
|
|
54352
54163
|
if (!elaborated) {
|
|
54353
54164
|
var resultObj = errorOutputContainer || {};
|
|
54354
54165
|
var specificSource = next ? checkExpressionForMutableLocationWithContextualType(next, sourcePropType) : sourcePropType;
|
|
54355
|
-
if (exactOptionalPropertyTypes
|
|
54166
|
+
if (exactOptionalPropertyTypes && isExactOptionalPropertyMismatch(specificSource, targetPropType)) {
|
|
54356
54167
|
var diag = ts.createDiagnosticForNode(prop, ts.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target, typeToString(specificSource), typeToString(targetPropType));
|
|
54357
54168
|
diagnostics.add(diag);
|
|
54358
54169
|
resultObj.errors = [diag];
|
|
@@ -54374,14 +54185,14 @@ var ts;
|
|
|
54374
54185
|
var issuedElaboration = false;
|
|
54375
54186
|
if (!targetProp) {
|
|
54376
54187
|
var indexInfo = getApplicableIndexInfo(target, nameType);
|
|
54377
|
-
if (indexInfo && indexInfo.declaration && !getSourceFileOfNode(indexInfo.declaration).hasNoDefaultLib) {
|
|
54188
|
+
if (indexInfo && indexInfo.declaration && !ts.getSourceFileOfNode(indexInfo.declaration).hasNoDefaultLib) {
|
|
54378
54189
|
issuedElaboration = true;
|
|
54379
54190
|
ts.addRelatedInfo(reportedDiag, ts.createDiagnosticForNode(indexInfo.declaration, ts.Diagnostics.The_expected_type_comes_from_this_index_signature));
|
|
54380
54191
|
}
|
|
54381
54192
|
}
|
|
54382
54193
|
if (!issuedElaboration && (targetProp && ts.length(targetProp.declarations) || target.symbol && ts.length(target.symbol.declarations))) {
|
|
54383
54194
|
var targetNode = targetProp && ts.length(targetProp.declarations) ? targetProp.declarations[0] : target.symbol.declarations[0];
|
|
54384
|
-
if (!getSourceFileOfNode(targetNode).hasNoDefaultLib) {
|
|
54195
|
+
if (!ts.getSourceFileOfNode(targetNode).hasNoDefaultLib) {
|
|
54385
54196
|
ts.addRelatedInfo(reportedDiag, ts.createDiagnosticForNode(targetNode, ts.Diagnostics.The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1, propertyName && !(nameType.flags & 8192) ? ts.unescapeLeadingUnderscores(propertyName) : typeToString(nameType), typeToString(target)));
|
|
54386
54197
|
}
|
|
54387
54198
|
}
|
|
@@ -54664,10 +54475,7 @@ var ts;
|
|
|
54664
54475
|
void instantiateType(sourceRestType || targetRestType, reportUnreliableMarkers);
|
|
54665
54476
|
}
|
|
54666
54477
|
var kind = target.declaration ? target.declaration.kind : 0;
|
|
54667
|
-
var
|
|
54668
|
-
var targetFile = target.declaration && getSourceFileOfNode(target.declaration);
|
|
54669
|
-
var strictSignatureComparison = strictFunctionTypes(sourceFile) || strictFunctionTypes(targetFile);
|
|
54670
|
-
var strictVariance = !(checkMode & 3) && strictSignatureComparison && kind !== 170 &&
|
|
54478
|
+
var strictVariance = !(checkMode & 3) && strictFunctionTypes && kind !== 170 &&
|
|
54671
54479
|
kind !== 169 && kind !== 172;
|
|
54672
54480
|
var result = -1;
|
|
54673
54481
|
var sourceThisType = getThisTypeOfSignature(source);
|
|
@@ -54691,10 +54499,10 @@ var ts;
|
|
|
54691
54499
|
var sourceType = i === restIndex ? getRestTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i);
|
|
54692
54500
|
var targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
|
|
54693
54501
|
if (sourceType && targetType) {
|
|
54694
|
-
var sourceSig = checkMode & 3 ? undefined : getSingleCallSignature(getNonNullableType(sourceType
|
|
54695
|
-
var targetSig = checkMode & 3 ? undefined : getSingleCallSignature(getNonNullableType(targetType
|
|
54502
|
+
var sourceSig = checkMode & 3 ? undefined : getSingleCallSignature(getNonNullableType(sourceType));
|
|
54503
|
+
var targetSig = checkMode & 3 ? undefined : getSingleCallSignature(getNonNullableType(targetType));
|
|
54696
54504
|
var callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) &&
|
|
54697
|
-
(getTypeFacts(sourceType
|
|
54505
|
+
(getTypeFacts(sourceType) & 50331648) === (getTypeFacts(targetType) & 50331648);
|
|
54698
54506
|
var related = callbacks ?
|
|
54699
54507
|
compareSignaturesRelated(targetSig, sourceSig, (checkMode & 8) | (strictVariance ? 2 : 1), reportErrors, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) :
|
|
54700
54508
|
!(checkMode & 3) && !strictVariance && compareTypes(sourceType, targetType, false) || compareTypes(targetType, sourceType, reportErrors);
|
|
@@ -54799,7 +54607,7 @@ var ts;
|
|
|
54799
54607
|
type.symbol && type.symbol.flags & 2048 && getMembersOfSymbol(type.symbol).size === 0));
|
|
54800
54608
|
}
|
|
54801
54609
|
function isUnknownLikeUnionType(type) {
|
|
54802
|
-
if (type.flags & 1048576) {
|
|
54610
|
+
if (strictNullChecks && type.flags & 1048576) {
|
|
54803
54611
|
if (!(type.objectFlags & 33554432)) {
|
|
54804
54612
|
var types = type.types;
|
|
54805
54613
|
type.objectFlags |= 33554432 | (types.length >= 3 && types[0].flags & 32768 &&
|
|
@@ -54885,11 +54693,9 @@ var ts;
|
|
|
54885
54693
|
isEnumTypeRelatedTo(getParentOfSymbol(source.symbol), getParentOfSymbol(target.symbol), errorReporter))
|
|
54886
54694
|
return true;
|
|
54887
54695
|
}
|
|
54888
|
-
if (
|
|
54696
|
+
if (s & 32768 && (!strictNullChecks && !(t & 3145728) || t & (32768 | 16384)))
|
|
54889
54697
|
return true;
|
|
54890
|
-
if (s &
|
|
54891
|
-
return true;
|
|
54892
|
-
if (s & 65536 && t & 65536)
|
|
54698
|
+
if (s & 65536 && (!strictNullChecks && !(t & 3145728) || t & 65536))
|
|
54893
54699
|
return true;
|
|
54894
54700
|
if (s & 524288 && t & 67108864 && !(relation === strictSubtypeRelation && isEmptyAnonymousObjectType(source) && !(ts.getObjectFlags(source) & 8192)))
|
|
54895
54701
|
return true;
|
|
@@ -54956,7 +54762,7 @@ var ts;
|
|
|
54956
54762
|
if (reduced !== type) {
|
|
54957
54763
|
return reduced;
|
|
54958
54764
|
}
|
|
54959
|
-
if (type.flags & 2097152) {
|
|
54765
|
+
if (type.flags & 2097152 && ts.some(type.types, isEmptyAnonymousObjectType)) {
|
|
54960
54766
|
var normalizedTypes = ts.sameMap(type.types, function (t) { return getNormalizedType(t, writing); });
|
|
54961
54767
|
if (normalizedTypes !== type.types) {
|
|
54962
54768
|
return getIntersectionType(normalizedTypes);
|
|
@@ -55154,9 +54960,7 @@ var ts;
|
|
|
55154
54960
|
relatedInfo = [info];
|
|
55155
54961
|
}
|
|
55156
54962
|
else {
|
|
55157
|
-
|
|
55158
|
-
relatedInfo.push(info);
|
|
55159
|
-
}
|
|
54963
|
+
relatedInfo.push(info);
|
|
55160
54964
|
}
|
|
55161
54965
|
}
|
|
55162
54966
|
function reportRelationError(message, source, target) {
|
|
@@ -55188,7 +54992,7 @@ var ts;
|
|
|
55188
54992
|
else if (sourceType === targetType) {
|
|
55189
54993
|
message = ts.Diagnostics.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated;
|
|
55190
54994
|
}
|
|
55191
|
-
else if (getExactOptionalUnassignableProperties(source, target).length) {
|
|
54995
|
+
else if (exactOptionalPropertyTypes && getExactOptionalUnassignableProperties(source, target).length) {
|
|
55192
54996
|
message = ts.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties;
|
|
55193
54997
|
}
|
|
55194
54998
|
else {
|
|
@@ -55203,6 +55007,7 @@ var ts;
|
|
|
55203
55007
|
}
|
|
55204
55008
|
}
|
|
55205
55009
|
else if (message === ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1
|
|
55010
|
+
&& exactOptionalPropertyTypes
|
|
55206
55011
|
&& getExactOptionalUnassignableProperties(source, target).length) {
|
|
55207
55012
|
message = ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties;
|
|
55208
55013
|
}
|
|
@@ -55421,10 +55226,8 @@ var ts;
|
|
|
55421
55226
|
return getUnionType(ts.reduceLeft(types, appendPropType, undefined) || ts.emptyArray);
|
|
55422
55227
|
}
|
|
55423
55228
|
function hasExcessProperties(source, target, reportErrors) {
|
|
55424
|
-
var _a
|
|
55425
|
-
|
|
55426
|
-
var targetNoImplicitAny = noImplicitAny((_d = (_c = target.symbol) === null || _c === void 0 ? void 0 : _c.declarations) === null || _d === void 0 ? void 0 : _d[0]);
|
|
55427
|
-
if (!isExcessPropertyCheckTarget(target) || !(sourceNoImplicitAny || targetNoImplicitAny) && ts.getObjectFlags(target) & 4096) {
|
|
55229
|
+
var _a;
|
|
55230
|
+
if (!isExcessPropertyCheckTarget(target) || !noImplicitAny && ts.getObjectFlags(target) & 4096) {
|
|
55428
55231
|
return false;
|
|
55429
55232
|
}
|
|
55430
55233
|
var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 2048);
|
|
@@ -55438,7 +55241,7 @@ var ts;
|
|
|
55438
55241
|
reducedTarget = findMatchingDiscriminantType(source, target, isRelatedTo) || filterPrimitivesIfContainsNonPrimitive(target);
|
|
55439
55242
|
checkTypes = reducedTarget.flags & 1048576 ? reducedTarget.types : [reducedTarget];
|
|
55440
55243
|
}
|
|
55441
|
-
var
|
|
55244
|
+
var _loop_20 = function (prop) {
|
|
55442
55245
|
if (shouldCheckAsExcessProperty(prop, source.symbol) && !isIgnoredJsxProperty(source, prop)) {
|
|
55443
55246
|
if (!isKnownProperty(reducedTarget, prop.escapedName, isComparingJsxAttributes)) {
|
|
55444
55247
|
if (reportErrors) {
|
|
@@ -55446,7 +55249,7 @@ var ts;
|
|
|
55446
55249
|
if (!errorNode)
|
|
55447
55250
|
return { value: ts.Debug.fail() };
|
|
55448
55251
|
if (ts.isJsxAttributes(errorNode) || ts.isJsxOpeningLikeElement(errorNode) || ts.isJsxOpeningLikeElement(errorNode.parent)) {
|
|
55449
|
-
if (prop.valueDeclaration && ts.isJsxAttribute(prop.valueDeclaration) && getSourceFileOfNode(errorNode) === getSourceFileOfNode(prop.valueDeclaration.name)) {
|
|
55252
|
+
if (prop.valueDeclaration && ts.isJsxAttribute(prop.valueDeclaration) && ts.getSourceFileOfNode(errorNode) === ts.getSourceFileOfNode(prop.valueDeclaration.name)) {
|
|
55450
55253
|
errorNode = prop.valueDeclaration.name;
|
|
55451
55254
|
}
|
|
55452
55255
|
var propName = symbolToString(prop);
|
|
@@ -55460,9 +55263,9 @@ var ts;
|
|
|
55460
55263
|
}
|
|
55461
55264
|
}
|
|
55462
55265
|
else {
|
|
55463
|
-
var objectLiteralDeclaration_1 = ((
|
|
55266
|
+
var objectLiteralDeclaration_1 = ((_a = source.symbol) === null || _a === void 0 ? void 0 : _a.declarations) && ts.firstOrUndefined(source.symbol.declarations);
|
|
55464
55267
|
var suggestion = void 0;
|
|
55465
|
-
if (prop.valueDeclaration && ts.findAncestor(prop.valueDeclaration, function (d) { return d === objectLiteralDeclaration_1; }) && getSourceFileOfNode(objectLiteralDeclaration_1) === getSourceFileOfNode(errorNode)) {
|
|
55268
|
+
if (prop.valueDeclaration && ts.findAncestor(prop.valueDeclaration, function (d) { return d === objectLiteralDeclaration_1; }) && ts.getSourceFileOfNode(objectLiteralDeclaration_1) === ts.getSourceFileOfNode(errorNode)) {
|
|
55466
55269
|
var propDeclaration = prop.valueDeclaration;
|
|
55467
55270
|
ts.Debug.assertNode(propDeclaration, ts.isObjectLiteralElementLike);
|
|
55468
55271
|
errorNode = propDeclaration;
|
|
@@ -55489,11 +55292,11 @@ var ts;
|
|
|
55489
55292
|
}
|
|
55490
55293
|
}
|
|
55491
55294
|
};
|
|
55492
|
-
for (var _i = 0,
|
|
55493
|
-
var prop =
|
|
55494
|
-
var
|
|
55495
|
-
if (typeof
|
|
55496
|
-
return
|
|
55295
|
+
for (var _i = 0, _b = getPropertiesOfType(source); _i < _b.length; _i++) {
|
|
55296
|
+
var prop = _b[_i];
|
|
55297
|
+
var state_6 = _loop_20(prop);
|
|
55298
|
+
if (typeof state_6 === "object")
|
|
55299
|
+
return state_6.value;
|
|
55497
55300
|
}
|
|
55498
55301
|
return false;
|
|
55499
55302
|
}
|
|
@@ -56039,11 +55842,11 @@ var ts;
|
|
|
56039
55842
|
}
|
|
56040
55843
|
if (sourceFlags & 8650752) {
|
|
56041
55844
|
if (!(sourceFlags & 8388608 && targetFlags & 8388608)) {
|
|
56042
|
-
var constraint = getConstraintOfType(source) ||
|
|
55845
|
+
var constraint = getConstraintOfType(source) || unknownType;
|
|
56043
55846
|
if (result = isRelatedTo(constraint, target, 1, false, undefined, intersectionState)) {
|
|
56044
55847
|
return result;
|
|
56045
55848
|
}
|
|
56046
|
-
else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1, reportErrors &&
|
|
55849
|
+
else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1, reportErrors && constraint !== unknownType && !(targetFlags & sourceFlags & 262144), undefined, intersectionState)) {
|
|
56047
55850
|
return result;
|
|
56048
55851
|
}
|
|
56049
55852
|
if (isMappedTypeGenericIndexedAccess(source)) {
|
|
@@ -56266,25 +56069,25 @@ var ts;
|
|
|
56266
56069
|
}
|
|
56267
56070
|
var discriminantCombinations = ts.cartesianProduct(sourceDiscriminantTypes);
|
|
56268
56071
|
var matchingTypes = [];
|
|
56269
|
-
var
|
|
56072
|
+
var _loop_21 = function (combination) {
|
|
56270
56073
|
var hasMatch = false;
|
|
56271
56074
|
outer: for (var _c = 0, _d = target.types; _c < _d.length; _c++) {
|
|
56272
56075
|
var type = _d[_c];
|
|
56273
|
-
var
|
|
56076
|
+
var _loop_22 = function (i) {
|
|
56274
56077
|
var sourceProperty = sourcePropertiesFiltered[i];
|
|
56275
56078
|
var targetProperty = getPropertyOfType(type, sourceProperty.escapedName);
|
|
56276
56079
|
if (!targetProperty)
|
|
56277
56080
|
return "continue-outer";
|
|
56278
56081
|
if (sourceProperty === targetProperty)
|
|
56279
56082
|
return "continue";
|
|
56280
|
-
var related = propertyRelatedTo(source, target, sourceProperty, targetProperty, function (_) { return combination[i]; }, false, 0, strictNullChecks
|
|
56083
|
+
var related = propertyRelatedTo(source, target, sourceProperty, targetProperty, function (_) { return combination[i]; }, false, 0, strictNullChecks || relation === comparableRelation);
|
|
56281
56084
|
if (!related) {
|
|
56282
56085
|
return "continue-outer";
|
|
56283
56086
|
}
|
|
56284
56087
|
};
|
|
56285
56088
|
for (var i = 0; i < sourcePropertiesFiltered.length; i++) {
|
|
56286
|
-
var
|
|
56287
|
-
switch (
|
|
56089
|
+
var state_8 = _loop_22(i);
|
|
56090
|
+
switch (state_8) {
|
|
56288
56091
|
case "continue-outer": continue outer;
|
|
56289
56092
|
}
|
|
56290
56093
|
}
|
|
@@ -56297,9 +56100,9 @@ var ts;
|
|
|
56297
56100
|
};
|
|
56298
56101
|
for (var _a = 0, discriminantCombinations_1 = discriminantCombinations; _a < discriminantCombinations_1.length; _a++) {
|
|
56299
56102
|
var combination = discriminantCombinations_1[_a];
|
|
56300
|
-
var
|
|
56301
|
-
if (typeof
|
|
56302
|
-
return
|
|
56103
|
+
var state_7 = _loop_21(combination);
|
|
56104
|
+
if (typeof state_7 === "object")
|
|
56105
|
+
return state_7.value;
|
|
56303
56106
|
}
|
|
56304
56107
|
var result = -1;
|
|
56305
56108
|
for (var _b = 0, matchingTypes_1 = matchingTypes; _b < matchingTypes_1.length; _b++) {
|
|
@@ -56337,8 +56140,8 @@ var ts;
|
|
|
56337
56140
|
return result || properties;
|
|
56338
56141
|
}
|
|
56339
56142
|
function isPropertySymbolTypeRelated(sourceProp, targetProp, getTypeOfSourceProperty, reportErrors, intersectionState) {
|
|
56340
|
-
var targetIsOptional = strictNullChecks
|
|
56341
|
-
var effectiveTarget = addOptionality(getNonMissingTypeOfSymbol(targetProp),
|
|
56143
|
+
var targetIsOptional = strictNullChecks && !!(ts.getCheckFlags(targetProp) & 48);
|
|
56144
|
+
var effectiveTarget = addOptionality(getNonMissingTypeOfSymbol(targetProp), false, targetIsOptional);
|
|
56342
56145
|
var effectiveSource = getTypeOfSourceProperty(sourceProp);
|
|
56343
56146
|
return isRelatedTo(effectiveSource, effectiveTarget, 3, reportErrors, undefined, intersectionState);
|
|
56344
56147
|
}
|
|
@@ -56732,9 +56535,9 @@ var ts;
|
|
|
56732
56535
|
}
|
|
56733
56536
|
if (isApplicableIndexType(getLiteralTypeFromProperty(prop, 8576), keyType)) {
|
|
56734
56537
|
var propType = getNonMissingTypeOfSymbol(prop);
|
|
56735
|
-
var type = exactOptionalPropertyTypes
|
|
56538
|
+
var type = exactOptionalPropertyTypes || propType.flags & 32768 || keyType === numberType || !(prop.flags & 16777216)
|
|
56736
56539
|
? propType
|
|
56737
|
-
: getTypeWithFacts(propType, 524288
|
|
56540
|
+
: getTypeWithFacts(propType, 524288);
|
|
56738
56541
|
var related = isRelatedTo(type, targetInfo.type, 3, reportErrors);
|
|
56739
56542
|
if (!related) {
|
|
56740
56543
|
if (reportErrors) {
|
|
@@ -56870,8 +56673,7 @@ var ts;
|
|
|
56870
56673
|
findMatchingTypeReferenceOrTypeAliasReference(source, target) ||
|
|
56871
56674
|
findBestTypeForObjectLiteral(source, target) ||
|
|
56872
56675
|
findBestTypeForInvokable(source, target) ||
|
|
56873
|
-
findMostOverlappyType(source, target)
|
|
56874
|
-
(target.types.length === 2 && target.types[0].flags & 98304 ? target.types[1] : undefined);
|
|
56676
|
+
findMostOverlappyType(source, target);
|
|
56875
56677
|
}
|
|
56876
56678
|
function discriminateTypeByDiscriminableItems(target, discriminators, related, defaultValue, skipPartial) {
|
|
56877
56679
|
var discriminable = target.types.map(function (_) { return undefined; });
|
|
@@ -56942,7 +56744,7 @@ var ts;
|
|
|
56942
56744
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes", "getVariancesWorker", { arity: typeParameters.length, id: getTypeId(getDeclaredTypeOfSymbol(symbol)) });
|
|
56943
56745
|
links.variances = ts.emptyArray;
|
|
56944
56746
|
var variances = [];
|
|
56945
|
-
var
|
|
56747
|
+
var _loop_23 = function (tp) {
|
|
56946
56748
|
var modifiers = getVarianceModifiers(tp);
|
|
56947
56749
|
var variance = modifiers & 65536 ?
|
|
56948
56750
|
modifiers & 32768 ? 0 : 1 :
|
|
@@ -56973,7 +56775,7 @@ var ts;
|
|
|
56973
56775
|
};
|
|
56974
56776
|
for (var _i = 0, typeParameters_2 = typeParameters; _i < typeParameters_2.length; _i++) {
|
|
56975
56777
|
var tp = typeParameters_2[_i];
|
|
56976
|
-
|
|
56778
|
+
_loop_23(tp);
|
|
56977
56779
|
}
|
|
56978
56780
|
links.variances = variances;
|
|
56979
56781
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop({ variances: variances.map(ts.Debug.formatVariance) });
|
|
@@ -57265,11 +57067,11 @@ var ts;
|
|
|
57265
57067
|
function getCombinedTypeFlags(types) {
|
|
57266
57068
|
return ts.reduceLeft(types, function (flags, t) { return flags | (t.flags & 1048576 ? getCombinedTypeFlags(t.types) : t.flags); }, 0);
|
|
57267
57069
|
}
|
|
57268
|
-
function getCommonSupertype(types
|
|
57070
|
+
function getCommonSupertype(types) {
|
|
57269
57071
|
if (types.length === 1) {
|
|
57270
57072
|
return types[0];
|
|
57271
57073
|
}
|
|
57272
|
-
var primaryTypes = strictNullChecks
|
|
57074
|
+
var primaryTypes = strictNullChecks ? ts.sameMap(types, function (t) { return filterType(t, function (u) { return !(u.flags & 98304); }); }) : types;
|
|
57273
57075
|
var superTypeOrUnion = literalTypesWithSameBaseType(primaryTypes) ?
|
|
57274
57076
|
getUnionType(primaryTypes) :
|
|
57275
57077
|
ts.reduceLeft(primaryTypes, function (s, t) { return isTypeSubtypeOf(s, t) ? t : s; });
|
|
@@ -57326,7 +57128,7 @@ var ts;
|
|
|
57326
57128
|
return type.cachedEquivalentBaseType = instantiatedBase;
|
|
57327
57129
|
}
|
|
57328
57130
|
function isEmptyLiteralType(type) {
|
|
57329
|
-
return type === implicitNeverType
|
|
57131
|
+
return strictNullChecks ? type === implicitNeverType : type === undefinedWideningType;
|
|
57330
57132
|
}
|
|
57331
57133
|
function isEmptyArrayLiteralType(type) {
|
|
57332
57134
|
var elementType = getElementTypeOfArrayType(type);
|
|
@@ -57456,8 +57258,8 @@ var ts;
|
|
|
57456
57258
|
var value = _a.value;
|
|
57457
57259
|
return value.base10Value === "0";
|
|
57458
57260
|
}
|
|
57459
|
-
function removeDefinitelyFalsyTypes(type
|
|
57460
|
-
return filterType(type, function (t) { return !!(getTypeFacts(t
|
|
57261
|
+
function removeDefinitelyFalsyTypes(type) {
|
|
57262
|
+
return filterType(type, function (t) { return !!(getTypeFacts(t) & 4194304); });
|
|
57461
57263
|
}
|
|
57462
57264
|
function extractDefinitelyFalsyTypes(type) {
|
|
57463
57265
|
return mapType(type, getDefinitelyFalsyPartOfType);
|
|
@@ -57481,9 +57283,10 @@ var ts;
|
|
|
57481
57283
|
missing === 65536 ? getUnionType([type, nullType]) :
|
|
57482
57284
|
getUnionType([type, undefinedType, nullType]);
|
|
57483
57285
|
}
|
|
57484
|
-
function getOptionalType(type,
|
|
57286
|
+
function getOptionalType(type, isProperty) {
|
|
57485
57287
|
if (isProperty === void 0) { isProperty = false; }
|
|
57486
|
-
|
|
57288
|
+
ts.Debug.assert(strictNullChecks);
|
|
57289
|
+
return type.flags & 32768 ? type : getUnionType([type, isProperty ? missingType : undefinedType]);
|
|
57487
57290
|
}
|
|
57488
57291
|
function getGlobalNonNullableTypeInstantiation(type) {
|
|
57489
57292
|
if (!deferredGlobalNonNullableTypeAlias) {
|
|
@@ -57493,31 +57296,31 @@ var ts;
|
|
|
57493
57296
|
getTypeAliasInstantiation(deferredGlobalNonNullableTypeAlias, [type]) :
|
|
57494
57297
|
getIntersectionType([type, emptyObjectType]);
|
|
57495
57298
|
}
|
|
57496
|
-
function getNonNullableType(type
|
|
57497
|
-
return getAdjustedTypeWithFacts(type, 2097152
|
|
57299
|
+
function getNonNullableType(type) {
|
|
57300
|
+
return strictNullChecks ? getAdjustedTypeWithFacts(type, 2097152) : type;
|
|
57498
57301
|
}
|
|
57499
|
-
function addOptionalTypeMarker(type
|
|
57500
|
-
return strictNullChecks
|
|
57302
|
+
function addOptionalTypeMarker(type) {
|
|
57303
|
+
return strictNullChecks ? getUnionType([type, optionalType]) : type;
|
|
57501
57304
|
}
|
|
57502
57305
|
function removeOptionalTypeMarker(type) {
|
|
57503
|
-
return removeType(type, optionalType);
|
|
57306
|
+
return strictNullChecks ? removeType(type, optionalType) : type;
|
|
57504
57307
|
}
|
|
57505
57308
|
function propagateOptionalTypeMarker(type, node, wasOptional) {
|
|
57506
|
-
return wasOptional ? ts.isOutermostOptionalChain(node) ? getOptionalType(type
|
|
57309
|
+
return wasOptional ? ts.isOutermostOptionalChain(node) ? getOptionalType(type) : addOptionalTypeMarker(type) : type;
|
|
57507
57310
|
}
|
|
57508
57311
|
function getOptionalExpressionType(exprType, expression) {
|
|
57509
|
-
return ts.isExpressionOfOptionalChainRoot(expression) ? getNonNullableType(exprType
|
|
57312
|
+
return ts.isExpressionOfOptionalChainRoot(expression) ? getNonNullableType(exprType) :
|
|
57510
57313
|
ts.isOptionalChain(expression) ? removeOptionalTypeMarker(exprType) :
|
|
57511
57314
|
exprType;
|
|
57512
57315
|
}
|
|
57513
57316
|
function removeMissingType(type, isOptional) {
|
|
57514
|
-
return isOptional ? removeType(type, missingType) : type;
|
|
57317
|
+
return exactOptionalPropertyTypes && isOptional ? removeType(type, missingType) : type;
|
|
57515
57318
|
}
|
|
57516
57319
|
function containsMissingType(type) {
|
|
57517
|
-
return (type === missingType || type.flags & 1048576 && containsType(type.types, missingType));
|
|
57320
|
+
return exactOptionalPropertyTypes && (type === missingType || type.flags & 1048576 && containsType(type.types, missingType));
|
|
57518
57321
|
}
|
|
57519
|
-
function removeMissingOrUndefinedType(type
|
|
57520
|
-
return exactOptionalPropertyTypes
|
|
57322
|
+
function removeMissingOrUndefinedType(type) {
|
|
57323
|
+
return exactOptionalPropertyTypes ? removeType(type, missingType) : getTypeWithFacts(type, 524288);
|
|
57521
57324
|
}
|
|
57522
57325
|
function isCoercibleUnderDoubleEquals(source, target) {
|
|
57523
57326
|
return ((source.flags & (8 | 4 | 512)) !== 0)
|
|
@@ -57624,7 +57427,7 @@ var ts;
|
|
|
57624
57427
|
if (cached) {
|
|
57625
57428
|
return cached;
|
|
57626
57429
|
}
|
|
57627
|
-
var result = createSymbolWithType(prop,
|
|
57430
|
+
var result = createSymbolWithType(prop, missingType);
|
|
57628
57431
|
result.flags |= 16777216;
|
|
57629
57432
|
undefinedProperties.set(prop.escapedName, result);
|
|
57630
57433
|
return result;
|
|
@@ -57721,7 +57524,7 @@ var ts;
|
|
|
57721
57524
|
}
|
|
57722
57525
|
function reportImplicitAny(declaration, type, wideningKind) {
|
|
57723
57526
|
var typeAsString = typeToString(getWidenedType(type));
|
|
57724
|
-
if (ts.isInJSFile(declaration) && !ts.isCheckJsEnabledForFile(getSourceFileOfNode(declaration), compilerOptions)) {
|
|
57527
|
+
if (ts.isInJSFile(declaration) && !ts.isCheckJsEnabledForFile(ts.getSourceFileOfNode(declaration), compilerOptions)) {
|
|
57725
57528
|
return;
|
|
57726
57529
|
}
|
|
57727
57530
|
var diagnostic;
|
|
@@ -57729,7 +57532,7 @@ var ts;
|
|
|
57729
57532
|
case 222:
|
|
57730
57533
|
case 168:
|
|
57731
57534
|
case 167:
|
|
57732
|
-
diagnostic = noImplicitAny
|
|
57535
|
+
diagnostic = noImplicitAny ? ts.Diagnostics.Member_0_implicitly_has_an_1_type : ts.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;
|
|
57733
57536
|
break;
|
|
57734
57537
|
case 165:
|
|
57735
57538
|
var param = declaration;
|
|
@@ -57740,16 +57543,16 @@ var ts;
|
|
|
57740
57543
|
param.name.originalKeywordKind && ts.isTypeNodeKind(param.name.originalKeywordKind))) {
|
|
57741
57544
|
var newName = "arg" + param.parent.parameters.indexOf(param);
|
|
57742
57545
|
var typeName = ts.declarationNameToString(param.name) + (param.dotDotDotToken ? "[]" : "");
|
|
57743
|
-
errorOrSuggestion(noImplicitAny
|
|
57546
|
+
errorOrSuggestion(noImplicitAny, declaration, ts.Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, typeName);
|
|
57744
57547
|
return;
|
|
57745
57548
|
}
|
|
57746
57549
|
diagnostic = declaration.dotDotDotToken ?
|
|
57747
|
-
noImplicitAny
|
|
57748
|
-
noImplicitAny
|
|
57550
|
+
noImplicitAny ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage :
|
|
57551
|
+
noImplicitAny ? ts.Diagnostics.Parameter_0_implicitly_has_an_1_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;
|
|
57749
57552
|
break;
|
|
57750
57553
|
case 204:
|
|
57751
57554
|
diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type;
|
|
57752
|
-
if (!noImplicitAny
|
|
57555
|
+
if (!noImplicitAny) {
|
|
57753
57556
|
return;
|
|
57754
57557
|
}
|
|
57755
57558
|
break;
|
|
@@ -57763,7 +57566,7 @@ var ts;
|
|
|
57763
57566
|
case 174:
|
|
57764
57567
|
case 214:
|
|
57765
57568
|
case 215:
|
|
57766
|
-
if (noImplicitAny
|
|
57569
|
+
if (noImplicitAny && !declaration.name) {
|
|
57767
57570
|
if (wideningKind === 3) {
|
|
57768
57571
|
error(declaration, ts.Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, typeAsString);
|
|
57769
57572
|
}
|
|
@@ -57772,23 +57575,23 @@ var ts;
|
|
|
57772
57575
|
}
|
|
57773
57576
|
return;
|
|
57774
57577
|
}
|
|
57775
|
-
diagnostic = !noImplicitAny
|
|
57578
|
+
diagnostic = !noImplicitAny ? ts.Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage :
|
|
57776
57579
|
wideningKind === 3 ? ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type :
|
|
57777
57580
|
ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type;
|
|
57778
57581
|
break;
|
|
57779
57582
|
case 196:
|
|
57780
|
-
if (noImplicitAny
|
|
57583
|
+
if (noImplicitAny) {
|
|
57781
57584
|
error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type);
|
|
57782
57585
|
}
|
|
57783
57586
|
return;
|
|
57784
57587
|
default:
|
|
57785
|
-
diagnostic = noImplicitAny
|
|
57588
|
+
diagnostic = noImplicitAny ? ts.Diagnostics.Variable_0_implicitly_has_an_1_type : ts.Diagnostics.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;
|
|
57786
57589
|
}
|
|
57787
|
-
errorOrSuggestion(noImplicitAny
|
|
57590
|
+
errorOrSuggestion(noImplicitAny, declaration, diagnostic, ts.declarationNameToString(ts.getNameOfDeclaration(declaration)), typeAsString);
|
|
57788
57591
|
}
|
|
57789
57592
|
function reportErrorsFromWidening(declaration, type, wideningKind) {
|
|
57790
57593
|
addLazyDiagnostic(function () {
|
|
57791
|
-
if (noImplicitAny
|
|
57594
|
+
if (noImplicitAny && ts.getObjectFlags(type) & 65536 && (!wideningKind || !getContextualSignatureForFunctionLikeDeclaration(declaration))) {
|
|
57792
57595
|
if (!reportWideningErrorsInType(type)) {
|
|
57793
57596
|
reportImplicitAny(declaration, type, wideningKind);
|
|
57794
57597
|
}
|
|
@@ -58476,11 +58279,7 @@ var ts;
|
|
|
58476
58279
|
contravariant = !contravariant;
|
|
58477
58280
|
}
|
|
58478
58281
|
function inferFromContravariantTypesIfStrictFunctionTypes(source, target) {
|
|
58479
|
-
|
|
58480
|
-
var sourceFile = ((_a = source.symbol) === null || _a === void 0 ? void 0 : _a.valueDeclaration) && getSourceFileOfNode((_b = source.symbol) === null || _b === void 0 ? void 0 : _b.valueDeclaration);
|
|
58481
|
-
var targetFile = ((_c = target.symbol) === null || _c === void 0 ? void 0 : _c.valueDeclaration) && getSourceFileOfNode((_d = target.symbol) === null || _d === void 0 ? void 0 : _d.valueDeclaration);
|
|
58482
|
-
var strictSignatureComparison = strictFunctionTypes(sourceFile) || strictFunctionTypes(targetFile);
|
|
58483
|
-
if (strictSignatureComparison || priority & 1024) {
|
|
58282
|
+
if (strictFunctionTypes || priority & 1024) {
|
|
58484
58283
|
inferFromContravariantTypes(source, target);
|
|
58485
58284
|
}
|
|
58486
58285
|
else {
|
|
@@ -58620,7 +58419,7 @@ var ts;
|
|
|
58620
58419
|
var matches = inferTypesFromTemplateLiteralType(source, target);
|
|
58621
58420
|
var types = target.types;
|
|
58622
58421
|
if (matches || ts.every(target.texts, function (s) { return s.length === 0; })) {
|
|
58623
|
-
var
|
|
58422
|
+
var _loop_24 = function (i) {
|
|
58624
58423
|
var source_1 = matches ? matches[i] : neverType;
|
|
58625
58424
|
var target_3 = types[i];
|
|
58626
58425
|
if (source_1.flags & 128 && target_3.flags & 8650752) {
|
|
@@ -58664,7 +58463,7 @@ var ts;
|
|
|
58664
58463
|
inferFromTypes(source_1, target_3);
|
|
58665
58464
|
};
|
|
58666
58465
|
for (var i = 0; i < types.length; i++) {
|
|
58667
|
-
|
|
58466
|
+
_loop_24(i);
|
|
58668
58467
|
}
|
|
58669
58468
|
}
|
|
58670
58469
|
}
|
|
@@ -58787,7 +58586,7 @@ var ts;
|
|
|
58787
58586
|
var prop = _b[_a];
|
|
58788
58587
|
if (isApplicableIndexType(getLiteralTypeFromProperty(prop, 8576), targetInfo.keyType)) {
|
|
58789
58588
|
var propType = getTypeOfSymbol(prop);
|
|
58790
|
-
propTypes.push(prop.flags & 16777216 ? removeMissingOrUndefinedType(propType
|
|
58589
|
+
propTypes.push(prop.flags & 16777216 ? removeMissingOrUndefinedType(propType) : propType);
|
|
58791
58590
|
}
|
|
58792
58591
|
}
|
|
58793
58592
|
for (var _c = 0, _d = getIndexInfosOfType(source); _c < _d.length; _c++) {
|
|
@@ -58811,7 +58610,7 @@ var ts;
|
|
|
58811
58610
|
}
|
|
58812
58611
|
}
|
|
58813
58612
|
function isTypeOrBaseIdenticalTo(s, t) {
|
|
58814
|
-
return t === missingType ? s === t :
|
|
58613
|
+
return exactOptionalPropertyTypes && t === missingType ? s === t :
|
|
58815
58614
|
(isTypeIdenticalTo(s, t) || !!(t.flags & 4 && s.flags & 128 || t.flags & 8 && s.flags & 256));
|
|
58816
58615
|
}
|
|
58817
58616
|
function isTypeCloselyMatchedBy(s, t) {
|
|
@@ -58842,7 +58641,6 @@ var ts;
|
|
|
58842
58641
|
return inference.priority & 416 ? getIntersectionType(inference.contraCandidates) : getCommonSubtype(inference.contraCandidates);
|
|
58843
58642
|
}
|
|
58844
58643
|
function getCovariantInference(inference, signature) {
|
|
58845
|
-
var _a;
|
|
58846
58644
|
var candidates = unionObjectAndArrayLiteralCandidates(inference.candidates);
|
|
58847
58645
|
var primitiveConstraint = hasPrimitiveConstraint(inference.typeParameter);
|
|
58848
58646
|
var widenLiteralTypes = !primitiveConstraint && inference.topLevel &&
|
|
@@ -58852,7 +58650,7 @@ var ts;
|
|
|
58852
58650
|
candidates;
|
|
58853
58651
|
var unwidenedType = inference.priority & 416 ?
|
|
58854
58652
|
getUnionType(baseCandidates, 2) :
|
|
58855
|
-
getCommonSupertype(baseCandidates
|
|
58653
|
+
getCommonSupertype(baseCandidates);
|
|
58856
58654
|
return getWidenedType(unwidenedType);
|
|
58857
58655
|
}
|
|
58858
58656
|
function getInferredType(context, index) {
|
|
@@ -59140,7 +58938,7 @@ var ts;
|
|
|
59140
58938
|
function mapTypesByKeyProperty(types, name) {
|
|
59141
58939
|
var map = new ts.Map();
|
|
59142
58940
|
var count = 0;
|
|
59143
|
-
var
|
|
58941
|
+
var _loop_25 = function (type) {
|
|
59144
58942
|
if (type.flags & (524288 | 2097152 | 58982400)) {
|
|
59145
58943
|
var discriminant = getTypeOfPropertyOfType(type, name);
|
|
59146
58944
|
if (discriminant) {
|
|
@@ -59166,9 +58964,9 @@ var ts;
|
|
|
59166
58964
|
};
|
|
59167
58965
|
for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
|
|
59168
58966
|
var type = types_15[_i];
|
|
59169
|
-
var
|
|
59170
|
-
if (typeof
|
|
59171
|
-
return
|
|
58967
|
+
var state_9 = _loop_25(type);
|
|
58968
|
+
if (typeof state_9 === "object")
|
|
58969
|
+
return state_9.value;
|
|
59172
58970
|
}
|
|
59173
58971
|
return count >= 10 && count * 2 >= types.length ? map : undefined;
|
|
59174
58972
|
}
|
|
@@ -59265,52 +59063,52 @@ var ts;
|
|
|
59265
59063
|
return !!(resolved.callSignatures.length || resolved.constructSignatures.length ||
|
|
59266
59064
|
resolved.members.get("bind") && isTypeSubtypeOf(type, globalFunctionType));
|
|
59267
59065
|
}
|
|
59268
|
-
function getTypeFacts(type
|
|
59066
|
+
function getTypeFacts(type) {
|
|
59269
59067
|
if (type.flags & (2097152 | 465829888)) {
|
|
59270
59068
|
type = getBaseConstraintOfType(type) || unknownType;
|
|
59271
59069
|
}
|
|
59272
59070
|
var flags = type.flags;
|
|
59273
59071
|
if (flags & (4 | 268435456)) {
|
|
59274
|
-
return strictNullChecks
|
|
59072
|
+
return strictNullChecks ? 16317953 : 16776705;
|
|
59275
59073
|
}
|
|
59276
59074
|
if (flags & (128 | 134217728)) {
|
|
59277
59075
|
var isEmpty = flags & 128 && type.value === "";
|
|
59278
|
-
return strictNullChecks
|
|
59076
|
+
return strictNullChecks ?
|
|
59279
59077
|
isEmpty ? 12123649 : 7929345 :
|
|
59280
59078
|
isEmpty ? 12582401 : 16776705;
|
|
59281
59079
|
}
|
|
59282
59080
|
if (flags & (8 | 32)) {
|
|
59283
|
-
return strictNullChecks
|
|
59081
|
+
return strictNullChecks ? 16317698 : 16776450;
|
|
59284
59082
|
}
|
|
59285
59083
|
if (flags & 256) {
|
|
59286
59084
|
var isZero = type.value === 0;
|
|
59287
|
-
return strictNullChecks
|
|
59085
|
+
return strictNullChecks ?
|
|
59288
59086
|
isZero ? 12123394 : 7929090 :
|
|
59289
59087
|
isZero ? 12582146 : 16776450;
|
|
59290
59088
|
}
|
|
59291
59089
|
if (flags & 64) {
|
|
59292
|
-
return strictNullChecks
|
|
59090
|
+
return strictNullChecks ? 16317188 : 16775940;
|
|
59293
59091
|
}
|
|
59294
59092
|
if (flags & 2048) {
|
|
59295
59093
|
var isZero = isZeroBigInt(type);
|
|
59296
|
-
return strictNullChecks
|
|
59094
|
+
return strictNullChecks ?
|
|
59297
59095
|
isZero ? 12122884 : 7928580 :
|
|
59298
59096
|
isZero ? 12581636 : 16775940;
|
|
59299
59097
|
}
|
|
59300
59098
|
if (flags & 16) {
|
|
59301
|
-
return strictNullChecks
|
|
59099
|
+
return strictNullChecks ? 16316168 : 16774920;
|
|
59302
59100
|
}
|
|
59303
59101
|
if (flags & 528) {
|
|
59304
|
-
return strictNullChecks
|
|
59102
|
+
return strictNullChecks ?
|
|
59305
59103
|
(type === falseType || type === regularFalseType) ? 12121864 : 7927560 :
|
|
59306
59104
|
(type === falseType || type === regularFalseType) ? 12580616 : 16774920;
|
|
59307
59105
|
}
|
|
59308
59106
|
if (flags & 524288) {
|
|
59309
59107
|
return ts.getObjectFlags(type) & 16 && isEmptyObjectType(type) ?
|
|
59310
|
-
strictNullChecks
|
|
59108
|
+
strictNullChecks ? 83427327 : 83886079 :
|
|
59311
59109
|
isFunctionObjectType(type) ?
|
|
59312
|
-
strictNullChecks
|
|
59313
|
-
strictNullChecks
|
|
59110
|
+
strictNullChecks ? 7880640 : 16728000 :
|
|
59111
|
+
strictNullChecks ? 7888800 : 16736160;
|
|
59314
59112
|
}
|
|
59315
59113
|
if (flags & 16384) {
|
|
59316
59114
|
return 9830144;
|
|
@@ -59322,50 +59120,50 @@ var ts;
|
|
|
59322
59120
|
return 42917664;
|
|
59323
59121
|
}
|
|
59324
59122
|
if (flags & 12288) {
|
|
59325
|
-
return strictNullChecks
|
|
59123
|
+
return strictNullChecks ? 7925520 : 16772880;
|
|
59326
59124
|
}
|
|
59327
59125
|
if (flags & 67108864) {
|
|
59328
|
-
return strictNullChecks
|
|
59126
|
+
return strictNullChecks ? 7888800 : 16736160;
|
|
59329
59127
|
}
|
|
59330
59128
|
if (flags & 131072) {
|
|
59331
59129
|
return 0;
|
|
59332
59130
|
}
|
|
59333
59131
|
if (flags & 1048576) {
|
|
59334
|
-
return ts.reduceLeft(type.types, function (facts, t) { return facts | getTypeFacts(t
|
|
59132
|
+
return ts.reduceLeft(type.types, function (facts, t) { return facts | getTypeFacts(t); }, 0);
|
|
59335
59133
|
}
|
|
59336
59134
|
if (flags & 2097152) {
|
|
59337
|
-
return getIntersectionTypeFacts(type
|
|
59135
|
+
return getIntersectionTypeFacts(type);
|
|
59338
59136
|
}
|
|
59339
59137
|
return 83886079;
|
|
59340
59138
|
}
|
|
59341
|
-
function getIntersectionTypeFacts(type
|
|
59139
|
+
function getIntersectionTypeFacts(type) {
|
|
59342
59140
|
var ignoreObjects = maybeTypeOfKind(type, 131068);
|
|
59343
59141
|
var oredFacts = 0;
|
|
59344
59142
|
var andedFacts = 134217727;
|
|
59345
59143
|
for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
|
|
59346
59144
|
var t = _a[_i];
|
|
59347
59145
|
if (!(ignoreObjects && t.flags & 524288)) {
|
|
59348
|
-
var f = getTypeFacts(t
|
|
59146
|
+
var f = getTypeFacts(t);
|
|
59349
59147
|
oredFacts |= f;
|
|
59350
59148
|
andedFacts &= f;
|
|
59351
59149
|
}
|
|
59352
59150
|
}
|
|
59353
59151
|
return oredFacts & 8256 | andedFacts & 134209471;
|
|
59354
59152
|
}
|
|
59355
|
-
function getTypeWithFacts(type, include
|
|
59356
|
-
return filterType(type, function (t) { return (getTypeFacts(t
|
|
59153
|
+
function getTypeWithFacts(type, include) {
|
|
59154
|
+
return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; });
|
|
59357
59155
|
}
|
|
59358
|
-
function getAdjustedTypeWithFacts(type, facts
|
|
59359
|
-
var reduced = recombineUnknownType(getTypeWithFacts(strictNullChecks
|
|
59360
|
-
if (strictNullChecks
|
|
59156
|
+
function getAdjustedTypeWithFacts(type, facts) {
|
|
59157
|
+
var reduced = recombineUnknownType(getTypeWithFacts(strictNullChecks && type.flags & 2 ? unknownUnionType : type, facts));
|
|
59158
|
+
if (strictNullChecks) {
|
|
59361
59159
|
switch (facts) {
|
|
59362
59160
|
case 524288:
|
|
59363
|
-
return mapType(reduced, function (t) { return getTypeFacts(t
|
|
59161
|
+
return mapType(reduced, function (t) { return getTypeFacts(t) & 65536 ? getIntersectionType([t, getTypeFacts(t) & 131072 && !maybeTypeOfKind(reduced, 65536) ? getUnionType([emptyObjectType, nullType]) : emptyObjectType]) : t; });
|
|
59364
59162
|
case 1048576:
|
|
59365
|
-
return mapType(reduced, function (t) { return getTypeFacts(t
|
|
59163
|
+
return mapType(reduced, function (t) { return getTypeFacts(t) & 131072 ? getIntersectionType([t, getTypeFacts(t) & 65536 && !maybeTypeOfKind(reduced, 32768) ? getUnionType([emptyObjectType, undefinedType]) : emptyObjectType]) : t; });
|
|
59366
59164
|
case 2097152:
|
|
59367
59165
|
case 4194304:
|
|
59368
|
-
return mapType(reduced, function (t) { return getTypeFacts(t
|
|
59166
|
+
return mapType(reduced, function (t) { return getTypeFacts(t) & 262144 ? getGlobalNonNullableTypeInstantiation(t) : t; });
|
|
59369
59167
|
}
|
|
59370
59168
|
}
|
|
59371
59169
|
return reduced;
|
|
@@ -59375,7 +59173,7 @@ var ts;
|
|
|
59375
59173
|
}
|
|
59376
59174
|
function getTypeWithDefault(type, defaultExpression) {
|
|
59377
59175
|
return defaultExpression ?
|
|
59378
|
-
getUnionType([getNonUndefinedType(type
|
|
59176
|
+
getUnionType([getNonUndefinedType(type), getTypeOfExpression(defaultExpression)]) :
|
|
59379
59177
|
type;
|
|
59380
59178
|
}
|
|
59381
59179
|
function getTypeOfDestructuredProperty(type, name) {
|
|
@@ -59384,18 +59182,17 @@ var ts;
|
|
|
59384
59182
|
if (!isTypeUsableAsPropertyName(nameType))
|
|
59385
59183
|
return errorType;
|
|
59386
59184
|
var text = getPropertyNameFromType(nameType);
|
|
59387
|
-
return getTypeOfPropertyOfType(type, text) || includeUndefinedInIndexSignature((_a = getApplicableIndexInfoForName(type, text)) === null || _a === void 0 ? void 0 : _a.type
|
|
59185
|
+
return getTypeOfPropertyOfType(type, text) || includeUndefinedInIndexSignature((_a = getApplicableIndexInfoForName(type, text)) === null || _a === void 0 ? void 0 : _a.type) || errorType;
|
|
59388
59186
|
}
|
|
59389
59187
|
function getTypeOfDestructuredArrayElement(type, index) {
|
|
59390
59188
|
return everyType(type, isTupleLikeType) && getTupleElementType(type, index) ||
|
|
59391
|
-
includeUndefinedInIndexSignature(checkIteratedTypeOrElementType(65, type, undefinedType, undefined)
|
|
59189
|
+
includeUndefinedInIndexSignature(checkIteratedTypeOrElementType(65, type, undefinedType, undefined)) ||
|
|
59392
59190
|
errorType;
|
|
59393
59191
|
}
|
|
59394
|
-
function includeUndefinedInIndexSignature(type
|
|
59395
|
-
var _a;
|
|
59192
|
+
function includeUndefinedInIndexSignature(type) {
|
|
59396
59193
|
if (!type)
|
|
59397
59194
|
return type;
|
|
59398
|
-
return
|
|
59195
|
+
return compilerOptions.noUncheckedIndexedAccess ?
|
|
59399
59196
|
getUnionType([type, undefinedType]) :
|
|
59400
59197
|
type;
|
|
59401
59198
|
}
|
|
@@ -59816,7 +59613,7 @@ var ts;
|
|
|
59816
59613
|
}
|
|
59817
59614
|
function reportFlowControlError(node) {
|
|
59818
59615
|
var block = ts.findAncestor(node, ts.isFunctionOrModuleBlock);
|
|
59819
|
-
var sourceFile = getSourceFileOfNode(node);
|
|
59616
|
+
var sourceFile = ts.getSourceFileOfNode(node);
|
|
59820
59617
|
var span = ts.getSpanOfTokenAtPosition(sourceFile, block.statements.pos);
|
|
59821
59618
|
diagnostics.add(ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.The_containing_function_or_module_body_is_too_large_for_control_flow_analysis));
|
|
59822
59619
|
}
|
|
@@ -59962,7 +59759,7 @@ var ts;
|
|
|
59962
59759
|
var evolvedType = getTypeFromFlowType(getTypeAtFlowNode(flowNode));
|
|
59963
59760
|
sharedFlowCount = sharedFlowStart;
|
|
59964
59761
|
var resultType = ts.getObjectFlags(evolvedType) & 256 && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType);
|
|
59965
|
-
if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 231 && !(resultType.flags & 131072) && getTypeWithFacts(resultType, 2097152
|
|
59762
|
+
if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 231 && !(resultType.flags & 131072) && getTypeWithFacts(resultType, 2097152).flags & 131072) {
|
|
59966
59763
|
return declaredType;
|
|
59967
59764
|
}
|
|
59968
59765
|
return resultType === nonNullUnknownType ? unknownType : resultType;
|
|
@@ -60101,7 +59898,7 @@ var ts;
|
|
|
60101
59898
|
return declaredType;
|
|
60102
59899
|
}
|
|
60103
59900
|
if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 245 && isMatchingReference(reference, node.parent.parent.expression)) {
|
|
60104
|
-
return getNonNullableTypeIfNeeded(finalizeEvolvingArrayType(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent)))
|
|
59901
|
+
return getNonNullableTypeIfNeeded(finalizeEvolvingArrayType(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent))));
|
|
60105
59902
|
}
|
|
60106
59903
|
return undefined;
|
|
60107
59904
|
}
|
|
@@ -60193,7 +59990,7 @@ var ts;
|
|
|
60193
59990
|
type = narrowBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
|
|
60194
59991
|
}
|
|
60195
59992
|
else {
|
|
60196
|
-
if (strictNullChecks
|
|
59993
|
+
if (strictNullChecks) {
|
|
60197
59994
|
if (optionalChainContainsReference(expr, reference)) {
|
|
60198
59995
|
type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & (32768 | 131072)); });
|
|
60199
59996
|
}
|
|
@@ -60306,30 +60103,11 @@ var ts;
|
|
|
60306
60103
|
cache.set(key, result);
|
|
60307
60104
|
return result;
|
|
60308
60105
|
}
|
|
60309
|
-
function filterNullAndUndefinedFromUnionIfNotStrict(type) {
|
|
60310
|
-
if (strictNullChecks(reference)) {
|
|
60311
|
-
return type;
|
|
60312
|
-
}
|
|
60313
|
-
if (!(type.flags & 1048576)) {
|
|
60314
|
-
return type;
|
|
60315
|
-
}
|
|
60316
|
-
var containedNull;
|
|
60317
|
-
var filtered = filterType(type, function (t) {
|
|
60318
|
-
if (t.flags & 65536) {
|
|
60319
|
-
containedNull = t;
|
|
60320
|
-
}
|
|
60321
|
-
return !(t.flags & 98304);
|
|
60322
|
-
});
|
|
60323
|
-
if (!(filtered.flags & 131072)) {
|
|
60324
|
-
return filtered;
|
|
60325
|
-
}
|
|
60326
|
-
return containedNull || type;
|
|
60327
|
-
}
|
|
60328
60106
|
function getUnionOrEvolvingArrayType(types, subtypeReduction) {
|
|
60329
60107
|
if (isEvolvingArrayTypeList(types)) {
|
|
60330
60108
|
return getEvolvingArrayType(getUnionType(ts.map(types, getElementTypeOfEvolvingArrayType)));
|
|
60331
60109
|
}
|
|
60332
|
-
var result =
|
|
60110
|
+
var result = recombineUnknownType(getUnionType(ts.sameMap(types, finalizeEvolvingArrayType), subtypeReduction));
|
|
60333
60111
|
if (result !== declaredType && result.flags & declaredType.flags & 1048576 && ts.arraysEqual(result.types, declaredType.types)) {
|
|
60334
60112
|
return declaredType;
|
|
60335
60113
|
}
|
|
@@ -60387,16 +60165,16 @@ var ts;
|
|
|
60387
60165
|
if (propName === undefined) {
|
|
60388
60166
|
return type;
|
|
60389
60167
|
}
|
|
60390
|
-
var removeNullable = strictNullChecks
|
|
60391
|
-
var propType = getTypeOfPropertyOfType(removeNullable ? getTypeWithFacts(type, 2097152
|
|
60168
|
+
var removeNullable = strictNullChecks && ts.isOptionalChain(access) && maybeTypeOfKind(type, 98304);
|
|
60169
|
+
var propType = getTypeOfPropertyOfType(removeNullable ? getTypeWithFacts(type, 2097152) : type, propName);
|
|
60392
60170
|
if (!propType) {
|
|
60393
60171
|
return type;
|
|
60394
60172
|
}
|
|
60395
|
-
propType = removeNullable ? getOptionalType(propType
|
|
60173
|
+
propType = removeNullable ? getOptionalType(propType) : propType;
|
|
60396
60174
|
var narrowedPropType = narrowType(propType);
|
|
60397
60175
|
return filterType(type, function (t) {
|
|
60398
60176
|
var discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
|
|
60399
|
-
return !(narrowedPropType.flags & 131072) &&
|
|
60177
|
+
return !(narrowedPropType.flags & 131072) && areTypesComparable(narrowedPropType, discriminantType);
|
|
60400
60178
|
});
|
|
60401
60179
|
}
|
|
60402
60180
|
function narrowTypeByDiscriminantProperty(type, access, operator, value, assumeTrue) {
|
|
@@ -60425,14 +60203,14 @@ var ts;
|
|
|
60425
60203
|
}
|
|
60426
60204
|
function narrowTypeByTruthiness(type, expr, assumeTrue) {
|
|
60427
60205
|
if (isMatchingReference(reference, expr)) {
|
|
60428
|
-
return getAdjustedTypeWithFacts(type, assumeTrue ? 4194304 : 8388608
|
|
60206
|
+
return getAdjustedTypeWithFacts(type, assumeTrue ? 4194304 : 8388608);
|
|
60429
60207
|
}
|
|
60430
|
-
if (strictNullChecks
|
|
60431
|
-
type = getAdjustedTypeWithFacts(type, 2097152
|
|
60208
|
+
if (strictNullChecks && assumeTrue && optionalChainContainsReference(expr, reference)) {
|
|
60209
|
+
type = getAdjustedTypeWithFacts(type, 2097152);
|
|
60432
60210
|
}
|
|
60433
60211
|
var access = getDiscriminantPropertyAccess(expr, type);
|
|
60434
60212
|
if (access) {
|
|
60435
|
-
return narrowTypeByDiscriminant(type, access, function (t) { return getTypeWithFacts(t, assumeTrue ? 4194304 : 8388608
|
|
60213
|
+
return narrowTypeByDiscriminant(type, access, function (t) { return getTypeWithFacts(t, assumeTrue ? 4194304 : 8388608); });
|
|
60436
60214
|
}
|
|
60437
60215
|
return type;
|
|
60438
60216
|
}
|
|
@@ -60478,7 +60256,7 @@ var ts;
|
|
|
60478
60256
|
if (isMatchingReference(reference, right)) {
|
|
60479
60257
|
return narrowTypeByEquality(type, operator, left, assumeTrue);
|
|
60480
60258
|
}
|
|
60481
|
-
if (strictNullChecks
|
|
60259
|
+
if (strictNullChecks) {
|
|
60482
60260
|
if (optionalChainContainsReference(left, reference)) {
|
|
60483
60261
|
type = narrowTypeByOptionalChainContainment(type, operator, right, assumeTrue);
|
|
60484
60262
|
}
|
|
@@ -60513,7 +60291,7 @@ var ts;
|
|
|
60513
60291
|
var name = ts.escapeLeadingUnderscores(leftType.value);
|
|
60514
60292
|
if (containsMissingType(type) && ts.isAccessExpression(reference) && isMatchingReference(reference.expression, target) &&
|
|
60515
60293
|
getAccessedPropertyName(reference) === name) {
|
|
60516
|
-
return getTypeWithFacts(type, assumeTrue ? 524288 : 65536
|
|
60294
|
+
return getTypeWithFacts(type, assumeTrue ? 524288 : 65536);
|
|
60517
60295
|
}
|
|
60518
60296
|
if (isMatchingReference(reference, target)) {
|
|
60519
60297
|
return narrowByInKeyword(type, name, assumeTrue);
|
|
@@ -60555,7 +60333,7 @@ var ts;
|
|
|
60555
60333
|
var valueType = getTypeOfExpression(value);
|
|
60556
60334
|
var removeNullable = equalsOperator !== assumeTrue && everyType(valueType, function (t) { return !!(t.flags & nullableFlags); }) ||
|
|
60557
60335
|
equalsOperator === assumeTrue && everyType(valueType, function (t) { return !(t.flags & (3 | nullableFlags)); });
|
|
60558
|
-
return removeNullable ? getAdjustedTypeWithFacts(type, 2097152
|
|
60336
|
+
return removeNullable ? getAdjustedTypeWithFacts(type, 2097152) : type;
|
|
60559
60337
|
}
|
|
60560
60338
|
function narrowTypeByEquality(type, operator, value, assumeTrue) {
|
|
60561
60339
|
if (type.flags & 1) {
|
|
@@ -60575,7 +60353,7 @@ var ts;
|
|
|
60575
60353
|
return type;
|
|
60576
60354
|
}
|
|
60577
60355
|
if (valueType.flags & 98304) {
|
|
60578
|
-
if (!strictNullChecks
|
|
60356
|
+
if (!strictNullChecks) {
|
|
60579
60357
|
return type;
|
|
60580
60358
|
}
|
|
60581
60359
|
var doubleEquals = operator === 34 || operator === 35;
|
|
@@ -60584,7 +60362,7 @@ var ts;
|
|
|
60584
60362
|
valueType.flags & 65536 ?
|
|
60585
60363
|
assumeTrue ? 131072 : 1048576 :
|
|
60586
60364
|
assumeTrue ? 65536 : 524288;
|
|
60587
|
-
return getAdjustedTypeWithFacts(type, facts
|
|
60365
|
+
return getAdjustedTypeWithFacts(type, facts);
|
|
60588
60366
|
}
|
|
60589
60367
|
if (assumeTrue) {
|
|
60590
60368
|
var filterFn = operator === 34 ?
|
|
@@ -60603,18 +60381,25 @@ var ts;
|
|
|
60603
60381
|
}
|
|
60604
60382
|
var target = getReferenceCandidate(typeOfExpr.expression);
|
|
60605
60383
|
if (!isMatchingReference(reference, target)) {
|
|
60606
|
-
|
|
60607
|
-
|
|
60384
|
+
var propertyAccess = getDiscriminantPropertyAccess(typeOfExpr.expression, type);
|
|
60385
|
+
if (propertyAccess) {
|
|
60386
|
+
return narrowTypeByDiscriminant(type, propertyAccess, function (t) { return narrowTypeByLiteralExpression(t, literal, assumeTrue); });
|
|
60387
|
+
}
|
|
60388
|
+
if (strictNullChecks && optionalChainContainsReference(target, reference) && assumeTrue === (literal.text !== "undefined")) {
|
|
60389
|
+
return getAdjustedTypeWithFacts(type, 2097152);
|
|
60608
60390
|
}
|
|
60609
60391
|
return type;
|
|
60610
60392
|
}
|
|
60393
|
+
return narrowTypeByLiteralExpression(type, literal, assumeTrue);
|
|
60394
|
+
}
|
|
60395
|
+
function narrowTypeByLiteralExpression(type, literal, assumeTrue) {
|
|
60611
60396
|
return assumeTrue ?
|
|
60612
60397
|
narrowTypeByTypeName(type, literal.text) :
|
|
60613
|
-
getTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768
|
|
60398
|
+
getTypeWithFacts(type, typeofNEFacts.get(literal.text) || 32768);
|
|
60614
60399
|
}
|
|
60615
60400
|
function narrowTypeBySwitchOptionalChainContainment(type, switchStatement, clauseStart, clauseEnd, clauseCheck) {
|
|
60616
60401
|
var everyClauseChecks = clauseStart !== clauseEnd && ts.every(getSwitchClauseTypes(switchStatement).slice(clauseStart, clauseEnd), clauseCheck);
|
|
60617
|
-
return everyClauseChecks ? getTypeWithFacts(type, 2097152
|
|
60402
|
+
return everyClauseChecks ? getTypeWithFacts(type, 2097152) : type;
|
|
60618
60403
|
}
|
|
60619
60404
|
function narrowTypeBySwitchOnDiscriminant(type, switchStatement, clauseStart, clauseEnd) {
|
|
60620
60405
|
var switchTypes = getSwitchClauseTypes(switchStatement);
|
|
@@ -60668,9 +60453,9 @@ var ts;
|
|
|
60668
60453
|
}
|
|
60669
60454
|
function narrowTypeByTypeFacts(type, impliedType, facts) {
|
|
60670
60455
|
return mapType(type, function (t) {
|
|
60671
|
-
return isTypeRelatedTo(t, impliedType, strictSubtypeRelation) ? getTypeFacts(t
|
|
60456
|
+
return isTypeRelatedTo(t, impliedType, strictSubtypeRelation) ? getTypeFacts(t) & facts ? t : neverType :
|
|
60672
60457
|
isTypeSubtypeOf(impliedType, t) ? impliedType :
|
|
60673
|
-
getTypeFacts(t
|
|
60458
|
+
getTypeFacts(t) & facts ? getIntersectionType([t, impliedType]) :
|
|
60674
60459
|
neverType;
|
|
60675
60460
|
});
|
|
60676
60461
|
}
|
|
@@ -60683,7 +60468,7 @@ var ts;
|
|
|
60683
60468
|
var hasDefaultClause = clauseStart === clauseEnd || (defaultIndex >= clauseStart && defaultIndex < clauseEnd);
|
|
60684
60469
|
if (hasDefaultClause) {
|
|
60685
60470
|
var notEqualFacts_1 = getNotEqualFactsFromTypeofSwitch(clauseStart, clauseEnd, witnesses);
|
|
60686
|
-
return filterType(type, function (t) { return (getTypeFacts(t
|
|
60471
|
+
return filterType(type, function (t) { return (getTypeFacts(t) & notEqualFacts_1) === notEqualFacts_1; });
|
|
60687
60472
|
}
|
|
60688
60473
|
var clauseWitnesses = witnesses.slice(clauseStart, clauseEnd);
|
|
60689
60474
|
return getUnionType(ts.map(clauseWitnesses, function (text) { return text ? narrowTypeByTypeName(type, text) : neverType; }));
|
|
@@ -60725,8 +60510,8 @@ var ts;
|
|
|
60725
60510
|
function narrowTypeByInstanceof(type, expr, assumeTrue) {
|
|
60726
60511
|
var left = getReferenceCandidate(expr.left);
|
|
60727
60512
|
if (!isMatchingReference(reference, left)) {
|
|
60728
|
-
if (assumeTrue && strictNullChecks
|
|
60729
|
-
return getAdjustedTypeWithFacts(type, 2097152
|
|
60513
|
+
if (assumeTrue && strictNullChecks && optionalChainContainsReference(left, reference)) {
|
|
60514
|
+
return getAdjustedTypeWithFacts(type, 2097152);
|
|
60730
60515
|
}
|
|
60731
60516
|
return type;
|
|
60732
60517
|
}
|
|
@@ -60802,7 +60587,7 @@ var ts;
|
|
|
60802
60587
|
ts.isIdentifier(callAccess.name) && callAccess.name.escapedText === "hasOwnProperty" && callExpression.arguments.length === 1) {
|
|
60803
60588
|
var argument = callExpression.arguments[0];
|
|
60804
60589
|
if (ts.isStringLiteralLike(argument) && getAccessedPropertyName(reference) === ts.escapeLeadingUnderscores(argument.text)) {
|
|
60805
|
-
return getTypeWithFacts(type, assumeTrue ? 524288 : 65536
|
|
60590
|
+
return getTypeWithFacts(type, assumeTrue ? 524288 : 65536);
|
|
60806
60591
|
}
|
|
60807
60592
|
}
|
|
60808
60593
|
}
|
|
@@ -60815,9 +60600,9 @@ var ts;
|
|
|
60815
60600
|
if (isMatchingReference(reference, predicateArgument)) {
|
|
60816
60601
|
return getNarrowedType(type, predicate.type, assumeTrue, false);
|
|
60817
60602
|
}
|
|
60818
|
-
if (strictNullChecks
|
|
60819
|
-
!(getTypeFacts(predicate.type
|
|
60820
|
-
type = getAdjustedTypeWithFacts(type, 2097152
|
|
60603
|
+
if (strictNullChecks && assumeTrue && optionalChainContainsReference(predicateArgument, reference) &&
|
|
60604
|
+
!(getTypeFacts(predicate.type) & 65536)) {
|
|
60605
|
+
type = getAdjustedTypeWithFacts(type, 2097152);
|
|
60821
60606
|
}
|
|
60822
60607
|
var access = getDiscriminantPropertyAccess(predicateArgument, type);
|
|
60823
60608
|
if (access) {
|
|
@@ -60868,11 +60653,11 @@ var ts;
|
|
|
60868
60653
|
}
|
|
60869
60654
|
function narrowTypeByOptionality(type, expr, assumePresent) {
|
|
60870
60655
|
if (isMatchingReference(reference, expr)) {
|
|
60871
|
-
return getAdjustedTypeWithFacts(type, assumePresent ? 2097152 : 262144
|
|
60656
|
+
return getAdjustedTypeWithFacts(type, assumePresent ? 2097152 : 262144);
|
|
60872
60657
|
}
|
|
60873
60658
|
var access = getDiscriminantPropertyAccess(expr, type);
|
|
60874
60659
|
if (access) {
|
|
60875
|
-
return narrowTypeByDiscriminant(type, access, function (t) { return getTypeWithFacts(t, assumePresent ? 2097152 : 262144
|
|
60660
|
+
return narrowTypeByDiscriminant(type, access, function (t) { return getTypeWithFacts(t, assumePresent ? 2097152 : 262144); });
|
|
60876
60661
|
}
|
|
60877
60662
|
return type;
|
|
60878
60663
|
}
|
|
@@ -60940,13 +60725,13 @@ var ts;
|
|
|
60940
60725
|
}
|
|
60941
60726
|
function removeOptionalityFromDeclaredType(declaredType, declaration) {
|
|
60942
60727
|
if (pushTypeResolution(declaration.symbol, 2)) {
|
|
60943
|
-
var annotationIncludesUndefined = strictNullChecks
|
|
60728
|
+
var annotationIncludesUndefined = strictNullChecks &&
|
|
60944
60729
|
declaration.kind === 165 &&
|
|
60945
60730
|
declaration.initializer &&
|
|
60946
|
-
getTypeFacts(declaredType
|
|
60947
|
-
!(getTypeFacts(checkExpression(declaration.initializer)
|
|
60731
|
+
getTypeFacts(declaredType) & 16777216 &&
|
|
60732
|
+
!(getTypeFacts(checkExpression(declaration.initializer)) & 16777216);
|
|
60948
60733
|
popTypeResolution();
|
|
60949
|
-
return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 524288
|
|
60734
|
+
return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 524288) : declaredType;
|
|
60950
60735
|
}
|
|
60951
60736
|
else {
|
|
60952
60737
|
reportCircularityError(declaration.symbol);
|
|
@@ -61062,18 +60847,6 @@ var ts;
|
|
|
61062
60847
|
if (symbol === unknownSymbol) {
|
|
61063
60848
|
return errorType;
|
|
61064
60849
|
}
|
|
61065
|
-
if (symbol === undefinedSymbol) {
|
|
61066
|
-
var assignmentKind_1 = ts.getAssignmentTargetKind(node);
|
|
61067
|
-
if (assignmentKind_1) {
|
|
61068
|
-
if (!(symbol.flags & 3) &&
|
|
61069
|
-
!(ts.isInJSFile(node) && symbol.flags & 512)) {
|
|
61070
|
-
var assignmentError = ts.Diagnostics.Cannot_assign_to_0_because_it_is_not_a_variable;
|
|
61071
|
-
error(node, assignmentError, symbolToString(symbol));
|
|
61072
|
-
return errorType;
|
|
61073
|
-
}
|
|
61074
|
-
}
|
|
61075
|
-
return getUndefinedWideningType(node);
|
|
61076
|
-
}
|
|
61077
60850
|
if (symbol === argumentsSymbol) {
|
|
61078
60851
|
if (isInPropertyInitializerOrClassStaticBlock(node)) {
|
|
61079
60852
|
error(node, ts.Diagnostics.arguments_cannot_be_referenced_in_property_initializers);
|
|
@@ -61180,18 +60953,18 @@ var ts;
|
|
|
61180
60953
|
flowContainer = getControlFlowContainer(flowContainer);
|
|
61181
60954
|
}
|
|
61182
60955
|
var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || ts.isBindingElement(declaration) ||
|
|
61183
|
-
type !== autoType && type !== autoArrayType && (!strictNullChecks
|
|
60956
|
+
type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 | 16384)) !== 0 ||
|
|
61184
60957
|
isInTypeQuery(node) || node.parent.kind === 277) ||
|
|
61185
60958
|
node.parent.kind === 231 ||
|
|
61186
60959
|
declaration.kind === 256 && declaration.exclamationToken ||
|
|
61187
60960
|
declaration.flags & 16777216;
|
|
61188
60961
|
var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) :
|
|
61189
60962
|
type === autoType || type === autoArrayType ? undefinedType :
|
|
61190
|
-
getOptionalType(type
|
|
60963
|
+
getOptionalType(type);
|
|
61191
60964
|
var flowType = getFlowTypeOfReference(node, type, initialType, flowContainer);
|
|
61192
60965
|
if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) {
|
|
61193
60966
|
if (flowType === autoType || flowType === autoArrayType) {
|
|
61194
|
-
if (noImplicitAny
|
|
60967
|
+
if (noImplicitAny) {
|
|
61195
60968
|
error(ts.getNameOfDeclaration(declaration), ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined, symbolToString(symbol), typeToString(flowType));
|
|
61196
60969
|
error(node, ts.Diagnostics.Variable_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(flowType));
|
|
61197
60970
|
}
|
|
@@ -61365,7 +61138,7 @@ var ts;
|
|
|
61365
61138
|
captureLexicalThis(node, container);
|
|
61366
61139
|
}
|
|
61367
61140
|
var type = tryGetThisTypeAt(node, true, container);
|
|
61368
|
-
if (noImplicitThis
|
|
61141
|
+
if (noImplicitThis) {
|
|
61369
61142
|
var globalThisType_1 = getTypeOfSymbol(globalThisSymbol);
|
|
61370
61143
|
if (type === globalThisType_1 && capturedByArrowFunction) {
|
|
61371
61144
|
error(node, ts.Diagnostics.The_containing_arrow_function_captures_the_global_value_of_this);
|
|
@@ -61642,7 +61415,7 @@ var ts;
|
|
|
61642
61415
|
}
|
|
61643
61416
|
}
|
|
61644
61417
|
var inJs = ts.isInJSFile(func);
|
|
61645
|
-
if (noImplicitThis
|
|
61418
|
+
if (noImplicitThis || inJs) {
|
|
61646
61419
|
var containingLiteral = getContainingObjectLiteral(func);
|
|
61647
61420
|
if (containingLiteral) {
|
|
61648
61421
|
var contextualType = getApparentTypeOfContextualType(containingLiteral, undefined);
|
|
@@ -61659,7 +61432,7 @@ var ts;
|
|
|
61659
61432
|
literal = literal.parent.parent;
|
|
61660
61433
|
type = getApparentTypeOfContextualType(literal, undefined);
|
|
61661
61434
|
}
|
|
61662
|
-
return getWidenedType(contextualType ? getNonNullableType(contextualType
|
|
61435
|
+
return getWidenedType(contextualType ? getNonNullableType(contextualType) : checkExpressionCached(containingLiteral));
|
|
61663
61436
|
}
|
|
61664
61437
|
var parent = ts.walkUpParenthesizedExpressions(func.parent);
|
|
61665
61438
|
if (parent.kind === 222 && parent.operatorToken.kind === 63) {
|
|
@@ -61667,7 +61440,7 @@ var ts;
|
|
|
61667
61440
|
if (ts.isAccessExpression(target)) {
|
|
61668
61441
|
var expression = target.expression;
|
|
61669
61442
|
if (inJs && ts.isIdentifier(expression)) {
|
|
61670
|
-
var sourceFile = getSourceFileOfNode(parent);
|
|
61443
|
+
var sourceFile = ts.getSourceFileOfNode(parent);
|
|
61671
61444
|
if (sourceFile.commonJsModuleIndicator && getResolvedSymbol(expression) === sourceFile.symbol) {
|
|
61672
61445
|
return undefined;
|
|
61673
61446
|
}
|
|
@@ -61695,7 +61468,7 @@ var ts;
|
|
|
61695
61468
|
links.resolvedSignature = anySignature;
|
|
61696
61469
|
var type = indexOfParameter < args.length ?
|
|
61697
61470
|
getWidenedLiteralType(checkExpression(args[indexOfParameter])) :
|
|
61698
|
-
parameter.initializer ? undefined :
|
|
61471
|
+
parameter.initializer ? undefined : undefinedWideningType;
|
|
61699
61472
|
links.resolvedSignature = cached;
|
|
61700
61473
|
return type;
|
|
61701
61474
|
}
|
|
@@ -62381,7 +62154,7 @@ var ts;
|
|
|
62381
62154
|
}
|
|
62382
62155
|
}
|
|
62383
62156
|
function getIntersectedSignatures(signatures) {
|
|
62384
|
-
return ts.
|
|
62157
|
+
return ts.getStrictOptionValue(compilerOptions, "noImplicitAny")
|
|
62385
62158
|
? ts.reduceLeft(signatures, function (left, right) {
|
|
62386
62159
|
return left === right || !left ? left
|
|
62387
62160
|
: compareTypeParametersIdentical(left.typeParameters, right.typeParameters) ? combineSignaturesOfIntersectionMembers(left, right)
|
|
@@ -62558,7 +62331,7 @@ var ts;
|
|
|
62558
62331
|
elementFlags.push(4);
|
|
62559
62332
|
}
|
|
62560
62333
|
}
|
|
62561
|
-
else if (exactOptionalPropertyTypes
|
|
62334
|
+
else if (exactOptionalPropertyTypes && e.kind === 228) {
|
|
62562
62335
|
hasOmittedExpression = true;
|
|
62563
62336
|
elementTypes.push(missingType);
|
|
62564
62337
|
elementFlags.push(2);
|
|
@@ -62566,7 +62339,7 @@ var ts;
|
|
|
62566
62339
|
else {
|
|
62567
62340
|
var elementContextualType = getContextualTypeForElementExpression(contextualType, elementTypes.length);
|
|
62568
62341
|
var type = checkExpressionForMutableLocation(e, checkMode, elementContextualType, forceTuple);
|
|
62569
|
-
elementTypes.push(addOptionality(type,
|
|
62342
|
+
elementTypes.push(addOptionality(type, true, hasOmittedExpression));
|
|
62570
62343
|
elementFlags.push(hasOmittedExpression ? 2 : 1);
|
|
62571
62344
|
if (contextualType && someType(contextualType, isTupleLikeType) && checkMode && checkMode & 2 && !(checkMode & 4) && isContextSensitive(e)) {
|
|
62572
62345
|
var inferenceContext = getInferenceContext(node);
|
|
@@ -62583,7 +62356,7 @@ var ts;
|
|
|
62583
62356
|
}
|
|
62584
62357
|
return createArrayLiteralType(createArrayType(elementTypes.length ?
|
|
62585
62358
|
getUnionType(ts.sameMap(elementTypes, function (t, i) { return elementFlags[i] & 8 ? getIndexedAccessTypeOrUndefined(t, numberType) || anyType : t; }), 2) :
|
|
62586
|
-
strictNullChecks
|
|
62359
|
+
strictNullChecks ? implicitNeverType : undefinedWideningType, inConstContext));
|
|
62587
62360
|
}
|
|
62588
62361
|
function createArrayLiteralType(type) {
|
|
62589
62362
|
if (!(ts.getObjectFlags(type) & 4)) {
|
|
@@ -62676,7 +62449,7 @@ var ts;
|
|
|
62676
62449
|
function checkObjectLiteral(node, checkMode) {
|
|
62677
62450
|
var inDestructuringPattern = ts.isAssignmentTarget(node);
|
|
62678
62451
|
checkGrammarObjectLiteralExpression(node, inDestructuringPattern);
|
|
62679
|
-
var allPropertiesTable = strictNullChecks
|
|
62452
|
+
var allPropertiesTable = strictNullChecks ? ts.createSymbolTable() : undefined;
|
|
62680
62453
|
var propertiesTable = ts.createSymbolTable();
|
|
62681
62454
|
var propertiesArray = [];
|
|
62682
62455
|
var spread = emptyObjectType;
|
|
@@ -62775,7 +62548,7 @@ var ts;
|
|
|
62775
62548
|
hasComputedSymbolProperty = false;
|
|
62776
62549
|
}
|
|
62777
62550
|
var type = getReducedType(checkExpression(memberDecl.expression));
|
|
62778
|
-
if (isValidSpreadType(type
|
|
62551
|
+
if (isValidSpreadType(type)) {
|
|
62779
62552
|
var mergedType = tryMergeUnionOfObjectTypeAndEmptyObject(type, inConstContext);
|
|
62780
62553
|
if (allPropertiesTable) {
|
|
62781
62554
|
checkSpreadPropOverrides(mergedType, allPropertiesTable, memberDecl);
|
|
@@ -62876,10 +62649,10 @@ var ts;
|
|
|
62876
62649
|
return result;
|
|
62877
62650
|
}
|
|
62878
62651
|
}
|
|
62879
|
-
function isValidSpreadType(type
|
|
62880
|
-
var t = removeDefinitelyFalsyTypes(mapType(type, getBaseConstraintOrType)
|
|
62652
|
+
function isValidSpreadType(type) {
|
|
62653
|
+
var t = removeDefinitelyFalsyTypes(mapType(type, getBaseConstraintOrType));
|
|
62881
62654
|
return !!(t.flags & (1 | 67108864 | 524288 | 58982400) ||
|
|
62882
|
-
t.flags & 3145728 && ts.every(t.types,
|
|
62655
|
+
t.flags & 3145728 && ts.every(t.types, isValidSpreadType));
|
|
62883
62656
|
}
|
|
62884
62657
|
function checkJsxSelfClosingElementDeferred(node) {
|
|
62885
62658
|
checkJsxOpeningLikeElementOrOpeningFragment(node);
|
|
@@ -62904,7 +62677,7 @@ var ts;
|
|
|
62904
62677
|
}
|
|
62905
62678
|
function checkJsxFragment(node) {
|
|
62906
62679
|
checkJsxOpeningLikeElementOrOpeningFragment(node.openingFragment);
|
|
62907
|
-
var nodeSourceFile = getSourceFileOfNode(node);
|
|
62680
|
+
var nodeSourceFile = ts.getSourceFileOfNode(node);
|
|
62908
62681
|
if (ts.getJSXTransformEnabled(compilerOptions) && (compilerOptions.jsxFactory || nodeSourceFile.pragmas.has("jsx"))
|
|
62909
62682
|
&& !compilerOptions.jsxFragmentFactory && !nodeSourceFile.pragmas.has("jsxfrag")) {
|
|
62910
62683
|
error(node, compilerOptions.jsxFactory
|
|
@@ -62927,7 +62700,7 @@ var ts;
|
|
|
62927
62700
|
}
|
|
62928
62701
|
function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) {
|
|
62929
62702
|
var attributes = openingLikeElement.attributes;
|
|
62930
|
-
var allAttributesTable = strictNullChecks
|
|
62703
|
+
var allAttributesTable = strictNullChecks ? ts.createSymbolTable() : undefined;
|
|
62931
62704
|
var attributesTable = ts.createSymbolTable();
|
|
62932
62705
|
var spread = emptyJsxObjectType;
|
|
62933
62706
|
var hasSpreadAnyType = false;
|
|
@@ -62965,7 +62738,7 @@ var ts;
|
|
|
62965
62738
|
if (isTypeAny(exprType)) {
|
|
62966
62739
|
hasSpreadAnyType = true;
|
|
62967
62740
|
}
|
|
62968
|
-
if (isValidSpreadType(exprType
|
|
62741
|
+
if (isValidSpreadType(exprType)) {
|
|
62969
62742
|
spread = getSpreadType(spread, exprType, attributes.symbol, objectFlags, false);
|
|
62970
62743
|
if (allAttributesTable) {
|
|
62971
62744
|
checkSpreadPropOverrides(exprType, allAttributesTable, attributeDecl);
|
|
@@ -63077,7 +62850,7 @@ var ts;
|
|
|
63077
62850
|
return links.resolvedSymbol = unknownSymbol;
|
|
63078
62851
|
}
|
|
63079
62852
|
else {
|
|
63080
|
-
if (noImplicitAny
|
|
62853
|
+
if (noImplicitAny) {
|
|
63081
62854
|
error(node, ts.Diagnostics.JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists, ts.unescapeLeadingUnderscores(JsxNames.IntrinsicElements));
|
|
63082
62855
|
}
|
|
63083
62856
|
return links.resolvedSymbol = unknownSymbol;
|
|
@@ -63086,7 +62859,7 @@ var ts;
|
|
|
63086
62859
|
return links.resolvedSymbol;
|
|
63087
62860
|
}
|
|
63088
62861
|
function getJsxNamespaceContainerForImplicitImport(location) {
|
|
63089
|
-
var file = location && getSourceFileOfNode(location);
|
|
62862
|
+
var file = location && ts.getSourceFileOfNode(location);
|
|
63090
62863
|
var links = file && getNodeLinks(file);
|
|
63091
62864
|
if (links && links.jsxImplicitImportContainer === false) {
|
|
63092
62865
|
return undefined;
|
|
@@ -63275,7 +63048,7 @@ var ts;
|
|
|
63275
63048
|
error(errorNode, ts.Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided);
|
|
63276
63049
|
}
|
|
63277
63050
|
if (getJsxElementTypeAt(errorNode) === undefined) {
|
|
63278
|
-
if (noImplicitAny
|
|
63051
|
+
if (noImplicitAny) {
|
|
63279
63052
|
error(errorNode, ts.Diagnostics.JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist);
|
|
63280
63053
|
}
|
|
63281
63054
|
}
|
|
@@ -63301,7 +63074,7 @@ var ts;
|
|
|
63301
63074
|
}
|
|
63302
63075
|
}
|
|
63303
63076
|
if (ts.isJsxOpeningFragment(node)) {
|
|
63304
|
-
var file = getSourceFileOfNode(node);
|
|
63077
|
+
var file = ts.getSourceFileOfNode(node);
|
|
63305
63078
|
var localJsxNamespace = getLocalJsxNamespace(file);
|
|
63306
63079
|
if (localJsxNamespace) {
|
|
63307
63080
|
resolveName(jsxFactoryLocation, localJsxNamespace, 111551, jsxFactoryRefErr, localJsxNamespace, true);
|
|
@@ -63467,11 +63240,11 @@ var ts;
|
|
|
63467
63240
|
function checkNonNullExpression(node) {
|
|
63468
63241
|
return checkNonNullType(checkExpression(node), node);
|
|
63469
63242
|
}
|
|
63470
|
-
function isNullableType(type
|
|
63471
|
-
return !!(getTypeFacts(type
|
|
63243
|
+
function isNullableType(type) {
|
|
63244
|
+
return !!(getTypeFacts(type) & 50331648);
|
|
63472
63245
|
}
|
|
63473
|
-
function getNonNullableTypeIfNeeded(type
|
|
63474
|
-
return isNullableType(type
|
|
63246
|
+
function getNonNullableTypeIfNeeded(type) {
|
|
63247
|
+
return isNullableType(type) ? getNonNullableType(type) : type;
|
|
63475
63248
|
}
|
|
63476
63249
|
function reportObjectPossiblyNullOrUndefinedError(node, facts) {
|
|
63477
63250
|
error(node, facts & 16777216 ? facts & 33554432 ?
|
|
@@ -63486,16 +63259,14 @@ var ts;
|
|
|
63486
63259
|
ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null);
|
|
63487
63260
|
}
|
|
63488
63261
|
function checkNonNullTypeWithReporter(type, node, reportError) {
|
|
63489
|
-
if (strictNullChecks
|
|
63262
|
+
if (strictNullChecks && type.flags & 2) {
|
|
63490
63263
|
error(node, ts.Diagnostics.Object_is_of_type_unknown);
|
|
63491
63264
|
return errorType;
|
|
63492
63265
|
}
|
|
63493
|
-
var facts = getTypeFacts(type
|
|
63266
|
+
var facts = getTypeFacts(type);
|
|
63494
63267
|
if (facts & 50331648) {
|
|
63495
|
-
|
|
63496
|
-
|
|
63497
|
-
}
|
|
63498
|
-
var t = getNonNullableType(type, node);
|
|
63268
|
+
reportError(node, facts);
|
|
63269
|
+
var t = getNonNullableType(type);
|
|
63499
63270
|
return t.flags & (98304 | 131072) ? errorType : t;
|
|
63500
63271
|
}
|
|
63501
63272
|
return type;
|
|
@@ -63614,9 +63385,6 @@ var ts;
|
|
|
63614
63385
|
var parentSymbol = getNodeLinks(left).resolvedSymbol;
|
|
63615
63386
|
var assignmentKind = ts.getAssignmentTargetKind(node);
|
|
63616
63387
|
var apparentType = getApparentType(assignmentKind !== 0 || isMethodAccessForCall(node) ? getWidenedType(leftType) : leftType);
|
|
63617
|
-
if (!strictNullChecks(node) && apparentType.flags & 2) {
|
|
63618
|
-
apparentType = emptyObjectType;
|
|
63619
|
-
}
|
|
63620
63388
|
var isAnyLike = isTypeAny(apparentType) || apparentType === silentNeverType;
|
|
63621
63389
|
var prop;
|
|
63622
63390
|
if (ts.isPrivateIdentifier(right)) {
|
|
@@ -63672,14 +63440,14 @@ var ts;
|
|
|
63672
63440
|
getApplicableIndexInfoForName(apparentType, right.escapedText) : undefined;
|
|
63673
63441
|
if (!(indexInfo && indexInfo.type)) {
|
|
63674
63442
|
var isUncheckedJS = isUncheckedJSSuggestion(node, leftType.symbol, true);
|
|
63675
|
-
if (!isUncheckedJS && isJSLiteralType(leftType
|
|
63443
|
+
if (!isUncheckedJS && isJSLiteralType(leftType)) {
|
|
63676
63444
|
return anyType;
|
|
63677
63445
|
}
|
|
63678
63446
|
if (leftType.symbol === globalThisSymbol) {
|
|
63679
63447
|
if (globalThisSymbol.exports.has(right.escapedText) && (globalThisSymbol.exports.get(right.escapedText).flags & 418)) {
|
|
63680
63448
|
error(right, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.unescapeLeadingUnderscores(right.escapedText), typeToString(leftType));
|
|
63681
63449
|
}
|
|
63682
|
-
else if (noImplicitAny
|
|
63450
|
+
else if (noImplicitAny) {
|
|
63683
63451
|
error(right, ts.Diagnostics.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature, typeToString(leftType));
|
|
63684
63452
|
}
|
|
63685
63453
|
return anyType;
|
|
@@ -63692,8 +63460,8 @@ var ts;
|
|
|
63692
63460
|
if (indexInfo.isReadonly && (ts.isAssignmentTarget(node) || ts.isDeleteTarget(node))) {
|
|
63693
63461
|
error(node, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType));
|
|
63694
63462
|
}
|
|
63695
|
-
propType = (
|
|
63696
|
-
if (
|
|
63463
|
+
propType = (compilerOptions.noUncheckedIndexedAccess && !ts.isAssignmentTarget(node)) ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;
|
|
63464
|
+
if (compilerOptions.noPropertyAccessFromIndexSignature && ts.isPropertyAccessExpression(node)) {
|
|
63697
63465
|
error(right, ts.Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0, ts.unescapeLeadingUnderscores(right.escapedText));
|
|
63698
63466
|
}
|
|
63699
63467
|
if (indexInfo.declaration && ts.getCombinedNodeFlags(indexInfo.declaration) & 268435456) {
|
|
@@ -63718,10 +63486,10 @@ var ts;
|
|
|
63718
63486
|
return getFlowTypeOfAccessExpression(node, prop, propType, right, checkMode);
|
|
63719
63487
|
}
|
|
63720
63488
|
function isUncheckedJSSuggestion(node, suggestion, excludeClasses) {
|
|
63721
|
-
var file = getSourceFileOfNode(node);
|
|
63489
|
+
var file = ts.getSourceFileOfNode(node);
|
|
63722
63490
|
if (file) {
|
|
63723
63491
|
if (compilerOptions.checkJs === undefined && file.checkJsDirective === undefined && (file.scriptKind === 1 || file.scriptKind === 2)) {
|
|
63724
|
-
var declarationFile = ts.forEach(suggestion === null || suggestion === void 0 ? void 0 : suggestion.declarations, getSourceFileOfNode);
|
|
63492
|
+
var declarationFile = ts.forEach(suggestion === null || suggestion === void 0 ? void 0 : suggestion.declarations, ts.getSourceFileOfNode);
|
|
63725
63493
|
return !(file !== declarationFile && !!declarationFile && isGlobalSourceFile(declarationFile))
|
|
63726
63494
|
&& !(excludeClasses && suggestion && suggestion.flags & 32)
|
|
63727
63495
|
&& !(!!node && excludeClasses && ts.isPropertyAccessExpression(node) && node.expression.kind === 108);
|
|
@@ -63745,8 +63513,7 @@ var ts;
|
|
|
63745
63513
|
}
|
|
63746
63514
|
propType = getNarrowableTypeForReference(propType, node, checkMode);
|
|
63747
63515
|
var assumeUninitialized = false;
|
|
63748
|
-
|
|
63749
|
-
if (strictNullChecks(node) && strictPropertyInitialization(file) && ts.isAccessExpression(node) && node.expression.kind === 108) {
|
|
63516
|
+
if (strictNullChecks && strictPropertyInitialization && ts.isAccessExpression(node) && node.expression.kind === 108) {
|
|
63750
63517
|
var declaration = prop && prop.valueDeclaration;
|
|
63751
63518
|
if (declaration && isPropertyWithoutInitializer(declaration)) {
|
|
63752
63519
|
if (!ts.isStatic(declaration)) {
|
|
@@ -63757,13 +63524,13 @@ var ts;
|
|
|
63757
63524
|
}
|
|
63758
63525
|
}
|
|
63759
63526
|
}
|
|
63760
|
-
else if (strictNullChecks
|
|
63527
|
+
else if (strictNullChecks && prop && prop.valueDeclaration &&
|
|
63761
63528
|
ts.isPropertyAccessExpression(prop.valueDeclaration) &&
|
|
63762
63529
|
ts.getAssignmentDeclarationPropertyAccessKind(prop.valueDeclaration) &&
|
|
63763
63530
|
getControlFlowContainer(node) === getControlFlowContainer(prop.valueDeclaration)) {
|
|
63764
63531
|
assumeUninitialized = true;
|
|
63765
63532
|
}
|
|
63766
|
-
var flowType = getFlowTypeOfReference(node, propType, assumeUninitialized ? getOptionalType(propType
|
|
63533
|
+
var flowType = getFlowTypeOfReference(node, propType, assumeUninitialized ? getOptionalType(propType) : propType);
|
|
63767
63534
|
if (assumeUninitialized && !containsUndefinedType(propType) && containsUndefinedType(flowType)) {
|
|
63768
63535
|
error(errorNode, ts.Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(prop));
|
|
63769
63536
|
return propType;
|
|
@@ -63772,7 +63539,7 @@ var ts;
|
|
|
63772
63539
|
}
|
|
63773
63540
|
function checkPropertyNotUsedBeforeDeclaration(prop, node, right) {
|
|
63774
63541
|
var valueDeclaration = prop.valueDeclaration;
|
|
63775
|
-
if (!valueDeclaration || getSourceFileOfNode(node).isDeclarationFile) {
|
|
63542
|
+
if (!valueDeclaration || ts.getSourceFileOfNode(node).isDeclarationFile) {
|
|
63776
63543
|
return;
|
|
63777
63544
|
}
|
|
63778
63545
|
var diagnosticMessage;
|
|
@@ -64282,7 +64049,7 @@ var ts;
|
|
|
64282
64049
|
}
|
|
64283
64050
|
for (var i = argCount; i < effectiveMinimumArguments; i++) {
|
|
64284
64051
|
var type = getTypeAtPosition(signature, i);
|
|
64285
|
-
if (filterType(type, ts.isInJSFile(node) && !strictNullChecks
|
|
64052
|
+
if (filterType(type, ts.isInJSFile(node) && !strictNullChecks ? acceptsVoidUndefinedUnknownOrAny : acceptsVoid).flags & 131072) {
|
|
64286
64053
|
return false;
|
|
64287
64054
|
}
|
|
64288
64055
|
}
|
|
@@ -64341,7 +64108,7 @@ var ts;
|
|
|
64341
64108
|
return voidType;
|
|
64342
64109
|
}
|
|
64343
64110
|
var thisArgumentType = checkExpression(thisArgumentNode);
|
|
64344
|
-
return ts.isOptionalChainRoot(thisArgumentNode.parent) ? getNonNullableType(thisArgumentType
|
|
64111
|
+
return ts.isOptionalChainRoot(thisArgumentNode.parent) ? getNonNullableType(thisArgumentType) :
|
|
64345
64112
|
ts.isOptionalChain(thisArgumentNode.parent) ? removeOptionalTypeMarker(thisArgumentType) :
|
|
64346
64113
|
thisArgumentType;
|
|
64347
64114
|
}
|
|
@@ -64659,7 +64426,7 @@ var ts;
|
|
|
64659
64426
|
var spreadIndex = getSpreadArgumentIndex(args);
|
|
64660
64427
|
if (spreadIndex >= 0) {
|
|
64661
64428
|
var effectiveArgs_1 = args.slice(0, spreadIndex);
|
|
64662
|
-
var
|
|
64429
|
+
var _loop_26 = function (i) {
|
|
64663
64430
|
var arg = args[i];
|
|
64664
64431
|
var spreadType = arg.kind === 226 && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
|
|
64665
64432
|
if (spreadType && isTupleType(spreadType)) {
|
|
@@ -64675,7 +64442,7 @@ var ts;
|
|
|
64675
64442
|
}
|
|
64676
64443
|
};
|
|
64677
64444
|
for (var i = spreadIndex; i < args.length; i++) {
|
|
64678
|
-
|
|
64445
|
+
_loop_26(i);
|
|
64679
64446
|
}
|
|
64680
64447
|
return effectiveArgs_1;
|
|
64681
64448
|
}
|
|
@@ -64730,7 +64497,7 @@ var ts;
|
|
|
64730
64497
|
function getDiagnosticSpanForCallNode(node, doNotIncludeArguments) {
|
|
64731
64498
|
var start;
|
|
64732
64499
|
var length;
|
|
64733
|
-
var sourceFile = getSourceFileOfNode(node);
|
|
64500
|
+
var sourceFile = ts.getSourceFileOfNode(node);
|
|
64734
64501
|
if (ts.isPropertyAccessExpression(node.expression)) {
|
|
64735
64502
|
var nameSpan = ts.getErrorSpanForNode(sourceFile, node.expression.name);
|
|
64736
64503
|
start = nameSpan.start;
|
|
@@ -64826,7 +64593,7 @@ var ts;
|
|
|
64826
64593
|
end++;
|
|
64827
64594
|
}
|
|
64828
64595
|
ts.setTextRangePosEnd(errorSpan, pos, end);
|
|
64829
|
-
return ts.createDiagnosticForNodeArray(getSourceFileOfNode(node), errorSpan, error, parameterRange, args.length);
|
|
64596
|
+
return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), errorSpan, error, parameterRange, args.length);
|
|
64830
64597
|
}
|
|
64831
64598
|
}
|
|
64832
64599
|
function getTypeArgumentArityError(node, signatures, typeArguments) {
|
|
@@ -64835,7 +64602,7 @@ var ts;
|
|
|
64835
64602
|
var sig = signatures[0];
|
|
64836
64603
|
var min_1 = getMinTypeArgumentCount(sig.typeParameters);
|
|
64837
64604
|
var max = ts.length(sig.typeParameters);
|
|
64838
|
-
return ts.createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, min_1 < max ? min_1 + "-" + max : min_1, argCount);
|
|
64605
|
+
return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, min_1 < max ? min_1 + "-" + max : min_1, argCount);
|
|
64839
64606
|
}
|
|
64840
64607
|
var belowArgCount = -Infinity;
|
|
64841
64608
|
var aboveArgCount = Infinity;
|
|
@@ -64851,9 +64618,9 @@ var ts;
|
|
|
64851
64618
|
}
|
|
64852
64619
|
}
|
|
64853
64620
|
if (belowArgCount !== -Infinity && aboveArgCount !== Infinity) {
|
|
64854
|
-
return ts.createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, ts.Diagnostics.No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments, argCount, belowArgCount, aboveArgCount);
|
|
64621
|
+
return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments, argCount, belowArgCount, aboveArgCount);
|
|
64855
64622
|
}
|
|
64856
|
-
return ts.createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount);
|
|
64623
|
+
return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount);
|
|
64857
64624
|
}
|
|
64858
64625
|
function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) {
|
|
64859
64626
|
var isTaggedTemplate = node.kind === 211;
|
|
@@ -64925,7 +64692,7 @@ var ts;
|
|
|
64925
64692
|
var min_3 = Number.MAX_VALUE;
|
|
64926
64693
|
var minIndex = 0;
|
|
64927
64694
|
var i_1 = 0;
|
|
64928
|
-
var
|
|
64695
|
+
var _loop_27 = function (c) {
|
|
64929
64696
|
var chain_2 = function () { return ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Overload_0_of_1_2_gave_the_following_error, i_1 + 1, candidates.length, signatureToString(c)); };
|
|
64930
64697
|
var diags_2 = getSignatureApplicabilityError(node, args, c, assignableRelation, 0, true, chain_2);
|
|
64931
64698
|
if (diags_2) {
|
|
@@ -64943,7 +64710,7 @@ var ts;
|
|
|
64943
64710
|
};
|
|
64944
64711
|
for (var _a = 0, candidatesForArgumentError_1 = candidatesForArgumentError; _a < candidatesForArgumentError_1.length; _a++) {
|
|
64945
64712
|
var c = candidatesForArgumentError_1[_a];
|
|
64946
|
-
|
|
64713
|
+
_loop_27(c);
|
|
64947
64714
|
}
|
|
64948
64715
|
var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics);
|
|
64949
64716
|
ts.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures");
|
|
@@ -65086,7 +64853,7 @@ var ts;
|
|
|
65086
64853
|
}
|
|
65087
64854
|
var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max;
|
|
65088
64855
|
var parameters = [];
|
|
65089
|
-
var
|
|
64856
|
+
var _loop_28 = function (i) {
|
|
65090
64857
|
var symbols = ts.mapDefined(candidates, function (s) { return signatureHasRestParameter(s) ?
|
|
65091
64858
|
i < s.parameters.length - 1 ? s.parameters[i] : ts.last(s.parameters) :
|
|
65092
64859
|
i < s.parameters.length ? s.parameters[i] : undefined; });
|
|
@@ -65094,7 +64861,7 @@ var ts;
|
|
|
65094
64861
|
parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); })));
|
|
65095
64862
|
};
|
|
65096
64863
|
for (var i = 0; i < maxNonRestParam; i++) {
|
|
65097
|
-
|
|
64864
|
+
_loop_28(i);
|
|
65098
64865
|
}
|
|
65099
64866
|
var restParameterSymbols = ts.mapDefined(candidates, function (c) { return signatureHasRestParameter(c) ? ts.last(c.parameters) : undefined; });
|
|
65100
64867
|
var flags = 0;
|
|
@@ -65217,7 +64984,7 @@ var ts;
|
|
|
65217
64984
|
else {
|
|
65218
64985
|
var relatedInformation = void 0;
|
|
65219
64986
|
if (node.arguments.length === 1) {
|
|
65220
|
-
var text = getSourceFileOfNode(node).text;
|
|
64987
|
+
var text = ts.getSourceFileOfNode(node).text;
|
|
65221
64988
|
if (ts.isLineBreak(text.charCodeAt(ts.skipTrivia(text, node.expression.end, true) - 1))) {
|
|
65222
64989
|
relatedInformation = ts.createDiagnosticForNode(node.expression, ts.Diagnostics.Are_you_missing_a_semicolon);
|
|
65223
64990
|
}
|
|
@@ -65283,7 +65050,7 @@ var ts;
|
|
|
65283
65050
|
var callSignatures = getSignaturesOfType(expressionType, 0);
|
|
65284
65051
|
if (callSignatures.length) {
|
|
65285
65052
|
var signature = resolveCall(node, callSignatures, candidatesOutArray, checkMode, 0);
|
|
65286
|
-
if (!noImplicitAny
|
|
65053
|
+
if (!noImplicitAny) {
|
|
65287
65054
|
if (signature.declaration && !isJSConstructor(signature.declaration) && getReturnTypeOfSignature(signature) !== voidType) {
|
|
65288
65055
|
error(node, ts.Diagnostics.Only_a_void_function_can_be_called_with_the_new_keyword);
|
|
65289
65056
|
}
|
|
@@ -65533,7 +65300,7 @@ var ts;
|
|
|
65533
65300
|
checkTypeAssignableToAndOptionallyElaborate(checkExpressionWithContextualType(node.attributes, getEffectiveFirstArgumentForJsxSignature(fakeSignature, node), undefined, 0), result, node.tagName, node.attributes);
|
|
65534
65301
|
if (ts.length(node.typeArguments)) {
|
|
65535
65302
|
ts.forEach(node.typeArguments, checkSourceElement);
|
|
65536
|
-
diagnostics.add(ts.createDiagnosticForNodeArray(getSourceFileOfNode(node), node.typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, 0, ts.length(node.typeArguments)));
|
|
65303
|
+
diagnostics.add(ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), node.typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, 0, ts.length(node.typeArguments)));
|
|
65537
65304
|
}
|
|
65538
65305
|
return fakeSignature;
|
|
65539
65306
|
}
|
|
@@ -65709,7 +65476,7 @@ var ts;
|
|
|
65709
65476
|
declaration.kind !== 181 &&
|
|
65710
65477
|
!ts.isJSDocConstructSignature(declaration) &&
|
|
65711
65478
|
!isJSConstructor(declaration)) {
|
|
65712
|
-
if (noImplicitAny
|
|
65479
|
+
if (noImplicitAny) {
|
|
65713
65480
|
error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type);
|
|
65714
65481
|
}
|
|
65715
65482
|
return anyType;
|
|
@@ -65850,7 +65617,7 @@ var ts;
|
|
|
65850
65617
|
var anonymousSymbol = createSymbol(2048, "__type");
|
|
65851
65618
|
var defaultContainingObject = createDefaultPropertyWrapperForModule(symbol, originalSymbol, anonymousSymbol);
|
|
65852
65619
|
anonymousSymbol.type = defaultContainingObject;
|
|
65853
|
-
synthType.syntheticType = isValidSpreadType(type
|
|
65620
|
+
synthType.syntheticType = isValidSpreadType(type) ? getSpreadType(type, defaultContainingObject, anonymousSymbol, 0, false) : defaultContainingObject;
|
|
65854
65621
|
}
|
|
65855
65622
|
else {
|
|
65856
65623
|
synthType.syntheticType = type;
|
|
@@ -65896,7 +65663,7 @@ var ts;
|
|
|
65896
65663
|
}
|
|
65897
65664
|
function checkAssertion(node) {
|
|
65898
65665
|
if (node.kind === 212) {
|
|
65899
|
-
var file = getSourceFileOfNode(node);
|
|
65666
|
+
var file = ts.getSourceFileOfNode(node);
|
|
65900
65667
|
if (file && ts.fileExtensionIsOneOf(file.fileName, [".cts", ".mts"])) {
|
|
65901
65668
|
grammarErrorOnNode(node, ts.Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead);
|
|
65902
65669
|
}
|
|
@@ -65957,11 +65724,11 @@ var ts;
|
|
|
65957
65724
|
function checkNonNullChain(node) {
|
|
65958
65725
|
var leftType = checkExpression(node.expression);
|
|
65959
65726
|
var nonOptionalType = getOptionalExpressionType(leftType, node.expression);
|
|
65960
|
-
return propagateOptionalTypeMarker(getNonNullableType(nonOptionalType
|
|
65727
|
+
return propagateOptionalTypeMarker(getNonNullableType(nonOptionalType), node, nonOptionalType !== leftType);
|
|
65961
65728
|
}
|
|
65962
65729
|
function checkNonNullAssertion(node) {
|
|
65963
65730
|
return node.flags & 32 ? checkNonNullChain(node) :
|
|
65964
|
-
getNonNullableType(checkExpression(node.expression)
|
|
65731
|
+
getNonNullableType(checkExpression(node.expression));
|
|
65965
65732
|
}
|
|
65966
65733
|
function checkExpressionWithTypeArguments(node) {
|
|
65967
65734
|
checkGrammarExpressionWithTypeArguments(node);
|
|
@@ -65977,7 +65744,7 @@ var ts;
|
|
|
65977
65744
|
var result = getInstantiatedType(exprType);
|
|
65978
65745
|
var errorType = hasSomeApplicableSignature ? nonApplicableType : exprType;
|
|
65979
65746
|
if (errorType) {
|
|
65980
|
-
diagnostics.add(ts.createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable, typeToString(errorType)));
|
|
65747
|
+
diagnostics.add(ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable, typeToString(errorType)));
|
|
65981
65748
|
}
|
|
65982
65749
|
return result;
|
|
65983
65750
|
function getInstantiatedType(type) {
|
|
@@ -66077,23 +65844,23 @@ var ts;
|
|
|
66077
65844
|
}
|
|
66078
65845
|
function checkImportMetaProperty(node) {
|
|
66079
65846
|
if (moduleKind === ts.ModuleKind.Node16 || moduleKind === ts.ModuleKind.NodeNext) {
|
|
66080
|
-
if (getSourceFileOfNode(node).impliedNodeFormat !== ts.ModuleKind.ESNext) {
|
|
65847
|
+
if (ts.getSourceFileOfNode(node).impliedNodeFormat !== ts.ModuleKind.ESNext) {
|
|
66081
65848
|
error(node, ts.Diagnostics.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output);
|
|
66082
65849
|
}
|
|
66083
65850
|
}
|
|
66084
65851
|
else if (moduleKind < ts.ModuleKind.ES2020 && moduleKind !== ts.ModuleKind.System) {
|
|
66085
65852
|
error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext);
|
|
66086
65853
|
}
|
|
66087
|
-
var file = getSourceFileOfNode(node);
|
|
65854
|
+
var file = ts.getSourceFileOfNode(node);
|
|
66088
65855
|
ts.Debug.assert(!!(file.flags & 4194304), "Containing file is missing import meta node flag.");
|
|
66089
65856
|
return node.name.escapedText === "meta" ? getGlobalImportMetaType() : errorType;
|
|
66090
65857
|
}
|
|
66091
65858
|
function getTypeOfParameter(symbol) {
|
|
66092
65859
|
var type = getTypeOfSymbol(symbol);
|
|
66093
|
-
if (strictNullChecks
|
|
65860
|
+
if (strictNullChecks) {
|
|
66094
65861
|
var declaration = symbol.valueDeclaration;
|
|
66095
65862
|
if (declaration && ts.hasInitializer(declaration)) {
|
|
66096
|
-
return getOptionalType(type
|
|
65863
|
+
return getOptionalType(type);
|
|
66097
65864
|
}
|
|
66098
65865
|
}
|
|
66099
65866
|
return type;
|
|
@@ -66485,7 +66252,7 @@ var ts;
|
|
|
66485
66252
|
nextType = getWidenedType(nextType);
|
|
66486
66253
|
}
|
|
66487
66254
|
if (isGenerator) {
|
|
66488
|
-
return createGeneratorReturnType(yieldType || neverType, returnType || fallbackReturnType, nextType || getContextualIterationType(2, func) || unknownType, isAsync
|
|
66255
|
+
return createGeneratorReturnType(yieldType || neverType, returnType || fallbackReturnType, nextType || getContextualIterationType(2, func) || unknownType, isAsync);
|
|
66489
66256
|
}
|
|
66490
66257
|
else {
|
|
66491
66258
|
return isAsync
|
|
@@ -66493,7 +66260,7 @@ var ts;
|
|
|
66493
66260
|
: returnType || fallbackReturnType;
|
|
66494
66261
|
}
|
|
66495
66262
|
}
|
|
66496
|
-
function createGeneratorReturnType(yieldType, returnType, nextType, isAsyncGenerator
|
|
66263
|
+
function createGeneratorReturnType(yieldType, returnType, nextType, isAsyncGenerator) {
|
|
66497
66264
|
var resolver = isAsyncGenerator ? asyncIterationTypesResolver : syncIterationTypesResolver;
|
|
66498
66265
|
var globalGeneratorType = resolver.getGlobalGeneratorType(false);
|
|
66499
66266
|
yieldType = resolver.resolveIterationType(yieldType, undefined) || unknownType;
|
|
@@ -66503,7 +66270,7 @@ var ts;
|
|
|
66503
66270
|
var globalType = resolver.getGlobalIterableIteratorType(false);
|
|
66504
66271
|
var iterationTypes = globalType !== emptyGenericType ? getIterationTypesOfGlobalIterableType(globalType, resolver) : undefined;
|
|
66505
66272
|
var iterableIteratorReturnType = iterationTypes ? iterationTypes.returnType : anyType;
|
|
66506
|
-
var iterableIteratorNextType = iterationTypes ? iterationTypes.nextType :
|
|
66273
|
+
var iterableIteratorNextType = iterationTypes ? iterationTypes.nextType : undefinedType;
|
|
66507
66274
|
if (isTypeAssignableTo(returnType, iterableIteratorReturnType) &&
|
|
66508
66275
|
isTypeAssignableTo(iterableIteratorNextType, nextType)) {
|
|
66509
66276
|
if (globalType !== emptyGenericType) {
|
|
@@ -66522,7 +66289,7 @@ var ts;
|
|
|
66522
66289
|
var nextTypes = [];
|
|
66523
66290
|
var isAsync = (ts.getFunctionFlags(func) & 2) !== 0;
|
|
66524
66291
|
ts.forEachYieldExpression(func.body, function (yieldExpression) {
|
|
66525
|
-
var yieldExpressionType = yieldExpression.expression ? checkExpression(yieldExpression.expression, checkMode) :
|
|
66292
|
+
var yieldExpressionType = yieldExpression.expression ? checkExpression(yieldExpression.expression, checkMode) : undefinedWideningType;
|
|
66526
66293
|
ts.pushIfUnique(yieldTypes, getYieldedTypeOfYieldExpression(yieldExpression, yieldExpressionType, anyType, isAsync));
|
|
66527
66294
|
var nextType;
|
|
66528
66295
|
if (yieldExpression.asteriskToken) {
|
|
@@ -66567,7 +66334,7 @@ var ts;
|
|
|
66567
66334
|
if (operandConstraint.flags & 3) {
|
|
66568
66335
|
return (556800 & notEqualFacts_2) === 556800;
|
|
66569
66336
|
}
|
|
66570
|
-
return !someType(operandConstraint, function (t) { return (getTypeFacts(t
|
|
66337
|
+
return !someType(operandConstraint, function (t) { return (getTypeFacts(t) & notEqualFacts_2) === notEqualFacts_2; });
|
|
66571
66338
|
}
|
|
66572
66339
|
var type = getTypeOfExpression(node.expression);
|
|
66573
66340
|
if (!isLiteralType(type)) {
|
|
@@ -66606,7 +66373,7 @@ var ts;
|
|
|
66606
66373
|
if (aggregatedTypes.length === 0 && !hasReturnWithNoExpression && (hasReturnOfTypeNever || mayReturnNever(func))) {
|
|
66607
66374
|
return undefined;
|
|
66608
66375
|
}
|
|
66609
|
-
if (strictNullChecks
|
|
66376
|
+
if (strictNullChecks && aggregatedTypes.length && hasReturnWithNoExpression &&
|
|
66610
66377
|
!(isJSConstructor(func) && aggregatedTypes.some(function (t) { return t.symbol === func.symbol; }))) {
|
|
66611
66378
|
ts.pushIfUnique(aggregatedTypes, undefinedType);
|
|
66612
66379
|
}
|
|
@@ -66643,10 +66410,10 @@ var ts;
|
|
|
66643
66410
|
else if (type && !hasExplicitReturn) {
|
|
66644
66411
|
error(errorNode, ts.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value);
|
|
66645
66412
|
}
|
|
66646
|
-
else if (type && strictNullChecks
|
|
66413
|
+
else if (type && strictNullChecks && !isTypeAssignableTo(undefinedType, type)) {
|
|
66647
66414
|
error(errorNode, ts.Diagnostics.Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined);
|
|
66648
66415
|
}
|
|
66649
|
-
else if (
|
|
66416
|
+
else if (compilerOptions.noImplicitReturns) {
|
|
66650
66417
|
if (!type) {
|
|
66651
66418
|
if (!hasExplicitReturn) {
|
|
66652
66419
|
return;
|
|
@@ -66874,9 +66641,9 @@ var ts;
|
|
|
66874
66641
|
}
|
|
66875
66642
|
function checkDeleteExpressionMustBeOptional(expr, symbol) {
|
|
66876
66643
|
var type = getTypeOfSymbol(symbol);
|
|
66877
|
-
if (strictNullChecks
|
|
66644
|
+
if (strictNullChecks &&
|
|
66878
66645
|
!(type.flags & (3 | 131072)) &&
|
|
66879
|
-
!(exactOptionalPropertyTypes
|
|
66646
|
+
!(exactOptionalPropertyTypes ? symbol.flags & 16777216 : getTypeFacts(type) & 16777216)) {
|
|
66880
66647
|
error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_optional);
|
|
66881
66648
|
}
|
|
66882
66649
|
}
|
|
@@ -66886,7 +66653,7 @@ var ts;
|
|
|
66886
66653
|
}
|
|
66887
66654
|
function checkVoidExpression(node) {
|
|
66888
66655
|
checkExpression(node.expression);
|
|
66889
|
-
return
|
|
66656
|
+
return undefinedWideningType;
|
|
66890
66657
|
}
|
|
66891
66658
|
function checkAwaitExpressionGrammar(node) {
|
|
66892
66659
|
var container = ts.getContainingFunctionOrClassStaticBlock(node);
|
|
@@ -66895,7 +66662,7 @@ var ts;
|
|
|
66895
66662
|
}
|
|
66896
66663
|
else if (!(node.flags & 32768)) {
|
|
66897
66664
|
if (ts.isInTopLevelContext(node)) {
|
|
66898
|
-
var sourceFile = getSourceFileOfNode(node);
|
|
66665
|
+
var sourceFile = ts.getSourceFileOfNode(node);
|
|
66899
66666
|
if (!hasParseDiagnostics(sourceFile)) {
|
|
66900
66667
|
var span = void 0;
|
|
66901
66668
|
if (!ts.isEffectiveExternalModule(sourceFile, compilerOptions)) {
|
|
@@ -66925,7 +66692,7 @@ var ts;
|
|
|
66925
66692
|
}
|
|
66926
66693
|
}
|
|
66927
66694
|
else {
|
|
66928
|
-
var sourceFile = getSourceFileOfNode(node);
|
|
66695
|
+
var sourceFile = ts.getSourceFileOfNode(node);
|
|
66929
66696
|
if (!hasParseDiagnostics(sourceFile)) {
|
|
66930
66697
|
var span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos);
|
|
66931
66698
|
var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules);
|
|
@@ -66989,7 +66756,7 @@ var ts;
|
|
|
66989
66756
|
return getUnaryResultType(operandType);
|
|
66990
66757
|
case 53:
|
|
66991
66758
|
checkTruthinessExpression(node.operand);
|
|
66992
|
-
var facts = getTypeFacts(operandType
|
|
66759
|
+
var facts = getTypeFacts(operandType) & (4194304 | 8388608);
|
|
66993
66760
|
return facts === 4194304 ? falseType :
|
|
66994
66761
|
facts === 8388608 ? trueType :
|
|
66995
66762
|
booleanType;
|
|
@@ -67117,7 +66884,7 @@ var ts;
|
|
|
67117
66884
|
}
|
|
67118
66885
|
function checkObjectLiteralAssignment(node, sourceType, rightIsThis) {
|
|
67119
66886
|
var properties = node.properties;
|
|
67120
|
-
if (strictNullChecks
|
|
66887
|
+
if (strictNullChecks && properties.length === 0) {
|
|
67121
66888
|
return checkNonNullType(sourceType, node);
|
|
67122
66889
|
}
|
|
67123
66890
|
for (var i = 0; i < properties.length; i++) {
|
|
@@ -67176,7 +66943,7 @@ var ts;
|
|
|
67176
66943
|
checkExternalEmitHelpers(node, 512);
|
|
67177
66944
|
}
|
|
67178
66945
|
var possiblyOutOfBoundsType = checkIteratedTypeOrElementType(65 | 128, sourceType, undefinedType, node) || errorType;
|
|
67179
|
-
var inBoundsType =
|
|
66946
|
+
var inBoundsType = compilerOptions.noUncheckedIndexedAccess ? undefined : possiblyOutOfBoundsType;
|
|
67180
66947
|
for (var i = 0; i < elements.length; i++) {
|
|
67181
66948
|
var type = possiblyOutOfBoundsType;
|
|
67182
66949
|
if (node.elements[i].kind === 226) {
|
|
@@ -67195,7 +66962,7 @@ var ts;
|
|
|
67195
66962
|
if (isArrayLikeType(sourceType)) {
|
|
67196
66963
|
var accessFlags = 32 | (hasDefaultValue(element) ? 16 : 0);
|
|
67197
66964
|
var elementType_2 = getIndexedAccessTypeOrUndefined(sourceType, indexType, accessFlags, createSyntheticExpression(element, indexType)) || errorType;
|
|
67198
|
-
var assignedType = hasDefaultValue(element) ? getTypeWithFacts(elementType_2, 524288
|
|
66965
|
+
var assignedType = hasDefaultValue(element) ? getTypeWithFacts(elementType_2, 524288) : elementType_2;
|
|
67199
66966
|
var type = getFlowTypeOfDestructuring(element, assignedType);
|
|
67200
66967
|
return checkDestructuringAssignment(element, type, checkMode);
|
|
67201
66968
|
}
|
|
@@ -67225,9 +66992,9 @@ var ts;
|
|
|
67225
66992
|
if (exprOrAssignment.kind === 299) {
|
|
67226
66993
|
var prop = exprOrAssignment;
|
|
67227
66994
|
if (prop.objectAssignmentInitializer) {
|
|
67228
|
-
if (strictNullChecks
|
|
67229
|
-
!(getTypeFacts(checkExpression(prop.objectAssignmentInitializer)
|
|
67230
|
-
sourceType = getTypeWithFacts(sourceType, 524288
|
|
66995
|
+
if (strictNullChecks &&
|
|
66996
|
+
!(getTypeFacts(checkExpression(prop.objectAssignmentInitializer)) & 16777216)) {
|
|
66997
|
+
sourceType = getTypeWithFacts(sourceType, 524288);
|
|
67231
66998
|
}
|
|
67232
66999
|
checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, checkMode);
|
|
67233
67000
|
}
|
|
@@ -67239,8 +67006,8 @@ var ts;
|
|
|
67239
67006
|
if (target.kind === 222 && target.operatorToken.kind === 63) {
|
|
67240
67007
|
checkBinaryExpression(target, checkMode);
|
|
67241
67008
|
target = target.left;
|
|
67242
|
-
if (strictNullChecks
|
|
67243
|
-
sourceType = getTypeWithFacts(sourceType, 524288
|
|
67009
|
+
if (strictNullChecks) {
|
|
67010
|
+
sourceType = getTypeWithFacts(sourceType, 524288);
|
|
67244
67011
|
}
|
|
67245
67012
|
}
|
|
67246
67013
|
if (target.kind === 206) {
|
|
@@ -67587,8 +67354,8 @@ var ts;
|
|
|
67587
67354
|
return checkInExpression(left, right, leftType, rightType);
|
|
67588
67355
|
case 55:
|
|
67589
67356
|
case 76: {
|
|
67590
|
-
var resultType_2 = getTypeFacts(leftType
|
|
67591
|
-
getUnionType([extractDefinitelyFalsyTypes(strictNullChecks
|
|
67357
|
+
var resultType_2 = getTypeFacts(leftType) & 4194304 ?
|
|
67358
|
+
getUnionType([extractDefinitelyFalsyTypes(strictNullChecks ? leftType : getBaseTypeOfLiteralType(rightType)), rightType]) :
|
|
67592
67359
|
leftType;
|
|
67593
67360
|
if (operator === 76) {
|
|
67594
67361
|
checkAssignmentOperator(rightType);
|
|
@@ -67597,8 +67364,8 @@ var ts;
|
|
|
67597
67364
|
}
|
|
67598
67365
|
case 56:
|
|
67599
67366
|
case 75: {
|
|
67600
|
-
var resultType_3 = getTypeFacts(leftType
|
|
67601
|
-
getUnionType([getNonNullableType(removeDefinitelyFalsyTypes(leftType
|
|
67367
|
+
var resultType_3 = getTypeFacts(leftType) & 8388608 ?
|
|
67368
|
+
getUnionType([getNonNullableType(removeDefinitelyFalsyTypes(leftType)), rightType], 2) :
|
|
67602
67369
|
leftType;
|
|
67603
67370
|
if (operator === 75) {
|
|
67604
67371
|
checkAssignmentOperator(rightType);
|
|
@@ -67607,8 +67374,8 @@ var ts;
|
|
|
67607
67374
|
}
|
|
67608
67375
|
case 60:
|
|
67609
67376
|
case 77: {
|
|
67610
|
-
var resultType_4 = getTypeFacts(leftType
|
|
67611
|
-
getUnionType([getNonNullableType(leftType
|
|
67377
|
+
var resultType_4 = getTypeFacts(leftType) & 262144 ?
|
|
67378
|
+
getUnionType([getNonNullableType(leftType), rightType], 2) :
|
|
67612
67379
|
leftType;
|
|
67613
67380
|
if (operator === 77) {
|
|
67614
67381
|
checkAssignmentOperator(rightType);
|
|
@@ -67635,7 +67402,7 @@ var ts;
|
|
|
67635
67402
|
}
|
|
67636
67403
|
case 27:
|
|
67637
67404
|
if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left) && !isEvalNode(right)) {
|
|
67638
|
-
var sf = getSourceFileOfNode(left);
|
|
67405
|
+
var sf = ts.getSourceFileOfNode(left);
|
|
67639
67406
|
var sourceText = sf.text;
|
|
67640
67407
|
var start_3 = ts.skipTrivia(sourceText, left.pos);
|
|
67641
67408
|
var isInDiag2657 = sf.parseDiagnostics.some(function (diag) {
|
|
@@ -67705,7 +67472,7 @@ var ts;
|
|
|
67705
67472
|
if (checkReferenceExpression(left, ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access, ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access)
|
|
67706
67473
|
&& (!ts.isIdentifier(left) || ts.unescapeLeadingUnderscores(left.escapedText) !== "exports")) {
|
|
67707
67474
|
var headMessage = void 0;
|
|
67708
|
-
if (exactOptionalPropertyTypes
|
|
67475
|
+
if (exactOptionalPropertyTypes && ts.isPropertyAccessExpression(left) && maybeTypeOfKind(valueType, 32768)) {
|
|
67709
67476
|
var target = getTypeOfPropertyOfType(getTypeOfExpression(left.expression), left.name.escapedText);
|
|
67710
67477
|
if (isExactOptionalPropertyMismatch(valueType, target)) {
|
|
67711
67478
|
headMessage = ts.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target;
|
|
@@ -67807,7 +67574,7 @@ var ts;
|
|
|
67807
67574
|
var signatureYieldType = iterationTypes && iterationTypes.yieldType || anyType;
|
|
67808
67575
|
var signatureNextType = iterationTypes && iterationTypes.nextType || anyType;
|
|
67809
67576
|
var resolvedSignatureNextType = isAsync ? getAwaitedType(signatureNextType) || anyType : signatureNextType;
|
|
67810
|
-
var yieldExpressionType = node.expression ? checkExpression(node.expression) :
|
|
67577
|
+
var yieldExpressionType = node.expression ? checkExpression(node.expression) : undefinedWideningType;
|
|
67811
67578
|
var yieldedType = getYieldedTypeOfYieldExpression(node, yieldExpressionType, resolvedSignatureNextType, isAsync);
|
|
67812
67579
|
if (returnType && yieldedType) {
|
|
67813
67580
|
checkTypeAssignableToAndOptionallyElaborate(yieldedType, signatureYieldType, node.expression || node, node.expression);
|
|
@@ -67825,7 +67592,7 @@ var ts;
|
|
|
67825
67592
|
if (!type) {
|
|
67826
67593
|
type = anyType;
|
|
67827
67594
|
addLazyDiagnostic(function () {
|
|
67828
|
-
if (noImplicitAny
|
|
67595
|
+
if (noImplicitAny && !ts.expressionResultIsUnused(node)) {
|
|
67829
67596
|
var contextualType = getContextualType(node, undefined);
|
|
67830
67597
|
if (!contextualType || isTypeAny(contextualType)) {
|
|
67831
67598
|
error(node, ts.Diagnostics.yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation);
|
|
@@ -68018,7 +67785,7 @@ var ts;
|
|
|
68018
67785
|
if (signature && signature.typeParameters) {
|
|
68019
67786
|
var contextualType = getApparentTypeOfContextualType(node, 2);
|
|
68020
67787
|
if (contextualType) {
|
|
68021
|
-
var contextualSignature = getSingleSignature(getNonNullableType(contextualType
|
|
67788
|
+
var contextualSignature = getSingleSignature(getNonNullableType(contextualType), callSignature ? 0 : 1, false);
|
|
68022
67789
|
if (contextualSignature && !contextualSignature.typeParameters) {
|
|
68023
67790
|
if (checkMode & 8) {
|
|
68024
67791
|
skippedGenericFunction(node, checkMode);
|
|
@@ -68250,7 +68017,7 @@ var ts;
|
|
|
68250
68017
|
case 106:
|
|
68251
68018
|
return checkSuperExpression(node);
|
|
68252
68019
|
case 104:
|
|
68253
|
-
return
|
|
68020
|
+
return nullWideningType;
|
|
68254
68021
|
case 14:
|
|
68255
68022
|
case 10:
|
|
68256
68023
|
return getFreshTypeOfLiteralType(getStringLiteralType(node.text));
|
|
@@ -68326,7 +68093,7 @@ var ts;
|
|
|
68326
68093
|
case 226:
|
|
68327
68094
|
return checkSpreadExpression(node, checkMode);
|
|
68328
68095
|
case 228:
|
|
68329
|
-
return
|
|
68096
|
+
return undefinedWideningType;
|
|
68330
68097
|
case 225:
|
|
68331
68098
|
return checkYieldExpression(node);
|
|
68332
68099
|
case 233:
|
|
@@ -68529,7 +68296,7 @@ var ts;
|
|
|
68529
68296
|
function checkSignatureDeclarationDiagnostics() {
|
|
68530
68297
|
checkCollisionWithArgumentsInGeneratedCode(node);
|
|
68531
68298
|
var returnTypeNode = ts.getEffectiveReturnTypeNode(node);
|
|
68532
|
-
if (noImplicitAny
|
|
68299
|
+
if (noImplicitAny && !returnTypeNode) {
|
|
68533
68300
|
switch (node.kind) {
|
|
68534
68301
|
case 176:
|
|
68535
68302
|
error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);
|
|
@@ -68550,7 +68317,7 @@ var ts;
|
|
|
68550
68317
|
var generatorYieldType = getIterationTypeOfGeneratorFunctionReturnType(0, returnType, (functionFlags_1 & 2) !== 0) || anyType;
|
|
68551
68318
|
var generatorReturnType = getIterationTypeOfGeneratorFunctionReturnType(1, returnType, (functionFlags_1 & 2) !== 0) || generatorYieldType;
|
|
68552
68319
|
var generatorNextType = getIterationTypeOfGeneratorFunctionReturnType(2, returnType, (functionFlags_1 & 2) !== 0) || unknownType;
|
|
68553
|
-
var generatorInstantiation = createGeneratorReturnType(generatorYieldType, generatorReturnType, generatorNextType, !!(functionFlags_1 & 2)
|
|
68320
|
+
var generatorInstantiation = createGeneratorReturnType(generatorYieldType, generatorReturnType, generatorNextType, !!(functionFlags_1 & 2));
|
|
68554
68321
|
checkTypeAssignableTo(generatorInstantiation, returnType, returnTypeNode);
|
|
68555
68322
|
}
|
|
68556
68323
|
}
|
|
@@ -68693,7 +68460,7 @@ var ts;
|
|
|
68693
68460
|
var indexSymbol = getIndexSymbol(getSymbolOfNode(node));
|
|
68694
68461
|
if (indexSymbol === null || indexSymbol === void 0 ? void 0 : indexSymbol.declarations) {
|
|
68695
68462
|
var indexSignatureMap_1 = new ts.Map();
|
|
68696
|
-
var
|
|
68463
|
+
var _loop_29 = function (declaration) {
|
|
68697
68464
|
if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
|
|
68698
68465
|
forEachType(getTypeFromTypeNode(declaration.parameters[0].type), function (type) {
|
|
68699
68466
|
var entry = indexSignatureMap_1.get(getTypeId(type));
|
|
@@ -68708,7 +68475,7 @@ var ts;
|
|
|
68708
68475
|
};
|
|
68709
68476
|
for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
|
|
68710
68477
|
var declaration = _a[_i];
|
|
68711
|
-
|
|
68478
|
+
_loop_29(declaration);
|
|
68712
68479
|
}
|
|
68713
68480
|
indexSignatureMap_1.forEach(function (entry) {
|
|
68714
68481
|
if (entry.declarations.length > 1) {
|
|
@@ -69051,9 +68818,6 @@ var ts;
|
|
|
69051
68818
|
return type;
|
|
69052
68819
|
}
|
|
69053
68820
|
var apparentObjectType = getApparentType(objectType);
|
|
69054
|
-
if (!strictNullChecks(accessNode) && apparentObjectType.flags & 2) {
|
|
69055
|
-
apparentObjectType = emptyObjectType;
|
|
69056
|
-
}
|
|
69057
68821
|
if (getIndexInfoOfType(apparentObjectType, numberType) && isTypeAssignableToKind(indexType, 296)) {
|
|
69058
68822
|
return type;
|
|
69059
68823
|
}
|
|
@@ -69527,7 +69291,7 @@ var ts;
|
|
|
69527
69291
|
}
|
|
69528
69292
|
return undefined;
|
|
69529
69293
|
}
|
|
69530
|
-
var onfulfilledParameterType = getTypeWithFacts(getUnionType(ts.map(candidates, getTypeOfFirstParameterOfSignature)), 2097152
|
|
69294
|
+
var onfulfilledParameterType = getTypeWithFacts(getUnionType(ts.map(candidates, getTypeOfFirstParameterOfSignature)), 2097152);
|
|
69531
69295
|
if (isTypeAny(onfulfilledParameterType)) {
|
|
69532
69296
|
return undefined;
|
|
69533
69297
|
}
|
|
@@ -69546,12 +69310,12 @@ var ts;
|
|
|
69546
69310
|
getAwaitedTypeNoAlias(type, errorNode, diagnosticMessage, arg0);
|
|
69547
69311
|
return awaitedType || errorType;
|
|
69548
69312
|
}
|
|
69549
|
-
function isThenableType(type
|
|
69313
|
+
function isThenableType(type) {
|
|
69550
69314
|
if (allTypesAssignableToKind(type, 131068 | 131072)) {
|
|
69551
69315
|
return false;
|
|
69552
69316
|
}
|
|
69553
69317
|
var thenFunction = getTypeOfPropertyOfType(type, "then");
|
|
69554
|
-
return !!thenFunction && getSignaturesOfType(getTypeWithFacts(thenFunction, 2097152
|
|
69318
|
+
return !!thenFunction && getSignaturesOfType(getTypeWithFacts(thenFunction, 2097152), 0).length > 0;
|
|
69555
69319
|
}
|
|
69556
69320
|
function isAwaitedTypeInstantiation(type) {
|
|
69557
69321
|
var _a;
|
|
@@ -69566,14 +69330,14 @@ var ts;
|
|
|
69566
69330
|
isAwaitedTypeInstantiation(type) ? type.aliasTypeArguments[0] :
|
|
69567
69331
|
type;
|
|
69568
69332
|
}
|
|
69569
|
-
function isAwaitedTypeNeeded(type
|
|
69333
|
+
function isAwaitedTypeNeeded(type) {
|
|
69570
69334
|
if (isTypeAny(type) || isAwaitedTypeInstantiation(type)) {
|
|
69571
69335
|
return false;
|
|
69572
69336
|
}
|
|
69573
69337
|
if (isGenericObjectType(type)) {
|
|
69574
69338
|
var baseConstraint = getBaseConstraintOfType(type);
|
|
69575
69339
|
if (baseConstraint ?
|
|
69576
|
-
baseConstraint.flags & 3 || isEmptyObjectType(baseConstraint) || isThenableType(baseConstraint
|
|
69340
|
+
baseConstraint.flags & 3 || isEmptyObjectType(baseConstraint) || isThenableType(baseConstraint) :
|
|
69577
69341
|
maybeTypeOfKind(type, 8650752)) {
|
|
69578
69342
|
return true;
|
|
69579
69343
|
}
|
|
@@ -69587,8 +69351,8 @@ var ts;
|
|
|
69587
69351
|
}
|
|
69588
69352
|
return undefined;
|
|
69589
69353
|
}
|
|
69590
|
-
function createAwaitedTypeIfNeeded(type
|
|
69591
|
-
if (isAwaitedTypeNeeded(type
|
|
69354
|
+
function createAwaitedTypeIfNeeded(type) {
|
|
69355
|
+
if (isAwaitedTypeNeeded(type)) {
|
|
69592
69356
|
var awaitedType = tryCreateAwaitedType(type);
|
|
69593
69357
|
if (awaitedType) {
|
|
69594
69358
|
return awaitedType;
|
|
@@ -69599,7 +69363,7 @@ var ts;
|
|
|
69599
69363
|
}
|
|
69600
69364
|
function getAwaitedType(type, errorNode, diagnosticMessage, arg0) {
|
|
69601
69365
|
var awaitedType = getAwaitedTypeNoAlias(type, errorNode, diagnosticMessage, arg0);
|
|
69602
|
-
return awaitedType && createAwaitedTypeIfNeeded(awaitedType
|
|
69366
|
+
return awaitedType && createAwaitedTypeIfNeeded(awaitedType);
|
|
69603
69367
|
}
|
|
69604
69368
|
function getAwaitedTypeNoAlias(type, errorNode, diagnosticMessage, arg0) {
|
|
69605
69369
|
if (isTypeAny(type)) {
|
|
@@ -69625,7 +69389,7 @@ var ts;
|
|
|
69625
69389
|
awaitedTypeStack.pop();
|
|
69626
69390
|
return typeAsAwaitable.awaitedTypeOfType = mapped;
|
|
69627
69391
|
}
|
|
69628
|
-
if (isAwaitedTypeNeeded(type
|
|
69392
|
+
if (isAwaitedTypeNeeded(type)) {
|
|
69629
69393
|
return typeAsAwaitable.awaitedTypeOfType = type;
|
|
69630
69394
|
}
|
|
69631
69395
|
var thisTypeForErrorOut = { value: undefined };
|
|
@@ -69645,7 +69409,7 @@ var ts;
|
|
|
69645
69409
|
}
|
|
69646
69410
|
return typeAsAwaitable.awaitedTypeOfType = awaitedType;
|
|
69647
69411
|
}
|
|
69648
|
-
if (isThenableType(type
|
|
69412
|
+
if (isThenableType(type)) {
|
|
69649
69413
|
if (errorNode) {
|
|
69650
69414
|
ts.Debug.assertIsDefined(diagnosticMessage);
|
|
69651
69415
|
var chain = void 0;
|
|
@@ -69803,7 +69567,7 @@ var ts;
|
|
|
69803
69567
|
if (typeNode.kind === 143) {
|
|
69804
69568
|
continue;
|
|
69805
69569
|
}
|
|
69806
|
-
if (!strictNullChecks
|
|
69570
|
+
if (!strictNullChecks && (typeNode.kind === 197 && typeNode.literal.kind === 104 || typeNode.kind === 154)) {
|
|
69807
69571
|
continue;
|
|
69808
69572
|
}
|
|
69809
69573
|
var individualEntityName = getEntityNameForDecoratorMetadata(typeNode);
|
|
@@ -70020,7 +69784,7 @@ var ts;
|
|
|
70020
69784
|
function registerForUnusedIdentifiersCheck(node) {
|
|
70021
69785
|
addLazyDiagnostic(registerForUnusedIdentifiersCheckDiagnostics);
|
|
70022
69786
|
function registerForUnusedIdentifiersCheckDiagnostics() {
|
|
70023
|
-
var sourceFile = getSourceFileOfNode(node);
|
|
69787
|
+
var sourceFile = ts.getSourceFileOfNode(node);
|
|
70024
69788
|
var potentiallyUnusedIdentifiers = allPotentiallyUnusedIdentifiers.get(sourceFile.path);
|
|
70025
69789
|
if (!potentiallyUnusedIdentifiers) {
|
|
70026
69790
|
potentiallyUnusedIdentifiers = [];
|
|
@@ -70139,7 +69903,7 @@ var ts;
|
|
|
70139
69903
|
var parent = typeParameter.parent;
|
|
70140
69904
|
if (parent.kind !== 191 && parent.typeParameters.every(isTypeParameterUnused)) {
|
|
70141
69905
|
if (ts.tryAddToSet(seenParentsWithEveryUnused, parent)) {
|
|
70142
|
-
var sourceFile = getSourceFileOfNode(parent);
|
|
69906
|
+
var sourceFile = ts.getSourceFileOfNode(parent);
|
|
70143
69907
|
var range = ts.isJSDocTemplateTag(parent)
|
|
70144
69908
|
? ts.rangeOfNode(parent)
|
|
70145
69909
|
: ts.rangeOfTypeParameters(sourceFile, parent.typeParameters);
|
|
@@ -70289,7 +70053,7 @@ var ts;
|
|
|
70289
70053
|
ts.Debug.assert(ts.isParameterDeclaration(wrappingDeclaration), "Only parameter declaration should be checked here");
|
|
70290
70054
|
var diagnostic = ts.createDiagnosticForNode(node.name, ts.Diagnostics._0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation, ts.declarationNameToString(node.name), ts.declarationNameToString(node.propertyName));
|
|
70291
70055
|
if (!wrappingDeclaration.type) {
|
|
70292
|
-
ts.addRelatedInfo(diagnostic, ts.createFileDiagnostic(getSourceFileOfNode(wrappingDeclaration), wrappingDeclaration.end, 1, ts.Diagnostics.We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here, ts.declarationNameToString(node.propertyName)));
|
|
70056
|
+
ts.addRelatedInfo(diagnostic, ts.createFileDiagnostic(ts.getSourceFileOfNode(wrappingDeclaration), wrappingDeclaration.end, 1, ts.Diagnostics.We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here, ts.declarationNameToString(node.propertyName)));
|
|
70293
70057
|
}
|
|
70294
70058
|
diagnostics.add(diagnostic);
|
|
70295
70059
|
}
|
|
@@ -70396,7 +70160,7 @@ var ts;
|
|
|
70396
70160
|
});
|
|
70397
70161
|
}
|
|
70398
70162
|
function checkCollisionWithRequireExportsInGeneratedCode(node, name) {
|
|
70399
|
-
if (moduleKind >= ts.ModuleKind.ES2015 && !(moduleKind >= ts.ModuleKind.Node16 && getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS)) {
|
|
70163
|
+
if (moduleKind >= ts.ModuleKind.ES2015 && !(moduleKind >= ts.ModuleKind.Node16 && ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS)) {
|
|
70400
70164
|
return;
|
|
70401
70165
|
}
|
|
70402
70166
|
if (!name || !needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) {
|
|
@@ -70583,7 +70347,7 @@ var ts;
|
|
|
70583
70347
|
var widenedType = getWidenedTypeForVariableLikeDeclaration(node);
|
|
70584
70348
|
if (needCheckInitializer) {
|
|
70585
70349
|
var initializerType = checkExpressionCached(node.initializer);
|
|
70586
|
-
if (strictNullChecks
|
|
70350
|
+
if (strictNullChecks && needCheckWidenedType) {
|
|
70587
70351
|
checkNonNullNonVoidType(initializerType, node);
|
|
70588
70352
|
}
|
|
70589
70353
|
else {
|
|
@@ -70594,7 +70358,7 @@ var ts;
|
|
|
70594
70358
|
if (ts.isArrayBindingPattern(node.name)) {
|
|
70595
70359
|
checkIteratedTypeOrElementType(65, widenedType, undefinedType, node);
|
|
70596
70360
|
}
|
|
70597
|
-
else if (strictNullChecks
|
|
70361
|
+
else if (strictNullChecks) {
|
|
70598
70362
|
checkNonNullNonVoidType(widenedType, node);
|
|
70599
70363
|
}
|
|
70600
70364
|
}
|
|
@@ -70703,7 +70467,7 @@ var ts;
|
|
|
70703
70467
|
checkSourceElement(node.elseStatement);
|
|
70704
70468
|
}
|
|
70705
70469
|
function checkTestingKnownTruthyCallableOrAwaitableType(condExpr, condType, body) {
|
|
70706
|
-
if (!strictNullChecks
|
|
70470
|
+
if (!strictNullChecks)
|
|
70707
70471
|
return;
|
|
70708
70472
|
helper(condExpr, body);
|
|
70709
70473
|
while (ts.isBinaryExpression(condExpr) && condExpr.operatorToken.kind === 56) {
|
|
@@ -70719,7 +70483,7 @@ var ts;
|
|
|
70719
70483
|
return;
|
|
70720
70484
|
var type = location === condExpr ? condType : checkTruthinessExpression(location);
|
|
70721
70485
|
var isPropertyExpressionCast = ts.isPropertyAccessExpression(location) && isTypeAssertion(location.expression);
|
|
70722
|
-
if (!(getTypeFacts(type
|
|
70486
|
+
if (!(getTypeFacts(type) & 4194304) || isPropertyExpressionCast)
|
|
70723
70487
|
return;
|
|
70724
70488
|
var callSignatures = getSignaturesOfType(type, 0);
|
|
70725
70489
|
var isPromise = !!getAwaitedTypeOfPromise(type);
|
|
@@ -70882,8 +70646,7 @@ var ts;
|
|
|
70882
70646
|
}
|
|
70883
70647
|
function checkForInStatement(node) {
|
|
70884
70648
|
checkGrammarForInOrForOfStatement(node);
|
|
70885
|
-
var
|
|
70886
|
-
var rightType = strictNullChecks(node) ? getNonNullableTypeIfNeeded(exprType, node) : exprType;
|
|
70649
|
+
var rightType = getNonNullableTypeIfNeeded(checkExpression(node.expression));
|
|
70887
70650
|
if (node.initializer.kind === 257) {
|
|
70888
70651
|
var variable = node.initializer.declarations[0];
|
|
70889
70652
|
if (variable && ts.isBindingPattern(variable.name)) {
|
|
@@ -70937,7 +70700,7 @@ var ts;
|
|
|
70937
70700
|
}
|
|
70938
70701
|
var uplevelIteration = languageVersion >= 2;
|
|
70939
70702
|
var downlevelIteration = !uplevelIteration && compilerOptions.downlevelIteration;
|
|
70940
|
-
var possibleOutOfBounds =
|
|
70703
|
+
var possibleOutOfBounds = compilerOptions.noUncheckedIndexedAccess && !!(use & 128);
|
|
70941
70704
|
if (uplevelIteration || downlevelIteration || allowAsyncIterables) {
|
|
70942
70705
|
var iterationTypes = getIterationTypesOfIterable(inputType, use, uplevelIteration ? errorNode : undefined);
|
|
70943
70706
|
if (checkAssignability) {
|
|
@@ -70953,7 +70716,7 @@ var ts;
|
|
|
70953
70716
|
}
|
|
70954
70717
|
}
|
|
70955
70718
|
if (iterationTypes || uplevelIteration) {
|
|
70956
|
-
return possibleOutOfBounds ? includeUndefinedInIndexSignature(iterationTypes && iterationTypes.yieldType
|
|
70719
|
+
return possibleOutOfBounds ? includeUndefinedInIndexSignature(iterationTypes && iterationTypes.yieldType) : (iterationTypes && iterationTypes.yieldType);
|
|
70957
70720
|
}
|
|
70958
70721
|
}
|
|
70959
70722
|
var arrayType = inputType;
|
|
@@ -70979,7 +70742,7 @@ var ts;
|
|
|
70979
70742
|
}
|
|
70980
70743
|
}
|
|
70981
70744
|
if (arrayType.flags & 131072) {
|
|
70982
|
-
return possibleOutOfBounds ? includeUndefinedInIndexSignature(stringType
|
|
70745
|
+
return possibleOutOfBounds ? includeUndefinedInIndexSignature(stringType) : stringType;
|
|
70983
70746
|
}
|
|
70984
70747
|
}
|
|
70985
70748
|
}
|
|
@@ -70989,16 +70752,16 @@ var ts;
|
|
|
70989
70752
|
var _a = getIterationDiagnosticDetails(allowsStrings, downlevelIteration), defaultDiagnostic = _a[0], maybeMissingAwait = _a[1];
|
|
70990
70753
|
errorAndMaybeSuggestAwait(errorNode, maybeMissingAwait && !!getAwaitedTypeOfPromise(arrayType), defaultDiagnostic, typeToString(arrayType));
|
|
70991
70754
|
}
|
|
70992
|
-
return hasStringConstituent ? possibleOutOfBounds ? includeUndefinedInIndexSignature(stringType
|
|
70755
|
+
return hasStringConstituent ? possibleOutOfBounds ? includeUndefinedInIndexSignature(stringType) : stringType : undefined;
|
|
70993
70756
|
}
|
|
70994
70757
|
var arrayElementType = getIndexTypeOfType(arrayType, numberType);
|
|
70995
70758
|
if (hasStringConstituent && arrayElementType) {
|
|
70996
|
-
if (arrayElementType.flags & 402653316 && !
|
|
70759
|
+
if (arrayElementType.flags & 402653316 && !compilerOptions.noUncheckedIndexedAccess) {
|
|
70997
70760
|
return stringType;
|
|
70998
70761
|
}
|
|
70999
70762
|
return getUnionType(possibleOutOfBounds ? [arrayElementType, stringType, undefinedType] : [arrayElementType, stringType], 2);
|
|
71000
70763
|
}
|
|
71001
|
-
return (use & 128) ? includeUndefinedInIndexSignature(arrayElementType
|
|
70764
|
+
return (use & 128) ? includeUndefinedInIndexSignature(arrayElementType) : arrayElementType;
|
|
71002
70765
|
function getIterationDiagnosticDetails(allowsStrings, downlevelIteration) {
|
|
71003
70766
|
var _a;
|
|
71004
70767
|
if (downlevelIteration) {
|
|
@@ -71334,7 +71097,7 @@ var ts;
|
|
|
71334
71097
|
return undefined;
|
|
71335
71098
|
}
|
|
71336
71099
|
var methodType = method && !(methodName === "next" && (method.flags & 16777216))
|
|
71337
|
-
? methodName === "next" ? getTypeOfSymbol(method) : getTypeWithFacts(getTypeOfSymbol(method), 2097152
|
|
71100
|
+
? methodName === "next" ? getTypeOfSymbol(method) : getTypeWithFacts(getTypeOfSymbol(method), 2097152)
|
|
71338
71101
|
: undefined;
|
|
71339
71102
|
if (isTypeAny(methodType)) {
|
|
71340
71103
|
return methodName === "next" ? anyIterationTypes : anyIterationTypesExceptNext;
|
|
@@ -71471,7 +71234,7 @@ var ts;
|
|
|
71471
71234
|
var signature = getSignatureFromDeclaration(container);
|
|
71472
71235
|
var returnType = getReturnTypeOfSignature(signature);
|
|
71473
71236
|
var functionFlags = ts.getFunctionFlags(container);
|
|
71474
|
-
if (strictNullChecks
|
|
71237
|
+
if (strictNullChecks || node.expression || returnType.flags & 131072) {
|
|
71475
71238
|
var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType;
|
|
71476
71239
|
if (container.kind === 174) {
|
|
71477
71240
|
if (node.expression) {
|
|
@@ -71493,7 +71256,7 @@ var ts;
|
|
|
71493
71256
|
}
|
|
71494
71257
|
}
|
|
71495
71258
|
}
|
|
71496
|
-
else if (container.kind !== 172 &&
|
|
71259
|
+
else if (container.kind !== 172 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(container, returnType)) {
|
|
71497
71260
|
error(node, ts.Diagnostics.Not_all_code_paths_return_a_value);
|
|
71498
71261
|
}
|
|
71499
71262
|
}
|
|
@@ -71504,7 +71267,7 @@ var ts;
|
|
|
71504
71267
|
}
|
|
71505
71268
|
}
|
|
71506
71269
|
checkExpression(node.expression);
|
|
71507
|
-
var sourceFile = getSourceFileOfNode(node);
|
|
71270
|
+
var sourceFile = ts.getSourceFileOfNode(node);
|
|
71508
71271
|
if (!hasParseDiagnostics(sourceFile)) {
|
|
71509
71272
|
var start = ts.getSpanOfTokenAtPosition(sourceFile, node.pos).start;
|
|
71510
71273
|
var end = node.statement.pos;
|
|
@@ -71531,7 +71294,7 @@ var ts;
|
|
|
71531
71294
|
addLazyDiagnostic(createLazyCaseClauseDiagnostics(clause));
|
|
71532
71295
|
}
|
|
71533
71296
|
ts.forEach(clause.statements, checkSourceElement);
|
|
71534
|
-
if (
|
|
71297
|
+
if (compilerOptions.noFallthroughCasesInSwitch && clause.fallthroughFlowNode && isReachableFlowNode(clause.fallthroughFlowNode)) {
|
|
71535
71298
|
error(clause, ts.Diagnostics.Fallthrough_case_in_switch);
|
|
71536
71299
|
}
|
|
71537
71300
|
function createLazyCaseClauseDiagnostics(clause) {
|
|
@@ -71652,7 +71415,7 @@ var ts;
|
|
|
71652
71415
|
var propDeclaration = declaration && declaration.kind === 222 ||
|
|
71653
71416
|
name && name.kind === 163 ? declaration : undefined;
|
|
71654
71417
|
var localPropDeclaration = getParentOfSymbol(prop) === type.symbol ? declaration : undefined;
|
|
71655
|
-
var
|
|
71418
|
+
var _loop_30 = function (info) {
|
|
71656
71419
|
var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
|
|
71657
71420
|
var errorNode = localPropDeclaration || localIndexDeclaration ||
|
|
71658
71421
|
(interfaceDeclaration && !ts.some(getBaseTypes(type), function (base) { return !!getPropertyOfObjectType(base, prop.escapedName) && !!getIndexTypeOfType(base, info.keyType); }) ? interfaceDeclaration : undefined);
|
|
@@ -71666,7 +71429,7 @@ var ts;
|
|
|
71666
71429
|
};
|
|
71667
71430
|
for (var _i = 0, indexInfos_9 = indexInfos; _i < indexInfos_9.length; _i++) {
|
|
71668
71431
|
var info = indexInfos_9[_i];
|
|
71669
|
-
|
|
71432
|
+
_loop_30(info);
|
|
71670
71433
|
}
|
|
71671
71434
|
}
|
|
71672
71435
|
function checkIndexConstraintForIndexSignature(type, checkInfo) {
|
|
@@ -71674,7 +71437,7 @@ var ts;
|
|
|
71674
71437
|
var indexInfos = getApplicableIndexInfos(type, checkInfo.keyType);
|
|
71675
71438
|
var interfaceDeclaration = ts.getObjectFlags(type) & 2 ? ts.getDeclarationOfKind(type.symbol, 260) : undefined;
|
|
71676
71439
|
var localCheckDeclaration = declaration && getParentOfSymbol(getSymbolOfNode(declaration)) === type.symbol ? declaration : undefined;
|
|
71677
|
-
var
|
|
71440
|
+
var _loop_31 = function (info) {
|
|
71678
71441
|
if (info === checkInfo)
|
|
71679
71442
|
return "continue";
|
|
71680
71443
|
var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
|
|
@@ -71686,7 +71449,7 @@ var ts;
|
|
|
71686
71449
|
};
|
|
71687
71450
|
for (var _i = 0, indexInfos_10 = indexInfos; _i < indexInfos_10.length; _i++) {
|
|
71688
71451
|
var info = indexInfos_10[_i];
|
|
71689
|
-
|
|
71452
|
+
_loop_31(info);
|
|
71690
71453
|
}
|
|
71691
71454
|
}
|
|
71692
71455
|
function checkTypeNameIsReserved(name, message) {
|
|
@@ -71706,7 +71469,7 @@ var ts;
|
|
|
71706
71469
|
}
|
|
71707
71470
|
function checkClassNameCollisionWithObject(name) {
|
|
71708
71471
|
if (languageVersion >= 1 && name.escapedText === "Object"
|
|
71709
|
-
&& (moduleKind < ts.ModuleKind.ES2015 || getSourceFileOfNode(name).impliedNodeFormat === ts.ModuleKind.CommonJS)) {
|
|
71472
|
+
&& (moduleKind < ts.ModuleKind.ES2015 || ts.getSourceFileOfNode(name).impliedNodeFormat === ts.ModuleKind.CommonJS)) {
|
|
71710
71473
|
error(name, ts.Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0, ts.ModuleKind[moduleKind]);
|
|
71711
71474
|
}
|
|
71712
71475
|
}
|
|
@@ -71981,7 +71744,7 @@ var ts;
|
|
|
71981
71744
|
var baseTypes = baseTypeNode && getBaseTypes(type);
|
|
71982
71745
|
var baseWithThis = (baseTypes === null || baseTypes === void 0 ? void 0 : baseTypes.length) ? getTypeWithThisArgument(ts.first(baseTypes), type.thisType) : undefined;
|
|
71983
71746
|
var baseStaticType = getBaseConstructorTypeOfClass(type);
|
|
71984
|
-
var
|
|
71747
|
+
var _loop_32 = function (member) {
|
|
71985
71748
|
if (ts.hasAmbientModifier(member)) {
|
|
71986
71749
|
return "continue";
|
|
71987
71750
|
}
|
|
@@ -71996,7 +71759,7 @@ var ts;
|
|
|
71996
71759
|
};
|
|
71997
71760
|
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
|
|
71998
71761
|
var member = _a[_i];
|
|
71999
|
-
|
|
71762
|
+
_loop_32(member);
|
|
72000
71763
|
}
|
|
72001
71764
|
}
|
|
72002
71765
|
function checkExistingMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, member, memberIsParameterProperty, reportErrors) {
|
|
@@ -72012,7 +71775,7 @@ var ts;
|
|
|
72012
71775
|
function checkMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, memberHasOverrideModifier, memberHasAbstractModifier, memberIsStatic, memberIsParameterProperty, memberName, errorNode) {
|
|
72013
71776
|
var isJs = ts.isInJSFile(node);
|
|
72014
71777
|
var nodeInAmbientContext = !!(node.flags & 16777216);
|
|
72015
|
-
if (baseWithThis && (memberHasOverrideModifier ||
|
|
71778
|
+
if (baseWithThis && (memberHasOverrideModifier || compilerOptions.noImplicitOverride)) {
|
|
72016
71779
|
var memberEscapedName = ts.escapeLeadingUnderscores(memberName);
|
|
72017
71780
|
var thisType = memberIsStatic ? staticType : typeWithThis;
|
|
72018
71781
|
var baseType = memberIsStatic ? baseStaticType : baseWithThis;
|
|
@@ -72032,7 +71795,7 @@ var ts;
|
|
|
72032
71795
|
}
|
|
72033
71796
|
return 2;
|
|
72034
71797
|
}
|
|
72035
|
-
else if (prop && (baseProp === null || baseProp === void 0 ? void 0 : baseProp.declarations) &&
|
|
71798
|
+
else if (prop && (baseProp === null || baseProp === void 0 ? void 0 : baseProp.declarations) && compilerOptions.noImplicitOverride && !nodeInAmbientContext) {
|
|
72036
71799
|
var baseHasAbstract = ts.some(baseProp.declarations, ts.hasAbstractModifier);
|
|
72037
71800
|
if (memberHasOverrideModifier) {
|
|
72038
71801
|
return 0;
|
|
@@ -72071,7 +71834,7 @@ var ts;
|
|
|
72071
71834
|
}
|
|
72072
71835
|
function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) {
|
|
72073
71836
|
var issuedMemberError = false;
|
|
72074
|
-
var
|
|
71837
|
+
var _loop_33 = function (member) {
|
|
72075
71838
|
if (ts.isStatic(member)) {
|
|
72076
71839
|
return "continue";
|
|
72077
71840
|
}
|
|
@@ -72089,7 +71852,7 @@ var ts;
|
|
|
72089
71852
|
};
|
|
72090
71853
|
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
|
|
72091
71854
|
var member = _a[_i];
|
|
72092
|
-
|
|
71855
|
+
_loop_33(member);
|
|
72093
71856
|
}
|
|
72094
71857
|
if (!issuedMemberError) {
|
|
72095
71858
|
checkTypeAssignableTo(typeWithThis, baseWithThis, node.name || node, broadDiag);
|
|
@@ -72136,7 +71899,7 @@ var ts;
|
|
|
72136
71899
|
function checkKindsOfPropertyMemberOverrides(type, baseType) {
|
|
72137
71900
|
var _a, _b, _c, _d;
|
|
72138
71901
|
var baseProperties = getPropertiesOfType(baseType);
|
|
72139
|
-
var
|
|
71902
|
+
var _loop_34 = function (baseProperty) {
|
|
72140
71903
|
var base = getTargetSymbol(baseProperty);
|
|
72141
71904
|
if (base.flags & 4194304) {
|
|
72142
71905
|
return "continue";
|
|
@@ -72205,7 +71968,7 @@ var ts;
|
|
|
72205
71968
|
if (uninitialized.exclamationToken
|
|
72206
71969
|
|| !constructor
|
|
72207
71970
|
|| !ts.isIdentifier(propName)
|
|
72208
|
-
|| !strictNullChecks
|
|
71971
|
+
|| !strictNullChecks
|
|
72209
71972
|
|| !isPropertyInitializedInConstructor(propName, type, constructor)) {
|
|
72210
71973
|
var errorMessage_2 = ts.Diagnostics.Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration;
|
|
72211
71974
|
error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_2, symbolToString(base), typeToString(baseType));
|
|
@@ -72234,8 +71997,8 @@ var ts;
|
|
|
72234
71997
|
};
|
|
72235
71998
|
basePropertyCheck: for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) {
|
|
72236
71999
|
var baseProperty = baseProperties_1[_i];
|
|
72237
|
-
var
|
|
72238
|
-
switch (
|
|
72000
|
+
var state_10 = _loop_34(baseProperty);
|
|
72001
|
+
switch (state_10) {
|
|
72239
72002
|
case "continue-basePropertyCheck": continue basePropertyCheck;
|
|
72240
72003
|
}
|
|
72241
72004
|
}
|
|
@@ -72300,7 +72063,7 @@ var ts;
|
|
|
72300
72063
|
return ok;
|
|
72301
72064
|
}
|
|
72302
72065
|
function checkPropertyInitialization(node) {
|
|
72303
|
-
if (!strictNullChecks
|
|
72066
|
+
if (!strictNullChecks || !strictPropertyInitialization || node.flags & 16777216) {
|
|
72304
72067
|
return;
|
|
72305
72068
|
}
|
|
72306
72069
|
var constructor = findConstructorDeclaration(node);
|
|
@@ -72336,7 +72099,7 @@ var ts;
|
|
|
72336
72099
|
ts.setParent(reference.expression, reference);
|
|
72337
72100
|
ts.setParent(reference, staticBlock);
|
|
72338
72101
|
reference.flowNode = staticBlock.returnFlowNode;
|
|
72339
|
-
var flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType
|
|
72102
|
+
var flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType));
|
|
72340
72103
|
if (!containsUndefinedType(flowType)) {
|
|
72341
72104
|
return true;
|
|
72342
72105
|
}
|
|
@@ -72351,7 +72114,7 @@ var ts;
|
|
|
72351
72114
|
ts.setParent(reference.expression, reference);
|
|
72352
72115
|
ts.setParent(reference, constructor);
|
|
72353
72116
|
reference.flowNode = constructor.returnFlowNode;
|
|
72354
|
-
var flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType
|
|
72117
|
+
var flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType));
|
|
72355
72118
|
return !containsUndefinedType(flowType);
|
|
72356
72119
|
}
|
|
72357
72120
|
function checkInterfaceDeclaration(node) {
|
|
@@ -72678,7 +72441,7 @@ var ts;
|
|
|
72678
72441
|
&& isInstantiatedModule(node, ts.shouldPreserveConstEnums(compilerOptions))) {
|
|
72679
72442
|
var firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol);
|
|
72680
72443
|
if (firstNonAmbientClassOrFunc) {
|
|
72681
|
-
if (getSourceFileOfNode(node) !== getSourceFileOfNode(firstNonAmbientClassOrFunc)) {
|
|
72444
|
+
if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(firstNonAmbientClassOrFunc)) {
|
|
72682
72445
|
error(node.name, ts.Diagnostics.A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged);
|
|
72683
72446
|
}
|
|
72684
72447
|
else if (node.pos < firstNonAmbientClassOrFunc.pos) {
|
|
@@ -72833,7 +72596,7 @@ var ts;
|
|
|
72833
72596
|
ts.Debug.assert(node.kind !== 276);
|
|
72834
72597
|
if (node.kind === 277) {
|
|
72835
72598
|
var diag = error(errorNode, ts.Diagnostics.Types_cannot_appear_in_export_declarations_in_JavaScript_files);
|
|
72836
|
-
var alreadyExportedSymbol = (_b = (_a = getSourceFileOfNode(node).symbol) === null || _a === void 0 ? void 0 : _a.exports) === null || _b === void 0 ? void 0 : _b.get((node.propertyName || node.name).escapedText);
|
|
72599
|
+
var alreadyExportedSymbol = (_b = (_a = ts.getSourceFileOfNode(node).symbol) === null || _a === void 0 ? void 0 : _a.exports) === null || _b === void 0 ? void 0 : _b.get((node.propertyName || node.name).escapedText);
|
|
72837
72600
|
if (alreadyExportedSymbol === target) {
|
|
72838
72601
|
var exportingDeclaration = (_c = alreadyExportedSymbol.declarations) === null || _c === void 0 ? void 0 : _c.find(ts.isJSDocNode);
|
|
72839
72602
|
if (exportingDeclaration) {
|
|
@@ -72883,7 +72646,7 @@ var ts;
|
|
|
72883
72646
|
break;
|
|
72884
72647
|
}
|
|
72885
72648
|
case 277: {
|
|
72886
|
-
if (getSourceFileOfNode(typeOnlyAlias) !== getSourceFileOfNode(node)) {
|
|
72649
|
+
if (ts.getSourceFileOfNode(typeOnlyAlias) !== ts.getSourceFileOfNode(node)) {
|
|
72887
72650
|
var message = isType
|
|
72888
72651
|
? ts.Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type
|
|
72889
72652
|
: ts.Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isolatedModules_is_enabled;
|
|
@@ -72941,7 +72704,7 @@ var ts;
|
|
|
72941
72704
|
if (node.kind === 272 &&
|
|
72942
72705
|
ts.idText(node.propertyName || node.name) === "default" &&
|
|
72943
72706
|
ts.getESModuleInterop(compilerOptions) &&
|
|
72944
|
-
moduleKind !== ts.ModuleKind.System && (moduleKind < ts.ModuleKind.ES2015 || getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS)) {
|
|
72707
|
+
moduleKind !== ts.ModuleKind.System && (moduleKind < ts.ModuleKind.ES2015 || ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS)) {
|
|
72945
72708
|
checkExternalEmitHelpers(node, 131072);
|
|
72946
72709
|
}
|
|
72947
72710
|
}
|
|
@@ -72989,7 +72752,7 @@ var ts;
|
|
|
72989
72752
|
if (importClause.namedBindings) {
|
|
72990
72753
|
if (importClause.namedBindings.kind === 270) {
|
|
72991
72754
|
checkImportBinding(importClause.namedBindings);
|
|
72992
|
-
if (moduleKind !== ts.ModuleKind.System && (moduleKind < ts.ModuleKind.ES2015 || getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS) && ts.getESModuleInterop(compilerOptions)) {
|
|
72755
|
+
if (moduleKind !== ts.ModuleKind.System && (moduleKind < ts.ModuleKind.ES2015 || ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS) && ts.getESModuleInterop(compilerOptions)) {
|
|
72993
72756
|
checkExternalEmitHelpers(node, 65536);
|
|
72994
72757
|
}
|
|
72995
72758
|
}
|
|
@@ -73032,7 +72795,7 @@ var ts;
|
|
|
73032
72795
|
}
|
|
73033
72796
|
}
|
|
73034
72797
|
else {
|
|
73035
|
-
if (moduleKind >= ts.ModuleKind.ES2015 && getSourceFileOfNode(node).impliedNodeFormat === undefined && !node.isTypeOnly && !(node.flags & 16777216)) {
|
|
72798
|
+
if (moduleKind >= ts.ModuleKind.ES2015 && ts.getSourceFileOfNode(node).impliedNodeFormat === undefined && !node.isTypeOnly && !(node.flags & 16777216)) {
|
|
73036
72799
|
grammarErrorOnNode(node, ts.Diagnostics.Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead);
|
|
73037
72800
|
}
|
|
73038
72801
|
}
|
|
@@ -73067,7 +72830,7 @@ var ts;
|
|
|
73067
72830
|
else if (node.exportClause) {
|
|
73068
72831
|
checkAliasSymbol(node.exportClause);
|
|
73069
72832
|
}
|
|
73070
|
-
if (moduleKind !== ts.ModuleKind.System && (moduleKind < ts.ModuleKind.ES2015 || getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS)) {
|
|
72833
|
+
if (moduleKind !== ts.ModuleKind.System && (moduleKind < ts.ModuleKind.ES2015 || ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS)) {
|
|
73071
72834
|
if (node.exportClause) {
|
|
73072
72835
|
if (ts.getESModuleInterop(compilerOptions)) {
|
|
73073
72836
|
checkExternalEmitHelpers(node, 65536);
|
|
@@ -73158,7 +72921,7 @@ var ts;
|
|
|
73158
72921
|
else {
|
|
73159
72922
|
if (ts.getESModuleInterop(compilerOptions) &&
|
|
73160
72923
|
moduleKind !== ts.ModuleKind.System &&
|
|
73161
|
-
(moduleKind < ts.ModuleKind.ES2015 || getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS) &&
|
|
72924
|
+
(moduleKind < ts.ModuleKind.ES2015 || ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS) &&
|
|
73162
72925
|
ts.idText(node.propertyName || node.name) === "default") {
|
|
73163
72926
|
checkExternalEmitHelpers(node, 131072);
|
|
73164
72927
|
}
|
|
@@ -73213,7 +72976,7 @@ var ts;
|
|
|
73213
72976
|
grammarErrorOnNode(node.expression, ts.Diagnostics.The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context);
|
|
73214
72977
|
}
|
|
73215
72978
|
if (node.isExportEquals && !(node.flags & 16777216)) {
|
|
73216
|
-
if (moduleKind >= ts.ModuleKind.ES2015 && getSourceFileOfNode(node).impliedNodeFormat !== ts.ModuleKind.CommonJS) {
|
|
72979
|
+
if (moduleKind >= ts.ModuleKind.ES2015 && ts.getSourceFileOfNode(node).impliedNodeFormat !== ts.ModuleKind.CommonJS) {
|
|
73217
72980
|
grammarErrorOnNode(node, ts.Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead);
|
|
73218
72981
|
}
|
|
73219
72982
|
else if (moduleKind === ts.ModuleKind.System) {
|
|
@@ -73531,10 +73294,10 @@ var ts;
|
|
|
73531
73294
|
if (ts.isParameter(parent) && ts.isJSDocFunctionType(parent.parent)) {
|
|
73532
73295
|
return createArrayType(type);
|
|
73533
73296
|
}
|
|
73534
|
-
return addOptionality(type
|
|
73297
|
+
return addOptionality(type);
|
|
73535
73298
|
}
|
|
73536
73299
|
function checkNodeDeferred(node) {
|
|
73537
|
-
var enclosingFile = getSourceFileOfNode(node);
|
|
73300
|
+
var enclosingFile = ts.getSourceFileOfNode(node);
|
|
73538
73301
|
var links = getNodeLinks(enclosingFile);
|
|
73539
73302
|
if (!(links.flags & 1)) {
|
|
73540
73303
|
links.deferredNodes || (links.deferredNodes = new ts.Set());
|
|
@@ -73594,15 +73357,15 @@ var ts;
|
|
|
73594
73357
|
ts.performance.measure("Check", "beforeCheck", "afterCheck");
|
|
73595
73358
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
73596
73359
|
}
|
|
73597
|
-
function unusedIsError(kind, isAmbient
|
|
73360
|
+
function unusedIsError(kind, isAmbient) {
|
|
73598
73361
|
if (isAmbient) {
|
|
73599
73362
|
return false;
|
|
73600
73363
|
}
|
|
73601
73364
|
switch (kind) {
|
|
73602
73365
|
case 0:
|
|
73603
|
-
return !!
|
|
73366
|
+
return !!compilerOptions.noUnusedLocals;
|
|
73604
73367
|
case 1:
|
|
73605
|
-
return !!
|
|
73368
|
+
return !!compilerOptions.noUnusedParameters;
|
|
73606
73369
|
default:
|
|
73607
73370
|
return ts.Debug.assertNever(kind);
|
|
73608
73371
|
}
|
|
@@ -73629,9 +73392,9 @@ var ts;
|
|
|
73629
73392
|
registerForUnusedIdentifiersCheck(node);
|
|
73630
73393
|
}
|
|
73631
73394
|
addLazyDiagnostic(function () {
|
|
73632
|
-
if (!node.isDeclarationFile && (
|
|
73395
|
+
if (!node.isDeclarationFile && (compilerOptions.noUnusedLocals || compilerOptions.noUnusedParameters)) {
|
|
73633
73396
|
checkUnusedIdentifiers(getPotentiallyUnusedIdentifiers(node), function (containingNode, kind, diag) {
|
|
73634
|
-
if (!ts.containsParseError(containingNode) && unusedIsError(kind, !!(containingNode.flags & 16777216)
|
|
73397
|
+
if (!ts.containsParseError(containingNode) && unusedIsError(kind, !!(containingNode.flags & 16777216))) {
|
|
73635
73398
|
diagnostics.add(diag);
|
|
73636
73399
|
}
|
|
73637
73400
|
});
|
|
@@ -73971,7 +73734,7 @@ var ts;
|
|
|
73971
73734
|
if (result && isJSDoc_1) {
|
|
73972
73735
|
var container = ts.getJSDocHost(name);
|
|
73973
73736
|
if (container && ts.isEnumMember(container) && container === result.valueDeclaration) {
|
|
73974
|
-
return resolveEntityName(name, meaning, true, true, getSourceFileOfNode(container)) || result;
|
|
73737
|
+
return resolveEntityName(name, meaning, true, true, ts.getSourceFileOfNode(container)) || result;
|
|
73975
73738
|
}
|
|
73976
73739
|
}
|
|
73977
73740
|
return result;
|
|
@@ -74295,12 +74058,10 @@ var ts;
|
|
|
74295
74058
|
}
|
|
74296
74059
|
}
|
|
74297
74060
|
function getAugmentedPropertiesOfType(type) {
|
|
74298
|
-
var _a, _b;
|
|
74299
74061
|
type = getApparentType(type);
|
|
74300
74062
|
var propsByName = ts.createSymbolTable(getPropertiesOfType(type));
|
|
74301
|
-
var
|
|
74302
|
-
|
|
74303
|
-
getSignaturesOfType(type, 1).length ? globalNewableFunctionType(file) :
|
|
74063
|
+
var functionType = getSignaturesOfType(type, 0).length ? globalCallableFunctionType :
|
|
74064
|
+
getSignaturesOfType(type, 1).length ? globalNewableFunctionType :
|
|
74304
74065
|
undefined;
|
|
74305
74066
|
if (functionType) {
|
|
74306
74067
|
ts.forEach(getPropertiesOfType(functionType), function (p) {
|
|
@@ -74391,7 +74152,7 @@ var ts;
|
|
|
74391
74152
|
if (parentSymbol_1) {
|
|
74392
74153
|
if (parentSymbol_1.flags & 512 && ((_a = parentSymbol_1.valueDeclaration) === null || _a === void 0 ? void 0 : _a.kind) === 307) {
|
|
74393
74154
|
var symbolFile = parentSymbol_1.valueDeclaration;
|
|
74394
|
-
var referenceFile = getSourceFileOfNode(node);
|
|
74155
|
+
var referenceFile = ts.getSourceFileOfNode(node);
|
|
74395
74156
|
var symbolIsUmdExport = symbolFile !== referenceFile;
|
|
74396
74157
|
return symbolIsUmdExport ? undefined : symbolFile;
|
|
74397
74158
|
}
|
|
@@ -74539,14 +74300,14 @@ var ts;
|
|
|
74539
74300
|
return false;
|
|
74540
74301
|
}
|
|
74541
74302
|
function isRequiredInitializedParameter(parameter) {
|
|
74542
|
-
return !!strictNullChecks
|
|
74303
|
+
return !!strictNullChecks &&
|
|
74543
74304
|
!isOptionalParameter(parameter) &&
|
|
74544
74305
|
!ts.isJSDocParameterTag(parameter) &&
|
|
74545
74306
|
!!parameter.initializer &&
|
|
74546
74307
|
!ts.hasSyntacticModifier(parameter, 16476);
|
|
74547
74308
|
}
|
|
74548
74309
|
function isOptionalUninitializedParameterProperty(parameter) {
|
|
74549
|
-
return strictNullChecks
|
|
74310
|
+
return strictNullChecks &&
|
|
74550
74311
|
isOptionalParameter(parameter) &&
|
|
74551
74312
|
!parameter.initializer &&
|
|
74552
74313
|
ts.hasSyntacticModifier(parameter, 16476);
|
|
@@ -74690,7 +74451,7 @@ var ts;
|
|
|
74690
74451
|
flags |= 1048576;
|
|
74691
74452
|
}
|
|
74692
74453
|
if (addUndefined) {
|
|
74693
|
-
type = getOptionalType(type
|
|
74454
|
+
type = getOptionalType(type);
|
|
74694
74455
|
}
|
|
74695
74456
|
return nodeBuilder.typeToTypeNode(type, enclosingDeclaration, flags | 1024, tracker);
|
|
74696
74457
|
}
|
|
@@ -74760,11 +74521,11 @@ var ts;
|
|
|
74760
74521
|
return literalTypeToNode(type, node, tracker);
|
|
74761
74522
|
}
|
|
74762
74523
|
function getJsxFactoryEntity(location) {
|
|
74763
|
-
return location ? (getJsxNamespace(location), (getSourceFileOfNode(location).localJsxFactory || _jsxFactoryEntity)) : _jsxFactoryEntity;
|
|
74524
|
+
return location ? (getJsxNamespace(location), (ts.getSourceFileOfNode(location).localJsxFactory || _jsxFactoryEntity)) : _jsxFactoryEntity;
|
|
74764
74525
|
}
|
|
74765
74526
|
function getJsxFragmentFactoryEntity(location) {
|
|
74766
74527
|
if (location) {
|
|
74767
|
-
var file = getSourceFileOfNode(location);
|
|
74528
|
+
var file = ts.getSourceFileOfNode(location);
|
|
74768
74529
|
if (file) {
|
|
74769
74530
|
if (file.localJsxFragmentFactory) {
|
|
74770
74531
|
return file.localJsxFragmentFactory;
|
|
@@ -74884,7 +74645,7 @@ var ts;
|
|
|
74884
74645
|
isImportRequiredByAugmentation: isImportRequiredByAugmentation,
|
|
74885
74646
|
};
|
|
74886
74647
|
function isImportRequiredByAugmentation(node) {
|
|
74887
|
-
var file = getSourceFileOfNode(node);
|
|
74648
|
+
var file = ts.getSourceFileOfNode(node);
|
|
74888
74649
|
if (!file.symbol)
|
|
74889
74650
|
return false;
|
|
74890
74651
|
var importTarget = getExternalModuleFileFromDeclaration(node);
|
|
@@ -74900,7 +74661,7 @@ var ts;
|
|
|
74900
74661
|
if (merged.declarations) {
|
|
74901
74662
|
for (var _b = 0, _c = merged.declarations; _b < _c.length; _b++) {
|
|
74902
74663
|
var d = _c[_b];
|
|
74903
|
-
var declFile = getSourceFileOfNode(d);
|
|
74664
|
+
var declFile = ts.getSourceFileOfNode(d);
|
|
74904
74665
|
if (declFile === importTarget) {
|
|
74905
74666
|
return true;
|
|
74906
74667
|
}
|
|
@@ -74938,7 +74699,7 @@ var ts;
|
|
|
74938
74699
|
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
|
|
74939
74700
|
var decl = _a[_i];
|
|
74940
74701
|
if (decl.symbol && decl.symbol.flags & meaning) {
|
|
74941
|
-
var file = getSourceFileOfNode(decl);
|
|
74702
|
+
var file = ts.getSourceFileOfNode(decl);
|
|
74942
74703
|
var typeReferenceDirective = fileToDirective.get(file.path);
|
|
74943
74704
|
if (typeReferenceDirective) {
|
|
74944
74705
|
(typeReferenceDirectives || (typeReferenceDirectives = [])).push(typeReferenceDirective);
|
|
@@ -74969,7 +74730,7 @@ var ts;
|
|
|
74969
74730
|
}
|
|
74970
74731
|
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
|
|
74971
74732
|
var decl = _a[_i];
|
|
74972
|
-
var file = getSourceFileOfNode(decl);
|
|
74733
|
+
var file = ts.getSourceFileOfNode(decl);
|
|
74973
74734
|
if (fileToDirective.has(file.path)) {
|
|
74974
74735
|
return true;
|
|
74975
74736
|
}
|
|
@@ -75050,15 +74811,15 @@ var ts;
|
|
|
75050
74811
|
}
|
|
75051
74812
|
}
|
|
75052
74813
|
addToSymbolTable(globals, builtinGlobals, ts.Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0);
|
|
75053
|
-
getSymbolLinks(undefinedSymbol).type =
|
|
74814
|
+
getSymbolLinks(undefinedSymbol).type = undefinedWideningType;
|
|
75054
74815
|
getSymbolLinks(argumentsSymbol).type = getGlobalType("IArguments", 0, true);
|
|
75055
74816
|
getSymbolLinks(unknownSymbol).type = errorType;
|
|
75056
74817
|
getSymbolLinks(globalThisSymbol).type = createObjectType(16, globalThisSymbol);
|
|
75057
74818
|
globalArrayType = getGlobalType("Array", 1, true);
|
|
75058
74819
|
globalObjectType = getGlobalType("Object", 0, true);
|
|
75059
74820
|
globalFunctionType = getGlobalType("Function", 0, true);
|
|
75060
|
-
globalCallableFunctionType =
|
|
75061
|
-
globalNewableFunctionType =
|
|
74821
|
+
globalCallableFunctionType = strictBindCallApply && getGlobalType("CallableFunction", 0, true) || globalFunctionType;
|
|
74822
|
+
globalNewableFunctionType = strictBindCallApply && getGlobalType("NewableFunction", 0, true) || globalFunctionType;
|
|
75062
74823
|
globalStringType = getGlobalType("String", 0, true);
|
|
75063
74824
|
globalNumberType = getGlobalType("Number", 0, true);
|
|
75064
74825
|
globalBooleanType = getGlobalType("Boolean", 0, true);
|
|
@@ -75108,7 +74869,7 @@ var ts;
|
|
|
75108
74869
|
}
|
|
75109
74870
|
function checkExternalEmitHelpers(location, helpers) {
|
|
75110
74871
|
if ((requestedExternalEmitHelpers & helpers) !== helpers && compilerOptions.importHelpers) {
|
|
75111
|
-
var sourceFile = getSourceFileOfNode(location);
|
|
74872
|
+
var sourceFile = ts.getSourceFileOfNode(location);
|
|
75112
74873
|
if (ts.isEffectiveExternalModule(sourceFile, compilerOptions) && !(location.flags & 16777216)) {
|
|
75113
74874
|
var helpersModule = resolveHelpersModule(sourceFile, location);
|
|
75114
74875
|
if (helpersModule !== unknownSymbol) {
|
|
@@ -75606,7 +75367,7 @@ var ts;
|
|
|
75606
75367
|
return false;
|
|
75607
75368
|
}
|
|
75608
75369
|
function checkGrammarFunctionLikeDeclaration(node) {
|
|
75609
|
-
var file = getSourceFileOfNode(node);
|
|
75370
|
+
var file = ts.getSourceFileOfNode(node);
|
|
75610
75371
|
return checkGrammarDecoratorsAndModifiers(node) ||
|
|
75611
75372
|
checkGrammarTypeParameterList(node.typeParameters, file) ||
|
|
75612
75373
|
checkGrammarParameterList(node.parameters) ||
|
|
@@ -75614,7 +75375,7 @@ var ts;
|
|
|
75614
75375
|
(ts.isFunctionLikeDeclaration(node) && checkGrammarForUseStrictSimpleParameterList(node));
|
|
75615
75376
|
}
|
|
75616
75377
|
function checkGrammarClassLikeDeclaration(node) {
|
|
75617
|
-
var file = getSourceFileOfNode(node);
|
|
75378
|
+
var file = ts.getSourceFileOfNode(node);
|
|
75618
75379
|
return checkGrammarClassDeclarationHeritageClauses(node) ||
|
|
75619
75380
|
checkGrammarTypeParameterList(node.typeParameters, file);
|
|
75620
75381
|
}
|
|
@@ -75675,7 +75436,7 @@ var ts;
|
|
|
75675
75436
|
}
|
|
75676
75437
|
function checkGrammarForAtLeastOneTypeArgument(node, typeArguments) {
|
|
75677
75438
|
if (typeArguments && typeArguments.length === 0) {
|
|
75678
|
-
var sourceFile = getSourceFileOfNode(node);
|
|
75439
|
+
var sourceFile = ts.getSourceFileOfNode(node);
|
|
75679
75440
|
var start = typeArguments.pos - "<".length;
|
|
75680
75441
|
var end = ts.skipTrivia(sourceFile.text, typeArguments.end) + ">".length;
|
|
75681
75442
|
return grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Type_argument_list_cannot_be_empty);
|
|
@@ -75931,7 +75692,7 @@ var ts;
|
|
|
75931
75692
|
}
|
|
75932
75693
|
if (forInOrOfStatement.kind === 246 && forInOrOfStatement.awaitModifier) {
|
|
75933
75694
|
if (!(forInOrOfStatement.flags & 32768)) {
|
|
75934
|
-
var sourceFile = getSourceFileOfNode(forInOrOfStatement);
|
|
75695
|
+
var sourceFile = ts.getSourceFileOfNode(forInOrOfStatement);
|
|
75935
75696
|
if (ts.isInTopLevelContext(forInOrOfStatement)) {
|
|
75936
75697
|
if (!hasParseDiagnostics(sourceFile)) {
|
|
75937
75698
|
if (!ts.isEffectiveExternalModule(sourceFile, compilerOptions)) {
|
|
@@ -76266,7 +76027,7 @@ var ts;
|
|
|
76266
76027
|
: ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context;
|
|
76267
76028
|
return grammarErrorOnNode(node.exclamationToken, message);
|
|
76268
76029
|
}
|
|
76269
|
-
if ((moduleKind < ts.ModuleKind.ES2015 || getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS) && moduleKind !== ts.ModuleKind.System &&
|
|
76030
|
+
if ((moduleKind < ts.ModuleKind.ES2015 || ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS) && moduleKind !== ts.ModuleKind.System &&
|
|
76270
76031
|
!(node.parent.parent.flags & 16777216) && ts.hasSyntacticModifier(node.parent.parent, 1)) {
|
|
76271
76032
|
checkESModuleMarker(node.name);
|
|
76272
76033
|
}
|
|
@@ -76361,7 +76122,7 @@ var ts;
|
|
|
76361
76122
|
return sourceFile.parseDiagnostics.length > 0;
|
|
76362
76123
|
}
|
|
76363
76124
|
function grammarErrorOnFirstToken(node, message, arg0, arg1, arg2) {
|
|
76364
|
-
var sourceFile = getSourceFileOfNode(node);
|
|
76125
|
+
var sourceFile = ts.getSourceFileOfNode(node);
|
|
76365
76126
|
if (!hasParseDiagnostics(sourceFile)) {
|
|
76366
76127
|
var span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos);
|
|
76367
76128
|
diagnostics.add(ts.createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2));
|
|
@@ -76370,7 +76131,7 @@ var ts;
|
|
|
76370
76131
|
return false;
|
|
76371
76132
|
}
|
|
76372
76133
|
function grammarErrorAtPos(nodeForSourceFile, start, length, message, arg0, arg1, arg2) {
|
|
76373
|
-
var sourceFile = getSourceFileOfNode(nodeForSourceFile);
|
|
76134
|
+
var sourceFile = ts.getSourceFileOfNode(nodeForSourceFile);
|
|
76374
76135
|
if (!hasParseDiagnostics(sourceFile)) {
|
|
76375
76136
|
diagnostics.add(ts.createFileDiagnostic(sourceFile, start, length, message, arg0, arg1, arg2));
|
|
76376
76137
|
return true;
|
|
@@ -76378,7 +76139,7 @@ var ts;
|
|
|
76378
76139
|
return false;
|
|
76379
76140
|
}
|
|
76380
76141
|
function grammarErrorOnNodeSkippedOn(key, node, message, arg0, arg1, arg2) {
|
|
76381
|
-
var sourceFile = getSourceFileOfNode(node);
|
|
76142
|
+
var sourceFile = ts.getSourceFileOfNode(node);
|
|
76382
76143
|
if (!hasParseDiagnostics(sourceFile)) {
|
|
76383
76144
|
errorSkippedOn(key, node, message, arg0, arg1, arg2);
|
|
76384
76145
|
return true;
|
|
@@ -76386,7 +76147,7 @@ var ts;
|
|
|
76386
76147
|
return false;
|
|
76387
76148
|
}
|
|
76388
76149
|
function grammarErrorOnNode(node, message, arg0, arg1, arg2) {
|
|
76389
|
-
var sourceFile = getSourceFileOfNode(node);
|
|
76150
|
+
var sourceFile = ts.getSourceFileOfNode(node);
|
|
76390
76151
|
if (!hasParseDiagnostics(sourceFile)) {
|
|
76391
76152
|
diagnostics.add(ts.createDiagnosticForNode(node, message, arg0, arg1, arg2));
|
|
76392
76153
|
return true;
|
|
@@ -76397,7 +76158,7 @@ var ts;
|
|
|
76397
76158
|
var jsdocTypeParameters = ts.isInJSFile(node) ? ts.getJSDocTypeParameterDeclarations(node) : undefined;
|
|
76398
76159
|
var range = node.typeParameters || jsdocTypeParameters && ts.firstOrUndefined(jsdocTypeParameters);
|
|
76399
76160
|
if (range) {
|
|
76400
|
-
var pos = range.pos === range.end ? range.pos : ts.skipTrivia(getSourceFileOfNode(node).text, range.pos);
|
|
76161
|
+
var pos = range.pos === range.end ? range.pos : ts.skipTrivia(ts.getSourceFileOfNode(node).text, range.pos);
|
|
76401
76162
|
return grammarErrorAtPos(node, pos, range.end - pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration);
|
|
76402
76163
|
}
|
|
76403
76164
|
}
|
|
@@ -76543,7 +76304,7 @@ var ts;
|
|
|
76543
76304
|
return false;
|
|
76544
76305
|
}
|
|
76545
76306
|
function grammarErrorAfterFirstToken(node, message, arg0, arg1, arg2) {
|
|
76546
|
-
var sourceFile = getSourceFileOfNode(node);
|
|
76307
|
+
var sourceFile = ts.getSourceFileOfNode(node);
|
|
76547
76308
|
if (!hasParseDiagnostics(sourceFile)) {
|
|
76548
76309
|
var span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos);
|
|
76549
76310
|
diagnostics.add(ts.createFileDiagnostic(sourceFile, ts.textSpanEnd(span), 0, message, arg0, arg1, arg2));
|
|
@@ -79067,7 +78828,7 @@ var ts;
|
|
|
79067
78828
|
}
|
|
79068
78829
|
}
|
|
79069
78830
|
function visitSourceFile(node) {
|
|
79070
|
-
var alwaysStrict = ts.getStrictOptionValue(
|
|
78831
|
+
var alwaysStrict = ts.getStrictOptionValue(compilerOptions, "alwaysStrict") &&
|
|
79071
78832
|
!(ts.isExternalModule(node) && moduleKind >= ts.ModuleKind.ES2015) &&
|
|
79072
78833
|
!ts.isJsonSourceFile(node);
|
|
79073
78834
|
return factory.updateSourceFile(node, ts.visitLexicalEnvironment(node.statements, sourceElementVisitor, context, 0, alwaysStrict));
|
|
@@ -81388,6 +81149,7 @@ var ts;
|
|
|
81388
81149
|
var resolver = context.getEmitResolver();
|
|
81389
81150
|
var compilerOptions = context.getCompilerOptions();
|
|
81390
81151
|
var languageVersion = ts.getEmitScriptTarget(compilerOptions);
|
|
81152
|
+
var strictNullChecks = ts.getStrictOptionValue(compilerOptions, "strictNullChecks");
|
|
81391
81153
|
var currentLexicalScope;
|
|
81392
81154
|
var currentNameScope;
|
|
81393
81155
|
return {
|
|
@@ -81588,7 +81350,7 @@ var ts;
|
|
|
81588
81350
|
if (typeNode.kind === 130) {
|
|
81589
81351
|
return ts.factory.createIdentifier("Object");
|
|
81590
81352
|
}
|
|
81591
|
-
if (!
|
|
81353
|
+
if (!strictNullChecks && ((ts.isLiteralTypeNode(typeNode) && typeNode.literal.kind === 104) || typeNode.kind === 154)) {
|
|
81592
81354
|
continue;
|
|
81593
81355
|
}
|
|
81594
81356
|
var serializedConstituent = serializeTypeNode(typeNode);
|
|
@@ -87971,7 +87733,7 @@ var ts;
|
|
|
87971
87733
|
function transformCommonJSModule(node) {
|
|
87972
87734
|
startLexicalEnvironment();
|
|
87973
87735
|
var statements = [];
|
|
87974
|
-
var ensureUseStrict = ts.getStrictOptionValue(
|
|
87736
|
+
var ensureUseStrict = ts.getStrictOptionValue(compilerOptions, "alwaysStrict") || (!compilerOptions.noImplicitUseStrict && ts.isExternalModule(currentSourceFile));
|
|
87975
87737
|
var statementOffset = factory.copyPrologue(node.statements, statements, ensureUseStrict && !ts.isJsonSourceFile(node), topLevelVisitor);
|
|
87976
87738
|
if (shouldEmitUnderscoreUnderscoreESModule()) {
|
|
87977
87739
|
ts.append(statements, createUnderscoreUnderscoreESModule());
|
|
@@ -88990,7 +88752,7 @@ var ts;
|
|
|
88990
88752
|
function createSystemModuleBody(node, dependencyGroups) {
|
|
88991
88753
|
var statements = [];
|
|
88992
88754
|
startLexicalEnvironment();
|
|
88993
|
-
var ensureUseStrict = ts.getStrictOptionValue(
|
|
88755
|
+
var ensureUseStrict = ts.getStrictOptionValue(compilerOptions, "alwaysStrict") || (!compilerOptions.noImplicitUseStrict && ts.isExternalModule(currentSourceFile));
|
|
88994
88756
|
var statementOffset = factory.copyPrologue(node.statements, statements, ensureUseStrict, topLevelVisitor);
|
|
88995
88757
|
statements.push(factory.createVariableStatement(undefined, factory.createVariableDeclarationList([
|
|
88996
88758
|
factory.createVariableDeclaration("__moduleName", undefined, undefined, factory.createLogicalAnd(contextObject, factory.createPropertyAccessExpression(contextObject, "id")))
|
|
@@ -99928,7 +99690,7 @@ var ts;
|
|
|
99928
99690
|
}
|
|
99929
99691
|
var elideImport = isJsFileFromNodeModules && currentNodeModulesDepth > maxNodeModuleJsDepth;
|
|
99930
99692
|
var shouldAddFile = resolvedFileName
|
|
99931
|
-
&& !getResolutionDiagnostic(
|
|
99693
|
+
&& !getResolutionDiagnostic(optionsForFile, resolution)
|
|
99932
99694
|
&& !optionsForFile.noResolve
|
|
99933
99695
|
&& index < file.imports.length
|
|
99934
99696
|
&& !elideImport
|
|
@@ -100009,10 +99771,10 @@ var ts;
|
|
|
100009
99771
|
return resolvedRef;
|
|
100010
99772
|
}
|
|
100011
99773
|
function verifyCompilerOptions() {
|
|
100012
|
-
if (options.strictPropertyInitialization && !ts.getStrictOptionValue(
|
|
99774
|
+
if (options.strictPropertyInitialization && !ts.getStrictOptionValue(options, "strictNullChecks")) {
|
|
100013
99775
|
createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "strictPropertyInitialization", "strictNullChecks");
|
|
100014
99776
|
}
|
|
100015
|
-
if (options.exactOptionalPropertyTypes && !ts.getStrictOptionValue(
|
|
99777
|
+
if (options.exactOptionalPropertyTypes && !ts.getStrictOptionValue(options, "strictNullChecks")) {
|
|
100016
99778
|
createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "exactOptionalPropertyTypes", "strictNullChecks");
|
|
100017
99779
|
}
|
|
100018
99780
|
if (options.isolatedModules) {
|
|
@@ -100120,7 +99882,7 @@ var ts;
|
|
|
100120
99882
|
if (options.lib && options.noLib) {
|
|
100121
99883
|
createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "lib", "noLib");
|
|
100122
99884
|
}
|
|
100123
|
-
if (options.noImplicitUseStrict && ts.getStrictOptionValue(
|
|
99885
|
+
if (options.noImplicitUseStrict && ts.getStrictOptionValue(options, "alwaysStrict")) {
|
|
100124
99886
|
createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "noImplicitUseStrict", "alwaysStrict");
|
|
100125
99887
|
}
|
|
100126
99888
|
var languageVersion = ts.getEmitScriptTarget(options);
|
|
@@ -100236,19 +99998,6 @@ var ts;
|
|
|
100236
99998
|
verifyEmitFilePath(emitFileNames.declarationFilePath, emitFilesSeen_1);
|
|
100237
99999
|
});
|
|
100238
100000
|
}
|
|
100239
|
-
for (var _a = 0, files_5 = files; _a < files_5.length; _a++) {
|
|
100240
|
-
var file = files_5[_a];
|
|
100241
|
-
var entries = file.pragmas.entries();
|
|
100242
|
-
for (var result = entries.next(); !result.done; result = entries.next()) {
|
|
100243
|
-
var _b = result.value, key = _b[0], value = _b[1];
|
|
100244
|
-
if (ts.startsWith(key, "ts-") && key !== "ts-check" && key !== "ts-nocheck" && ts.isArray(value)) {
|
|
100245
|
-
for (var _c = 0, value_3 = value; _c < value_3.length; _c++) {
|
|
100246
|
-
var elem = value_3[_c];
|
|
100247
|
-
programDiagnostics.add(ts.createDiagnosticForRange(file, elem.range, ts.Diagnostics.Duplicate_local_compiler_option_0, key.slice(3)));
|
|
100248
|
-
}
|
|
100249
|
-
}
|
|
100250
|
-
}
|
|
100251
|
-
}
|
|
100252
100001
|
function verifyEmitFilePath(emitFileName, emitFilesSeen) {
|
|
100253
100002
|
if (emitFileName) {
|
|
100254
100003
|
var emitFilePath = toPath(emitFileName);
|
|
@@ -100770,7 +100519,7 @@ var ts;
|
|
|
100770
100519
|
return ts.resolveConfigFileProjectName(passedInRef.path);
|
|
100771
100520
|
}
|
|
100772
100521
|
ts.resolveProjectReferencePath = resolveProjectReferencePath;
|
|
100773
|
-
function getResolutionDiagnostic(
|
|
100522
|
+
function getResolutionDiagnostic(options, _a) {
|
|
100774
100523
|
var extension = _a.extension;
|
|
100775
100524
|
switch (extension) {
|
|
100776
100525
|
case ".ts":
|
|
@@ -100789,7 +100538,7 @@ var ts;
|
|
|
100789
100538
|
return options.jsx ? undefined : ts.Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set;
|
|
100790
100539
|
}
|
|
100791
100540
|
function needAllowJs() {
|
|
100792
|
-
return ts.getAllowJSCompilerOption(options) || !ts.getStrictOptionValue(
|
|
100541
|
+
return ts.getAllowJSCompilerOption(options) || !ts.getStrictOptionValue(options, "noImplicitAny") ? undefined : ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type;
|
|
100793
100542
|
}
|
|
100794
100543
|
function needResolveJsonModule() {
|
|
100795
100544
|
return options.resolveJsonModule ? undefined : ts.Diagnostics.Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used;
|
|
@@ -101428,10 +101177,10 @@ var ts;
|
|
|
101428
101177
|
if (!state.cleanedDiagnosticsOfLibFiles) {
|
|
101429
101178
|
state.cleanedDiagnosticsOfLibFiles = true;
|
|
101430
101179
|
var program_1 = ts.Debug.checkDefined(state.program);
|
|
101431
|
-
var
|
|
101180
|
+
var options_2 = program_1.getCompilerOptions();
|
|
101432
101181
|
ts.forEach(program_1.getSourceFiles(), function (f) {
|
|
101433
101182
|
return program_1.isSourceFileDefaultLibrary(f) &&
|
|
101434
|
-
!ts.skipTypeChecking(f,
|
|
101183
|
+
!ts.skipTypeChecking(f, options_2, program_1) &&
|
|
101435
101184
|
removeSemanticDiagnosticsOf(state, f.resolvedPath);
|
|
101436
101185
|
});
|
|
101437
101186
|
}
|
|
@@ -103356,7 +103105,7 @@ var ts;
|
|
|
103356
103105
|
importedFileFromNodeModules = importedFileFromNodeModules || isInNodeModules;
|
|
103357
103106
|
});
|
|
103358
103107
|
var sortedPaths = [];
|
|
103359
|
-
var
|
|
103108
|
+
var _loop_35 = function (directory) {
|
|
103360
103109
|
var directoryStart = ts.ensureTrailingDirectorySeparator(directory);
|
|
103361
103110
|
var pathsInDirectory;
|
|
103362
103111
|
allFileNames.forEach(function (_a, fileName) {
|
|
@@ -103380,9 +103129,9 @@ var ts;
|
|
|
103380
103129
|
};
|
|
103381
103130
|
var out_directory_1;
|
|
103382
103131
|
for (var directory = ts.getDirectoryPath(importingFileName); allFileNames.size !== 0;) {
|
|
103383
|
-
var
|
|
103132
|
+
var state_11 = _loop_35(directory);
|
|
103384
103133
|
directory = out_directory_1;
|
|
103385
|
-
if (
|
|
103134
|
+
if (state_11 === "break")
|
|
103386
103135
|
break;
|
|
103387
103136
|
}
|
|
103388
103137
|
if (allFileNames.size) {
|
|
@@ -103441,7 +103190,7 @@ var ts;
|
|
|
103441
103190
|
}
|
|
103442
103191
|
function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, host, compilerOptions) {
|
|
103443
103192
|
for (var key in paths) {
|
|
103444
|
-
var
|
|
103193
|
+
var _loop_36 = function (patternText_1) {
|
|
103445
103194
|
var pattern = ts.normalizePath(patternText_1);
|
|
103446
103195
|
var indexOfStar = pattern.indexOf("*");
|
|
103447
103196
|
var candidates = allowedEndings.map(function (ending) { return ({
|
|
@@ -103472,9 +103221,9 @@ var ts;
|
|
|
103472
103221
|
};
|
|
103473
103222
|
for (var _i = 0, _a = paths[key]; _i < _a.length; _i++) {
|
|
103474
103223
|
var patternText_1 = _a[_i];
|
|
103475
|
-
var
|
|
103476
|
-
if (typeof
|
|
103477
|
-
return
|
|
103224
|
+
var state_12 = _loop_36(patternText_1);
|
|
103225
|
+
if (typeof state_12 === "object")
|
|
103226
|
+
return state_12.value;
|
|
103478
103227
|
}
|
|
103479
103228
|
}
|
|
103480
103229
|
function validateEnding(_a) {
|