@typescript-deploys/pr-build 4.8.0-pr-49863-9 → 4.8.0-pr-49886-8
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 +470 -344
- package/lib/tsserver.js +494 -352
- package/lib/tsserverlibrary.d.ts +0 -1
- package/lib/tsserverlibrary.js +494 -352
- package/lib/typescript.d.ts +0 -1
- package/lib/typescript.js +494 -352
- package/lib/typescriptServices.d.ts +0 -1
- package/lib/typescriptServices.js +494 -352
- package/lib/typingsInstaller.js +476 -349
- 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.8";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-insiders.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-insiders.20220713";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -2050,6 +2050,10 @@ var ts;
|
|
|
2050
2050
|
}
|
|
2051
2051
|
return s.slice(0, end + 1);
|
|
2052
2052
|
}
|
|
2053
|
+
function is() {
|
|
2054
|
+
return identity;
|
|
2055
|
+
}
|
|
2056
|
+
ts.is = is;
|
|
2053
2057
|
})(ts || (ts = {}));
|
|
2054
2058
|
var ts;
|
|
2055
2059
|
(function (ts) {
|
|
@@ -3563,48 +3567,6 @@ var ts;
|
|
|
3563
3567
|
ModuleKind[ModuleKind["Node16"] = 100] = "Node16";
|
|
3564
3568
|
ModuleKind[ModuleKind["NodeNext"] = 199] = "NodeNext";
|
|
3565
3569
|
})(ModuleKind = ts.ModuleKind || (ts.ModuleKind = {}));
|
|
3566
|
-
ts.commentPragmas = {
|
|
3567
|
-
"reference": {
|
|
3568
|
-
args: [
|
|
3569
|
-
{ name: "types", optional: true, captureSpan: true },
|
|
3570
|
-
{ name: "lib", optional: true, captureSpan: true },
|
|
3571
|
-
{ name: "path", optional: true, captureSpan: true },
|
|
3572
|
-
{ name: "no-default-lib", optional: true },
|
|
3573
|
-
{ name: "resolution-mode", optional: true }
|
|
3574
|
-
],
|
|
3575
|
-
kind: 1
|
|
3576
|
-
},
|
|
3577
|
-
"amd-dependency": {
|
|
3578
|
-
args: [{ name: "path" }, { name: "name", optional: true }],
|
|
3579
|
-
kind: 1
|
|
3580
|
-
},
|
|
3581
|
-
"amd-module": {
|
|
3582
|
-
args: [{ name: "name" }],
|
|
3583
|
-
kind: 1
|
|
3584
|
-
},
|
|
3585
|
-
"ts-check": {
|
|
3586
|
-
kind: 2
|
|
3587
|
-
},
|
|
3588
|
-
"ts-nocheck": {
|
|
3589
|
-
kind: 2
|
|
3590
|
-
},
|
|
3591
|
-
"jsx": {
|
|
3592
|
-
args: [{ name: "factory" }],
|
|
3593
|
-
kind: 4
|
|
3594
|
-
},
|
|
3595
|
-
"jsxfrag": {
|
|
3596
|
-
args: [{ name: "factory" }],
|
|
3597
|
-
kind: 4
|
|
3598
|
-
},
|
|
3599
|
-
"jsximportsource": {
|
|
3600
|
-
args: [{ name: "factory" }],
|
|
3601
|
-
kind: 4
|
|
3602
|
-
},
|
|
3603
|
-
"jsxruntime": {
|
|
3604
|
-
args: [{ name: "factory" }],
|
|
3605
|
-
kind: 4
|
|
3606
|
-
},
|
|
3607
|
-
};
|
|
3608
3570
|
})(ts || (ts = {}));
|
|
3609
3571
|
var ts;
|
|
3610
3572
|
(function (ts) {
|
|
@@ -6809,7 +6771,6 @@ var ts;
|
|
|
6809
6771
|
Require_undeclared_properties_from_index_signatures_to_use_element_accesses: diag(6717, ts.DiagnosticCategory.Message, "Require_undeclared_properties_from_index_signatures_to_use_element_accesses_6717", "Require undeclared properties from index signatures to use element accesses."),
|
|
6810
6772
|
Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types: diag(6718, ts.DiagnosticCategory.Message, "Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718", "Specify emit/checking behavior for imports that are only used for types."),
|
|
6811
6773
|
Default_catch_clause_variables_as_unknown_instead_of_any: diag(6803, ts.DiagnosticCategory.Message, "Default_catch_clause_variables_as_unknown_instead_of_any_6803", "Default catch clause variables as 'unknown' instead of 'any'."),
|
|
6812
|
-
Default_type_arguments_to_parameter_constraint_or_unknown_instead_of_any: diag(6804, ts.DiagnosticCategory.Message, "Default_type_arguments_to_parameter_constraint_or_unknown_instead_of_any_6804", "Default type arguments to parameter constraint or 'unknown' instead of 'any'."),
|
|
6813
6774
|
one_of_Colon: diag(6900, ts.DiagnosticCategory.Message, "one_of_Colon_6900", "one of:"),
|
|
6814
6775
|
one_or_more_Colon: diag(6901, ts.DiagnosticCategory.Message, "one_or_more_Colon_6901", "one or more:"),
|
|
6815
6776
|
type_Colon: diag(6902, ts.DiagnosticCategory.Message, "type_Colon_6902", "type:"),
|
|
@@ -11558,7 +11519,7 @@ var ts;
|
|
|
11558
11519
|
if (node.isDeclarationFile) {
|
|
11559
11520
|
return false;
|
|
11560
11521
|
}
|
|
11561
|
-
if (getStrictOptionValue(compilerOptions, "alwaysStrict")) {
|
|
11522
|
+
if (getStrictOptionValue(node, compilerOptions, "alwaysStrict")) {
|
|
11562
11523
|
return true;
|
|
11563
11524
|
}
|
|
11564
11525
|
if (ts.startsWithUseStrict(node.statements)) {
|
|
@@ -16171,8 +16132,17 @@ var ts;
|
|
|
16171
16132
|
return !!(options.incremental || options.composite);
|
|
16172
16133
|
}
|
|
16173
16134
|
ts.isIncrementalCompilation = isIncrementalCompilation;
|
|
16174
|
-
function
|
|
16175
|
-
|
|
16135
|
+
function getFileLocalCompilerOption(file, opts, name, isStrictFlag) {
|
|
16136
|
+
var localStrictValue = ((file === null || file === void 0 ? void 0 : file.localOptions) && ts.hasProperty(file.localOptions, "strict")) ? file.localOptions.strict : undefined;
|
|
16137
|
+
var strict = localStrictValue === undefined ? opts.strict : localStrictValue;
|
|
16138
|
+
if ((file === null || file === void 0 ? void 0 : file.localOptions) && ts.hasProperty(file.localOptions, name)) {
|
|
16139
|
+
return file.localOptions[name] !== undefined ? file.localOptions[name] : opts[name] !== undefined ? opts[name] : isStrictFlag ? strict : undefined;
|
|
16140
|
+
}
|
|
16141
|
+
return opts[name] !== undefined ? opts[name] : isStrictFlag ? strict : undefined;
|
|
16142
|
+
}
|
|
16143
|
+
ts.getFileLocalCompilerOption = getFileLocalCompilerOption;
|
|
16144
|
+
function getStrictOptionValue(file, compilerOptions, flag) {
|
|
16145
|
+
return !!getFileLocalCompilerOption(file, compilerOptions, flag, true);
|
|
16176
16146
|
}
|
|
16177
16147
|
ts.getStrictOptionValue = getStrictOptionValue;
|
|
16178
16148
|
function getAllowJSCompilerOption(compilerOptions) {
|
|
@@ -16196,7 +16166,7 @@ var ts;
|
|
|
16196
16166
|
}
|
|
16197
16167
|
ts.compilerOptionsAffectDeclarationPath = compilerOptionsAffectDeclarationPath;
|
|
16198
16168
|
function getCompilerOptionValue(options, option) {
|
|
16199
|
-
return option.strictFlag ?
|
|
16169
|
+
return option.strictFlag ? options[option.name] === undefined ? !!options.strict : !!options[option.name] : options[option.name];
|
|
16200
16170
|
}
|
|
16201
16171
|
ts.getCompilerOptionValue = getCompilerOptionValue;
|
|
16202
16172
|
function getJSXTransformEnabled(options) {
|
|
@@ -31714,6 +31684,7 @@ var ts;
|
|
|
31714
31684
|
context.amdDependencies = [];
|
|
31715
31685
|
context.hasNoDefaultLib = false;
|
|
31716
31686
|
context.pragmas.forEach(function (entryOrList, key) {
|
|
31687
|
+
var _a;
|
|
31717
31688
|
switch (key) {
|
|
31718
31689
|
case "reference": {
|
|
31719
31690
|
var referencedFiles_1 = context.referencedFiles;
|
|
@@ -31772,12 +31743,55 @@ var ts;
|
|
|
31772
31743
|
});
|
|
31773
31744
|
break;
|
|
31774
31745
|
}
|
|
31746
|
+
case "ts-strict":
|
|
31747
|
+
case "ts-noimplicitany":
|
|
31748
|
+
case "ts-strictnullchecks":
|
|
31749
|
+
case "ts-strictfunctiontypes":
|
|
31750
|
+
case "ts-strictbindcallapply":
|
|
31751
|
+
case "ts-noimplicitthis":
|
|
31752
|
+
case "ts-strictpropertyinitialization":
|
|
31753
|
+
case "ts-useunknownincatchvariables":
|
|
31754
|
+
case "ts-alwaysstrict":
|
|
31755
|
+
case "ts-nounusedlocals":
|
|
31756
|
+
case "ts-nounusedparameters":
|
|
31757
|
+
case "ts-exactoptionalpropertytypes":
|
|
31758
|
+
case "ts-nopropertyaccessfromindexsignature":
|
|
31759
|
+
case "ts-noimplicitreturns":
|
|
31760
|
+
case "ts-nofallthroughcasesinswitch":
|
|
31761
|
+
case "ts-nouncheckedindexedaccess":
|
|
31762
|
+
case "ts-noimplicitoverride": {
|
|
31763
|
+
var optName_1 = key.slice(3);
|
|
31764
|
+
var opt = ts.find(ts.optionsAllowedAsPragmaOption, function (o) { return o.name.toLowerCase() === optName_1; });
|
|
31765
|
+
var entry = (ts.isArray(entryOrList) ? ts.last(entryOrList) : entryOrList);
|
|
31766
|
+
var unparsedValue = entry.arguments.value;
|
|
31767
|
+
var optContainer = {};
|
|
31768
|
+
var errors = [];
|
|
31769
|
+
var parsedValue = unparsedValue === undefined ? true : (ts.parseOptionValue([unparsedValue], 0, undefined, opt, optContainer, errors), optContainer[opt.name]);
|
|
31770
|
+
if (unparsedValue === undefined && opt.type !== "boolean") {
|
|
31771
|
+
errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_expects_an_argument, optName_1));
|
|
31772
|
+
}
|
|
31773
|
+
for (var _b = 0, errors_1 = errors; _b < errors_1.length; _b++) {
|
|
31774
|
+
var err = errors_1[_b];
|
|
31775
|
+
reportDiagnostic(entry.range.pos, entry.range.end - entry.range.pos, {
|
|
31776
|
+
category: err.category,
|
|
31777
|
+
code: err.code,
|
|
31778
|
+
message: err.messageText,
|
|
31779
|
+
reportsDeprecated: err.reportsDeprecated,
|
|
31780
|
+
reportsUnnecessary: err.reportsUnnecessary,
|
|
31781
|
+
key: err.messageText
|
|
31782
|
+
});
|
|
31783
|
+
}
|
|
31784
|
+
if (!ts.length(errors)) {
|
|
31785
|
+
((_a = context.localOptions) !== null && _a !== void 0 ? _a : (context.localOptions = {}))[opt.name] = parsedValue;
|
|
31786
|
+
}
|
|
31787
|
+
break;
|
|
31788
|
+
}
|
|
31775
31789
|
case "jsx":
|
|
31776
31790
|
case "jsxfrag":
|
|
31777
31791
|
case "jsximportsource":
|
|
31778
31792
|
case "jsxruntime":
|
|
31779
31793
|
return;
|
|
31780
|
-
default: ts.Debug.
|
|
31794
|
+
default: ts.Debug.assertNever(key, "Unhandled pragma kind: " + key);
|
|
31781
31795
|
}
|
|
31782
31796
|
});
|
|
31783
31797
|
}
|
|
@@ -31899,6 +31913,7 @@ var ts;
|
|
|
31899
31913
|
name: "compileOnSave",
|
|
31900
31914
|
type: "boolean",
|
|
31901
31915
|
defaultValueDescription: false,
|
|
31916
|
+
category: ts.Diagnostics.Editor_Support
|
|
31902
31917
|
};
|
|
31903
31918
|
var jsxOptionMap = new ts.Map(ts.getEntries({
|
|
31904
31919
|
"preserve": 1,
|
|
@@ -32034,6 +32049,7 @@ var ts;
|
|
|
32034
32049
|
type: "list",
|
|
32035
32050
|
element: {
|
|
32036
32051
|
name: "excludeDirectory",
|
|
32052
|
+
category: ts.Diagnostics.Watch_and_Build_Modes,
|
|
32037
32053
|
type: "string",
|
|
32038
32054
|
isFilePath: true,
|
|
32039
32055
|
extraValidation: specToDiagnostic
|
|
@@ -32046,6 +32062,7 @@ var ts;
|
|
|
32046
32062
|
type: "list",
|
|
32047
32063
|
element: {
|
|
32048
32064
|
name: "excludeFile",
|
|
32065
|
+
category: ts.Diagnostics.Watch_and_Build_Modes,
|
|
32049
32066
|
type: "string",
|
|
32050
32067
|
isFilePath: true,
|
|
32051
32068
|
extraValidation: specToDiagnostic
|
|
@@ -32054,7 +32071,7 @@ var ts;
|
|
|
32054
32071
|
description: ts.Diagnostics.Remove_a_list_of_files_from_the_watch_mode_s_processing,
|
|
32055
32072
|
},
|
|
32056
32073
|
];
|
|
32057
|
-
ts.commonOptionsWithBuild = [
|
|
32074
|
+
ts.commonOptionsWithBuild = ts.is()([
|
|
32058
32075
|
{
|
|
32059
32076
|
name: "help",
|
|
32060
32077
|
shortName: "h",
|
|
@@ -32069,6 +32086,7 @@ var ts;
|
|
|
32069
32086
|
shortName: "?",
|
|
32070
32087
|
type: "boolean",
|
|
32071
32088
|
defaultValueDescription: false,
|
|
32089
|
+
category: ts.Diagnostics.Command_line_Options,
|
|
32072
32090
|
},
|
|
32073
32091
|
{
|
|
32074
32092
|
name: "watch",
|
|
@@ -32183,8 +32201,8 @@ var ts;
|
|
|
32183
32201
|
description: ts.Diagnostics.Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit,
|
|
32184
32202
|
defaultValueDescription: ts.Diagnostics.Platform_specific
|
|
32185
32203
|
},
|
|
32186
|
-
];
|
|
32187
|
-
ts.targetOptionDeclaration = {
|
|
32204
|
+
]);
|
|
32205
|
+
ts.targetOptionDeclaration = ts.is()({
|
|
32188
32206
|
name: "target",
|
|
32189
32207
|
shortName: "t",
|
|
32190
32208
|
type: new ts.Map(ts.getEntries({
|
|
@@ -32210,8 +32228,8 @@ var ts;
|
|
|
32210
32228
|
category: ts.Diagnostics.Language_and_Environment,
|
|
32211
32229
|
description: ts.Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,
|
|
32212
32230
|
defaultValueDescription: 0,
|
|
32213
|
-
};
|
|
32214
|
-
ts.moduleOptionDeclaration = {
|
|
32231
|
+
});
|
|
32232
|
+
ts.moduleOptionDeclaration = ts.is()({
|
|
32215
32233
|
name: "module",
|
|
32216
32234
|
shortName: "m",
|
|
32217
32235
|
type: new ts.Map(ts.getEntries({
|
|
@@ -32236,8 +32254,8 @@ var ts;
|
|
|
32236
32254
|
category: ts.Diagnostics.Modules,
|
|
32237
32255
|
description: ts.Diagnostics.Specify_what_module_code_is_generated,
|
|
32238
32256
|
defaultValueDescription: undefined,
|
|
32239
|
-
};
|
|
32240
|
-
var commandOptionsWithoutBuild = [
|
|
32257
|
+
});
|
|
32258
|
+
var commandOptionsWithoutBuild = ts.is()([
|
|
32241
32259
|
{
|
|
32242
32260
|
name: "all",
|
|
32243
32261
|
type: "boolean",
|
|
@@ -32310,6 +32328,7 @@ var ts;
|
|
|
32310
32328
|
element: {
|
|
32311
32329
|
name: "lib",
|
|
32312
32330
|
type: ts.libMap,
|
|
32331
|
+
category: ts.Diagnostics.Language_and_Environment,
|
|
32313
32332
|
defaultValueDescription: undefined,
|
|
32314
32333
|
},
|
|
32315
32334
|
affectsProgramStructure: true,
|
|
@@ -32522,6 +32541,7 @@ var ts;
|
|
|
32522
32541
|
category: ts.Diagnostics.Type_Checking,
|
|
32523
32542
|
description: ts.Diagnostics.Enable_all_strict_type_checking_options,
|
|
32524
32543
|
defaultValueDescription: false,
|
|
32544
|
+
allowedAsPragma: true,
|
|
32525
32545
|
},
|
|
32526
32546
|
{
|
|
32527
32547
|
name: "noImplicitAny",
|
|
@@ -32531,7 +32551,8 @@ var ts;
|
|
|
32531
32551
|
strictFlag: true,
|
|
32532
32552
|
category: ts.Diagnostics.Type_Checking,
|
|
32533
32553
|
description: ts.Diagnostics.Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type,
|
|
32534
|
-
defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set
|
|
32554
|
+
defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set,
|
|
32555
|
+
allowedAsPragma: true,
|
|
32535
32556
|
},
|
|
32536
32557
|
{
|
|
32537
32558
|
name: "strictNullChecks",
|
|
@@ -32541,7 +32562,8 @@ var ts;
|
|
|
32541
32562
|
strictFlag: true,
|
|
32542
32563
|
category: ts.Diagnostics.Type_Checking,
|
|
32543
32564
|
description: ts.Diagnostics.When_type_checking_take_into_account_null_and_undefined,
|
|
32544
|
-
defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set
|
|
32565
|
+
defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set,
|
|
32566
|
+
allowedAsPragma: true,
|
|
32545
32567
|
},
|
|
32546
32568
|
{
|
|
32547
32569
|
name: "strictFunctionTypes",
|
|
@@ -32551,7 +32573,8 @@ var ts;
|
|
|
32551
32573
|
strictFlag: true,
|
|
32552
32574
|
category: ts.Diagnostics.Type_Checking,
|
|
32553
32575
|
description: ts.Diagnostics.When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible,
|
|
32554
|
-
defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set
|
|
32576
|
+
defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set,
|
|
32577
|
+
allowedAsPragma: true,
|
|
32555
32578
|
},
|
|
32556
32579
|
{
|
|
32557
32580
|
name: "strictBindCallApply",
|
|
@@ -32561,7 +32584,8 @@ var ts;
|
|
|
32561
32584
|
strictFlag: true,
|
|
32562
32585
|
category: ts.Diagnostics.Type_Checking,
|
|
32563
32586
|
description: ts.Diagnostics.Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function,
|
|
32564
|
-
defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set
|
|
32587
|
+
defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set,
|
|
32588
|
+
allowedAsPragma: true,
|
|
32565
32589
|
},
|
|
32566
32590
|
{
|
|
32567
32591
|
name: "strictPropertyInitialization",
|
|
@@ -32571,7 +32595,8 @@ var ts;
|
|
|
32571
32595
|
strictFlag: true,
|
|
32572
32596
|
category: ts.Diagnostics.Type_Checking,
|
|
32573
32597
|
description: ts.Diagnostics.Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor,
|
|
32574
|
-
defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set
|
|
32598
|
+
defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set,
|
|
32599
|
+
allowedAsPragma: true,
|
|
32575
32600
|
},
|
|
32576
32601
|
{
|
|
32577
32602
|
name: "noImplicitThis",
|
|
@@ -32581,7 +32606,8 @@ var ts;
|
|
|
32581
32606
|
strictFlag: true,
|
|
32582
32607
|
category: ts.Diagnostics.Type_Checking,
|
|
32583
32608
|
description: ts.Diagnostics.Enable_error_reporting_when_this_is_given_the_type_any,
|
|
32584
|
-
defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set
|
|
32609
|
+
defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set,
|
|
32610
|
+
allowedAsPragma: true,
|
|
32585
32611
|
},
|
|
32586
32612
|
{
|
|
32587
32613
|
name: "useUnknownInCatchVariables",
|
|
@@ -32592,16 +32618,7 @@ var ts;
|
|
|
32592
32618
|
category: ts.Diagnostics.Type_Checking,
|
|
32593
32619
|
description: ts.Diagnostics.Default_catch_clause_variables_as_unknown_instead_of_any,
|
|
32594
32620
|
defaultValueDescription: false,
|
|
32595
|
-
|
|
32596
|
-
{
|
|
32597
|
-
name: "inferInstanceTypeArgumentsAsConstraint",
|
|
32598
|
-
type: "boolean",
|
|
32599
|
-
affectsSemanticDiagnostics: true,
|
|
32600
|
-
affectsMultiFileEmitBuildInfo: true,
|
|
32601
|
-
strictFlag: true,
|
|
32602
|
-
category: ts.Diagnostics.Type_Checking,
|
|
32603
|
-
description: ts.Diagnostics.Default_type_arguments_to_parameter_constraint_or_unknown_instead_of_any,
|
|
32604
|
-
defaultValueDescription: false,
|
|
32621
|
+
allowedAsPragma: true,
|
|
32605
32622
|
},
|
|
32606
32623
|
{
|
|
32607
32624
|
name: "alwaysStrict",
|
|
@@ -32612,7 +32629,8 @@ var ts;
|
|
|
32612
32629
|
strictFlag: true,
|
|
32613
32630
|
category: ts.Diagnostics.Type_Checking,
|
|
32614
32631
|
description: ts.Diagnostics.Ensure_use_strict_is_always_emitted,
|
|
32615
|
-
defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set
|
|
32632
|
+
defaultValueDescription: ts.Diagnostics.false_unless_strict_is_set,
|
|
32633
|
+
allowedAsPragma: true,
|
|
32616
32634
|
},
|
|
32617
32635
|
{
|
|
32618
32636
|
name: "noUnusedLocals",
|
|
@@ -32622,6 +32640,7 @@ var ts;
|
|
|
32622
32640
|
category: ts.Diagnostics.Type_Checking,
|
|
32623
32641
|
description: ts.Diagnostics.Enable_error_reporting_when_local_variables_aren_t_read,
|
|
32624
32642
|
defaultValueDescription: false,
|
|
32643
|
+
allowedAsPragma: true,
|
|
32625
32644
|
},
|
|
32626
32645
|
{
|
|
32627
32646
|
name: "noUnusedParameters",
|
|
@@ -32631,6 +32650,7 @@ var ts;
|
|
|
32631
32650
|
category: ts.Diagnostics.Type_Checking,
|
|
32632
32651
|
description: ts.Diagnostics.Raise_an_error_when_a_function_parameter_isn_t_read,
|
|
32633
32652
|
defaultValueDescription: false,
|
|
32653
|
+
allowedAsPragma: true,
|
|
32634
32654
|
},
|
|
32635
32655
|
{
|
|
32636
32656
|
name: "exactOptionalPropertyTypes",
|
|
@@ -32640,6 +32660,7 @@ var ts;
|
|
|
32640
32660
|
category: ts.Diagnostics.Type_Checking,
|
|
32641
32661
|
description: ts.Diagnostics.Interpret_optional_property_types_as_written_rather_than_adding_undefined,
|
|
32642
32662
|
defaultValueDescription: false,
|
|
32663
|
+
allowedAsPragma: true,
|
|
32643
32664
|
},
|
|
32644
32665
|
{
|
|
32645
32666
|
name: "noImplicitReturns",
|
|
@@ -32649,6 +32670,7 @@ var ts;
|
|
|
32649
32670
|
category: ts.Diagnostics.Type_Checking,
|
|
32650
32671
|
description: ts.Diagnostics.Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function,
|
|
32651
32672
|
defaultValueDescription: false,
|
|
32673
|
+
allowedAsPragma: true,
|
|
32652
32674
|
},
|
|
32653
32675
|
{
|
|
32654
32676
|
name: "noFallthroughCasesInSwitch",
|
|
@@ -32659,6 +32681,7 @@ var ts;
|
|
|
32659
32681
|
category: ts.Diagnostics.Type_Checking,
|
|
32660
32682
|
description: ts.Diagnostics.Enable_error_reporting_for_fallthrough_cases_in_switch_statements,
|
|
32661
32683
|
defaultValueDescription: false,
|
|
32684
|
+
allowedAsPragma: true,
|
|
32662
32685
|
},
|
|
32663
32686
|
{
|
|
32664
32687
|
name: "noUncheckedIndexedAccess",
|
|
@@ -32668,6 +32691,7 @@ var ts;
|
|
|
32668
32691
|
category: ts.Diagnostics.Type_Checking,
|
|
32669
32692
|
description: ts.Diagnostics.Add_undefined_to_a_type_when_accessed_using_an_index,
|
|
32670
32693
|
defaultValueDescription: false,
|
|
32694
|
+
allowedAsPragma: true,
|
|
32671
32695
|
},
|
|
32672
32696
|
{
|
|
32673
32697
|
name: "noImplicitOverride",
|
|
@@ -32677,6 +32701,7 @@ var ts;
|
|
|
32677
32701
|
category: ts.Diagnostics.Type_Checking,
|
|
32678
32702
|
description: ts.Diagnostics.Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier,
|
|
32679
32703
|
defaultValueDescription: false,
|
|
32704
|
+
allowedAsPragma: true,
|
|
32680
32705
|
},
|
|
32681
32706
|
{
|
|
32682
32707
|
name: "noPropertyAccessFromIndexSignature",
|
|
@@ -32687,6 +32712,7 @@ var ts;
|
|
|
32687
32712
|
category: ts.Diagnostics.Type_Checking,
|
|
32688
32713
|
description: ts.Diagnostics.Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type,
|
|
32689
32714
|
defaultValueDescription: false,
|
|
32715
|
+
allowedAsPragma: true,
|
|
32690
32716
|
},
|
|
32691
32717
|
{
|
|
32692
32718
|
name: "moduleResolution",
|
|
@@ -32726,6 +32752,7 @@ var ts;
|
|
|
32726
32752
|
element: {
|
|
32727
32753
|
name: "rootDirs",
|
|
32728
32754
|
type: "string",
|
|
32755
|
+
category: ts.Diagnostics.Modules,
|
|
32729
32756
|
isFilePath: true
|
|
32730
32757
|
},
|
|
32731
32758
|
affectsModuleResolution: true,
|
|
@@ -32740,6 +32767,7 @@ var ts;
|
|
|
32740
32767
|
element: {
|
|
32741
32768
|
name: "typeRoots",
|
|
32742
32769
|
type: "string",
|
|
32770
|
+
category: ts.Diagnostics.Modules,
|
|
32743
32771
|
isFilePath: true
|
|
32744
32772
|
},
|
|
32745
32773
|
affectsModuleResolution: true,
|
|
@@ -32751,6 +32779,7 @@ var ts;
|
|
|
32751
32779
|
type: "list",
|
|
32752
32780
|
element: {
|
|
32753
32781
|
name: "types",
|
|
32782
|
+
category: ts.Diagnostics.Modules,
|
|
32754
32783
|
type: "string"
|
|
32755
32784
|
},
|
|
32756
32785
|
affectsProgramStructure: true,
|
|
@@ -32800,6 +32829,7 @@ var ts;
|
|
|
32800
32829
|
type: "list",
|
|
32801
32830
|
element: {
|
|
32802
32831
|
name: "suffix",
|
|
32832
|
+
category: ts.Diagnostics.Modules,
|
|
32803
32833
|
type: "string",
|
|
32804
32834
|
},
|
|
32805
32835
|
listPreserveFalsyValues: true,
|
|
@@ -33174,6 +33204,7 @@ var ts;
|
|
|
33174
33204
|
isTSConfigOnly: true,
|
|
33175
33205
|
element: {
|
|
33176
33206
|
name: "plugin",
|
|
33207
|
+
category: ts.Diagnostics.Editor_Support,
|
|
33177
33208
|
type: "object"
|
|
33178
33209
|
},
|
|
33179
33210
|
description: ts.Diagnostics.Specify_a_list_of_language_service_plugins_to_include,
|
|
@@ -33191,16 +33222,83 @@ var ts;
|
|
|
33191
33222
|
category: ts.Diagnostics.Language_and_Environment,
|
|
33192
33223
|
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,
|
|
33193
33224
|
}
|
|
33194
|
-
];
|
|
33195
|
-
ts.optionDeclarations = __spreadArray(__spreadArray([], ts.commonOptionsWithBuild, true), commandOptionsWithoutBuild, true);
|
|
33196
|
-
|
|
33197
|
-
|
|
33198
|
-
|
|
33199
|
-
ts.
|
|
33200
|
-
|
|
33225
|
+
]);
|
|
33226
|
+
ts.optionDeclarations = ts.is()(__spreadArray(__spreadArray([], ts.commonOptionsWithBuild, true), commandOptionsWithoutBuild, true));
|
|
33227
|
+
function isAffectsSemanticDiagnosticsOption(option) {
|
|
33228
|
+
return !!option.affectsSemanticDiagnostics;
|
|
33229
|
+
}
|
|
33230
|
+
ts.semanticDiagnosticsOptionDeclarations = ts.optionDeclarations.filter(isAffectsSemanticDiagnosticsOption);
|
|
33231
|
+
function isAffectsEmitOption(option) {
|
|
33232
|
+
return !!option.affectsEmit;
|
|
33233
|
+
}
|
|
33234
|
+
ts.affectsEmitOptionDeclarations = ts.optionDeclarations.filter(isAffectsEmitOption);
|
|
33235
|
+
function isAffectsDeclarationPathOption(option) {
|
|
33236
|
+
return !!option.affectsDeclarationPath;
|
|
33237
|
+
}
|
|
33238
|
+
ts.affectsDeclarationPathOptionDeclarations = ts.optionDeclarations.filter(isAffectsDeclarationPathOption);
|
|
33239
|
+
function isAffectsModuleResolutionOption(option) {
|
|
33240
|
+
return !!option.affectsModuleResolution;
|
|
33241
|
+
}
|
|
33242
|
+
ts.moduleResolutionOptionDeclarations = ts.optionDeclarations.filter(isAffectsModuleResolutionOption);
|
|
33243
|
+
function isSourceFileAffectingOptions(option) {
|
|
33201
33244
|
return !!option.affectsSourceFile || !!option.affectsModuleResolution || !!option.affectsBindDiagnostics;
|
|
33202
|
-
}
|
|
33203
|
-
ts.
|
|
33245
|
+
}
|
|
33246
|
+
ts.sourceFileAffectingCompilerOptions = ts.optionDeclarations.filter(isSourceFileAffectingOptions);
|
|
33247
|
+
function isAffectsProgramStructureOption(option) {
|
|
33248
|
+
return !!option.affectsProgramStructure;
|
|
33249
|
+
}
|
|
33250
|
+
ts.optionsAffectingProgramStructure = ts.optionDeclarations.filter(isAffectsProgramStructureOption);
|
|
33251
|
+
function isStrictOption(option) {
|
|
33252
|
+
return !!option.strictFlag === true;
|
|
33253
|
+
}
|
|
33254
|
+
ts.isStrictOption = isStrictOption;
|
|
33255
|
+
function isAllowedAsPragmaOption(option) {
|
|
33256
|
+
return !!option.allowedAsPragma;
|
|
33257
|
+
}
|
|
33258
|
+
ts.optionsAllowedAsPragmaOption = ts.optionDeclarations.filter(isAllowedAsPragmaOption);
|
|
33259
|
+
function convertCompilerOptionsIntoPragmasSpecs(options) {
|
|
33260
|
+
var result = {};
|
|
33261
|
+
for (var _i = 0, options_1 = options; _i < options_1.length; _i++) {
|
|
33262
|
+
var elem = options_1[_i];
|
|
33263
|
+
result["ts-" + elem.name.toLowerCase()] = {
|
|
33264
|
+
args: [{ name: "value", optional: true }],
|
|
33265
|
+
kind: 2 | 4
|
|
33266
|
+
};
|
|
33267
|
+
}
|
|
33268
|
+
return result;
|
|
33269
|
+
}
|
|
33270
|
+
ts.commentPragmas = __assign({ "reference": {
|
|
33271
|
+
args: [
|
|
33272
|
+
{ name: "types", optional: true, captureSpan: true },
|
|
33273
|
+
{ name: "lib", optional: true, captureSpan: true },
|
|
33274
|
+
{ name: "path", optional: true, captureSpan: true },
|
|
33275
|
+
{ name: "no-default-lib", optional: true },
|
|
33276
|
+
{ name: "resolution-mode", optional: true }
|
|
33277
|
+
],
|
|
33278
|
+
kind: 1
|
|
33279
|
+
}, "amd-dependency": {
|
|
33280
|
+
args: [{ name: "path" }, { name: "name", optional: true }],
|
|
33281
|
+
kind: 1
|
|
33282
|
+
}, "amd-module": {
|
|
33283
|
+
args: [{ name: "name" }],
|
|
33284
|
+
kind: 1
|
|
33285
|
+
}, "ts-check": {
|
|
33286
|
+
kind: 2
|
|
33287
|
+
}, "ts-nocheck": {
|
|
33288
|
+
kind: 2
|
|
33289
|
+
}, "jsx": {
|
|
33290
|
+
args: [{ name: "factory" }],
|
|
33291
|
+
kind: 4
|
|
33292
|
+
}, "jsxfrag": {
|
|
33293
|
+
args: [{ name: "factory" }],
|
|
33294
|
+
kind: 4
|
|
33295
|
+
}, "jsximportsource": {
|
|
33296
|
+
args: [{ name: "factory" }],
|
|
33297
|
+
kind: 4
|
|
33298
|
+
}, "jsxruntime": {
|
|
33299
|
+
args: [{ name: "factory" }],
|
|
33300
|
+
kind: 4
|
|
33301
|
+
} }, convertCompilerOptionsIntoPragmasSpecs(ts.optionsAllowedAsPragmaOption));
|
|
33204
33302
|
ts.transpileOptionValueCompilerOptions = ts.optionDeclarations.filter(function (option) {
|
|
33205
33303
|
return ts.hasProperty(option, "transpileOptionValue");
|
|
33206
33304
|
});
|
|
@@ -33242,11 +33340,13 @@ var ts;
|
|
|
33242
33340
|
{
|
|
33243
33341
|
name: "enableAutoDiscovery",
|
|
33244
33342
|
type: "boolean",
|
|
33343
|
+
category: ts.Diagnostics.File_Management,
|
|
33245
33344
|
defaultValueDescription: false,
|
|
33246
33345
|
},
|
|
33247
33346
|
{
|
|
33248
33347
|
name: "enable",
|
|
33249
33348
|
type: "boolean",
|
|
33349
|
+
category: ts.Diagnostics.File_Management,
|
|
33250
33350
|
defaultValueDescription: false,
|
|
33251
33351
|
},
|
|
33252
33352
|
{
|
|
@@ -33254,20 +33354,25 @@ var ts;
|
|
|
33254
33354
|
type: "list",
|
|
33255
33355
|
element: {
|
|
33256
33356
|
name: "include",
|
|
33357
|
+
category: ts.Diagnostics.File_Management,
|
|
33257
33358
|
type: "string"
|
|
33258
|
-
}
|
|
33359
|
+
},
|
|
33360
|
+
category: ts.Diagnostics.File_Management,
|
|
33259
33361
|
},
|
|
33260
33362
|
{
|
|
33261
33363
|
name: "exclude",
|
|
33262
33364
|
type: "list",
|
|
33263
33365
|
element: {
|
|
33264
33366
|
name: "exclude",
|
|
33367
|
+
category: ts.Diagnostics.File_Management,
|
|
33265
33368
|
type: "string"
|
|
33266
|
-
}
|
|
33369
|
+
},
|
|
33370
|
+
category: ts.Diagnostics.File_Management,
|
|
33267
33371
|
},
|
|
33268
33372
|
{
|
|
33269
33373
|
name: "disableFilenameBasedTypeAcquisition",
|
|
33270
33374
|
type: "boolean",
|
|
33375
|
+
category: ts.Diagnostics.File_Management,
|
|
33271
33376
|
defaultValueDescription: false,
|
|
33272
33377
|
},
|
|
33273
33378
|
];
|
|
@@ -33458,7 +33563,7 @@ var ts;
|
|
|
33458
33563
|
}
|
|
33459
33564
|
}
|
|
33460
33565
|
else {
|
|
33461
|
-
if (!args[i] && opt.type !== "boolean") {
|
|
33566
|
+
if (!args[i] && opt.type !== "boolean" && diagnostics) {
|
|
33462
33567
|
errors.push(ts.createCompilerDiagnostic(diagnostics.optionTypeMismatchDiagnostic, opt.name, getCompilerOptionValueTypeString(opt)));
|
|
33463
33568
|
}
|
|
33464
33569
|
if (args[i] !== "null") {
|
|
@@ -33498,6 +33603,7 @@ var ts;
|
|
|
33498
33603
|
}
|
|
33499
33604
|
return i;
|
|
33500
33605
|
}
|
|
33606
|
+
ts.parseOptionValue = parseOptionValue;
|
|
33501
33607
|
ts.compilerOptionsDidYouMeanDiagnostics = {
|
|
33502
33608
|
alternateMode: compilerOptionsAlternateMode,
|
|
33503
33609
|
getOptionsNameMap: getOptionsNameMap,
|
|
@@ -33652,30 +33758,35 @@ var ts;
|
|
|
33652
33758
|
_tsconfigRootOptions = {
|
|
33653
33759
|
name: undefined,
|
|
33654
33760
|
type: "object",
|
|
33761
|
+
category: ts.Diagnostics.Command_line_Options,
|
|
33655
33762
|
elementOptions: commandLineOptionsToMap([
|
|
33656
33763
|
{
|
|
33657
33764
|
name: "compilerOptions",
|
|
33658
33765
|
type: "object",
|
|
33659
33766
|
elementOptions: getCommandLineCompilerOptionsMap(),
|
|
33660
33767
|
extraKeyDiagnostics: ts.compilerOptionsDidYouMeanDiagnostics,
|
|
33768
|
+
category: ts.Diagnostics.Command_line_Options,
|
|
33661
33769
|
},
|
|
33662
33770
|
{
|
|
33663
33771
|
name: "watchOptions",
|
|
33664
33772
|
type: "object",
|
|
33665
33773
|
elementOptions: getCommandLineWatchOptionsMap(),
|
|
33666
33774
|
extraKeyDiagnostics: watchOptionsDidYouMeanDiagnostics,
|
|
33775
|
+
category: ts.Diagnostics.Command_line_Options,
|
|
33667
33776
|
},
|
|
33668
33777
|
{
|
|
33669
33778
|
name: "typingOptions",
|
|
33670
33779
|
type: "object",
|
|
33671
33780
|
elementOptions: getCommandLineTypeAcquisitionMap(),
|
|
33672
33781
|
extraKeyDiagnostics: typeAcquisitionDidYouMeanDiagnostics,
|
|
33782
|
+
category: ts.Diagnostics.Command_line_Options,
|
|
33673
33783
|
},
|
|
33674
33784
|
{
|
|
33675
33785
|
name: "typeAcquisition",
|
|
33676
33786
|
type: "object",
|
|
33677
33787
|
elementOptions: getCommandLineTypeAcquisitionMap(),
|
|
33678
|
-
extraKeyDiagnostics: typeAcquisitionDidYouMeanDiagnostics
|
|
33788
|
+
extraKeyDiagnostics: typeAcquisitionDidYouMeanDiagnostics,
|
|
33789
|
+
category: ts.Diagnostics.Command_line_Options,
|
|
33679
33790
|
},
|
|
33680
33791
|
{
|
|
33681
33792
|
name: "extends",
|
|
@@ -33687,6 +33798,7 @@ var ts;
|
|
|
33687
33798
|
type: "list",
|
|
33688
33799
|
element: {
|
|
33689
33800
|
name: "references",
|
|
33801
|
+
category: ts.Diagnostics.Projects,
|
|
33690
33802
|
type: "object"
|
|
33691
33803
|
},
|
|
33692
33804
|
category: ts.Diagnostics.Projects,
|
|
@@ -33696,6 +33808,7 @@ var ts;
|
|
|
33696
33808
|
type: "list",
|
|
33697
33809
|
element: {
|
|
33698
33810
|
name: "files",
|
|
33811
|
+
category: ts.Diagnostics.File_Management,
|
|
33699
33812
|
type: "string"
|
|
33700
33813
|
},
|
|
33701
33814
|
category: ts.Diagnostics.File_Management,
|
|
@@ -33705,6 +33818,7 @@ var ts;
|
|
|
33705
33818
|
type: "list",
|
|
33706
33819
|
element: {
|
|
33707
33820
|
name: "include",
|
|
33821
|
+
category: ts.Diagnostics.File_Management,
|
|
33708
33822
|
type: "string"
|
|
33709
33823
|
},
|
|
33710
33824
|
category: ts.Diagnostics.File_Management,
|
|
@@ -33715,6 +33829,7 @@ var ts;
|
|
|
33715
33829
|
type: "list",
|
|
33716
33830
|
element: {
|
|
33717
33831
|
name: "exclude",
|
|
33832
|
+
category: ts.Diagnostics.File_Management,
|
|
33718
33833
|
type: "string"
|
|
33719
33834
|
},
|
|
33720
33835
|
category: ts.Diagnostics.File_Management,
|
|
@@ -34077,8 +34192,8 @@ var ts;
|
|
|
34077
34192
|
entries.push({ value: "" });
|
|
34078
34193
|
}
|
|
34079
34194
|
entries.push({ value: "/* " + category + " */" });
|
|
34080
|
-
for (var _i = 0,
|
|
34081
|
-
var option =
|
|
34195
|
+
for (var _i = 0, options_2 = options; _i < options_2.length; _i++) {
|
|
34196
|
+
var option = options_2[_i];
|
|
34082
34197
|
var optionName = void 0;
|
|
34083
34198
|
if (compilerOptionsMap.has(option.name)) {
|
|
34084
34199
|
optionName = "\"" + option.name + "\": " + JSON.stringify(compilerOptionsMap.get(option.name)) + ((seenKnownKeys += 1) === compilerOptionsMap.size ? "" : ",");
|
|
@@ -37066,7 +37181,7 @@ var ts;
|
|
|
37066
37181
|
}
|
|
37067
37182
|
return bindSourceFile;
|
|
37068
37183
|
function bindInStrictMode(file, opts) {
|
|
37069
|
-
if (ts.getStrictOptionValue(opts, "alwaysStrict") && !file.isDeclarationFile) {
|
|
37184
|
+
if (ts.getStrictOptionValue(file, opts, "alwaysStrict") && !file.isDeclarationFile) {
|
|
37070
37185
|
return true;
|
|
37071
37186
|
}
|
|
37072
37187
|
else {
|
|
@@ -39901,17 +40016,16 @@ var ts;
|
|
|
39901
40016
|
var moduleKind = ts.getEmitModuleKind(compilerOptions);
|
|
39902
40017
|
var useDefineForClassFields = ts.getUseDefineForClassFields(compilerOptions);
|
|
39903
40018
|
var allowSyntheticDefaultImports = ts.getAllowSyntheticDefaultImports(compilerOptions);
|
|
39904
|
-
var strictNullChecks = ts.getStrictOptionValue(compilerOptions, "strictNullChecks");
|
|
39905
|
-
var strictFunctionTypes = ts.getStrictOptionValue(compilerOptions, "strictFunctionTypes");
|
|
39906
|
-
var strictBindCallApply = ts.getStrictOptionValue(compilerOptions, "strictBindCallApply");
|
|
39907
|
-
var strictPropertyInitialization = ts.getStrictOptionValue(compilerOptions, "strictPropertyInitialization");
|
|
39908
|
-
var noImplicitAny = ts.getStrictOptionValue(compilerOptions, "noImplicitAny");
|
|
39909
|
-
var noImplicitThis = ts.getStrictOptionValue(compilerOptions, "noImplicitThis");
|
|
39910
|
-
var useUnknownInCatchVariables = ts.getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
|
|
39911
|
-
var inferInstanceTypeArgumentsAsConstraint = ts.getStrictOptionValue(compilerOptions, "inferInstanceTypeArgumentsAsConstraint");
|
|
40019
|
+
var strictNullChecks = ts.getStrictOptionValue(undefined, compilerOptions, "strictNullChecks");
|
|
40020
|
+
var strictFunctionTypes = function (file) { return ts.getStrictOptionValue(file, compilerOptions, "strictFunctionTypes"); };
|
|
40021
|
+
var strictBindCallApply = function (file) { return ts.getStrictOptionValue(file, compilerOptions, "strictBindCallApply"); };
|
|
40022
|
+
var strictPropertyInitialization = function (file) { return ts.getStrictOptionValue(file, compilerOptions, "strictPropertyInitialization"); };
|
|
40023
|
+
var noImplicitAny = function (context) { return ts.getStrictOptionValue(context && getSourceFileOfNode(context), compilerOptions, "noImplicitAny"); };
|
|
40024
|
+
var noImplicitThis = function (file) { return ts.getStrictOptionValue(file, compilerOptions, "noImplicitThis"); };
|
|
40025
|
+
var useUnknownInCatchVariables = function (file) { return ts.getStrictOptionValue(file, compilerOptions, "useUnknownInCatchVariables"); };
|
|
39912
40026
|
var keyofStringsOnly = !!compilerOptions.keyofStringsOnly;
|
|
39913
40027
|
var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8192;
|
|
39914
|
-
var exactOptionalPropertyTypes = compilerOptions
|
|
40028
|
+
var exactOptionalPropertyTypes = function (context) { return ts.getFileLocalCompilerOption(context && getSourceFileOfNode(context), compilerOptions, "exactOptionalPropertyTypes"); };
|
|
39915
40029
|
var checkBinaryExpression = createCheckBinaryExpression();
|
|
39916
40030
|
var emitResolver = createResolver();
|
|
39917
40031
|
var nodeBuilder = createNodeBuilder();
|
|
@@ -40213,7 +40327,7 @@ var ts;
|
|
|
40213
40327
|
ts.Debug.assert(!!(getNodeLinks(file).flags & 1));
|
|
40214
40328
|
diagnostics = ts.addRange(diagnostics, suggestionDiagnostics.getDiagnostics(file.fileName));
|
|
40215
40329
|
checkUnusedIdentifiers(getPotentiallyUnusedIdentifiers(file), function (containingNode, kind, diag) {
|
|
40216
|
-
if (!ts.containsParseError(containingNode) && !unusedIsError(kind, !!(containingNode.flags & 16777216))) {
|
|
40330
|
+
if (!ts.containsParseError(containingNode) && !unusedIsError(kind, !!(containingNode.flags & 16777216), file)) {
|
|
40217
40331
|
(diagnostics || (diagnostics = [])).push(__assign(__assign({}, diag), { category: ts.DiagnosticCategory.Suggestion }));
|
|
40218
40332
|
}
|
|
40219
40333
|
});
|
|
@@ -40301,7 +40415,8 @@ var ts;
|
|
|
40301
40415
|
var undefinedType = createIntrinsicType(32768, "undefined");
|
|
40302
40416
|
var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768, "undefined", 65536);
|
|
40303
40417
|
var optionalType = createIntrinsicType(32768, "undefined");
|
|
40304
|
-
var missingType =
|
|
40418
|
+
var missingType = createIntrinsicType(32768, "undefined");
|
|
40419
|
+
var getMissingOrUndefinedType = function (context) { return exactOptionalPropertyTypes(context) ? missingType : undefinedType; };
|
|
40305
40420
|
var nullType = createIntrinsicType(65536, "null");
|
|
40306
40421
|
var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536, "null", 65536);
|
|
40307
40422
|
var stringType = createIntrinsicType(4, "string");
|
|
@@ -40520,6 +40635,15 @@ var ts;
|
|
|
40520
40635
|
];
|
|
40521
40636
|
initializeTypeChecker();
|
|
40522
40637
|
return checker;
|
|
40638
|
+
function getSourceFileOfNode(node) {
|
|
40639
|
+
if (!node)
|
|
40640
|
+
return node;
|
|
40641
|
+
var links = getNodeLinks(node);
|
|
40642
|
+
if (!ts.hasProperty(links, "sourceFile")) {
|
|
40643
|
+
links.sourceFile = ts.getSourceFileOfNode(node);
|
|
40644
|
+
}
|
|
40645
|
+
return links.sourceFile;
|
|
40646
|
+
}
|
|
40523
40647
|
function getCachedType(key) {
|
|
40524
40648
|
return key ? cachedTypes.get(key) : undefined;
|
|
40525
40649
|
}
|
|
@@ -40530,7 +40654,7 @@ var ts;
|
|
|
40530
40654
|
}
|
|
40531
40655
|
function getJsxNamespace(location) {
|
|
40532
40656
|
if (location) {
|
|
40533
|
-
var file =
|
|
40657
|
+
var file = getSourceFileOfNode(location);
|
|
40534
40658
|
if (file) {
|
|
40535
40659
|
if (ts.isJsxOpeningFragment(location)) {
|
|
40536
40660
|
if (file.localJsxFragmentNamespace) {
|
|
@@ -40640,7 +40764,7 @@ var ts;
|
|
|
40640
40764
|
if (!isError) {
|
|
40641
40765
|
return;
|
|
40642
40766
|
}
|
|
40643
|
-
var file =
|
|
40767
|
+
var file = getSourceFileOfNode(location);
|
|
40644
40768
|
addErrorOrSuggestion(isError, "message" in message ? ts.createFileDiagnostic(file, 0, 0, message, arg0, arg1, arg2, arg3) : ts.createDiagnosticForFileFromMessageChain(file, message));
|
|
40645
40769
|
return;
|
|
40646
40770
|
}
|
|
@@ -40786,8 +40910,8 @@ var ts;
|
|
|
40786
40910
|
var message = isEitherEnum ? ts.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations
|
|
40787
40911
|
: isEitherBlockScoped_1 ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0
|
|
40788
40912
|
: ts.Diagnostics.Duplicate_identifier_0;
|
|
40789
|
-
var sourceSymbolFile = source.declarations &&
|
|
40790
|
-
var targetSymbolFile = target.declarations &&
|
|
40913
|
+
var sourceSymbolFile = source.declarations && getSourceFileOfNode(source.declarations[0]);
|
|
40914
|
+
var targetSymbolFile = target.declarations && getSourceFileOfNode(target.declarations[0]);
|
|
40791
40915
|
var isSourcePlainJs = ts.isPlainJsFile(sourceSymbolFile, compilerOptions.checkJs);
|
|
40792
40916
|
var isTargetPlainJs = ts.isPlainJsFile(targetSymbolFile, compilerOptions.checkJs);
|
|
40793
40917
|
var symbolName_1 = symbolToString(source);
|
|
@@ -40963,8 +41087,8 @@ var ts;
|
|
|
40963
41087
|
return ts.Debug.fail("There should exist two symbols, one as property declaration and one as parameter declaration");
|
|
40964
41088
|
}
|
|
40965
41089
|
function isBlockScopedNameDeclaredBeforeUse(declaration, usage) {
|
|
40966
|
-
var declarationFile =
|
|
40967
|
-
var useFile =
|
|
41090
|
+
var declarationFile = getSourceFileOfNode(declaration);
|
|
41091
|
+
var useFile = getSourceFileOfNode(usage);
|
|
40968
41092
|
var declContainer = ts.getEnclosingBlockScopeContainer(declaration);
|
|
40969
41093
|
if (declarationFile !== useFile) {
|
|
40970
41094
|
if ((moduleKind && (declarationFile.externalModuleIndicator || useFile.externalModuleIndicator)) ||
|
|
@@ -41848,7 +41972,7 @@ var ts;
|
|
|
41848
41972
|
return ((ts.isExportAssignment(node) && !node.isExportEquals) || ts.hasSyntacticModifier(node, 512) || ts.isExportSpecifier(node));
|
|
41849
41973
|
}
|
|
41850
41974
|
function getUsageModeForExpression(usage) {
|
|
41851
|
-
return ts.isStringLiteralLike(usage) ? ts.getModeForUsageLocation(
|
|
41975
|
+
return ts.isStringLiteralLike(usage) ? ts.getModeForUsageLocation(getSourceFileOfNode(usage), usage) : undefined;
|
|
41852
41976
|
}
|
|
41853
41977
|
function isESMFormatImportImportingCommonjsFormatFile(usageMode, targetMode) {
|
|
41854
41978
|
return usageMode === ts.ModuleKind.ESNext && targetMode === ts.ModuleKind.CommonJS;
|
|
@@ -42483,7 +42607,7 @@ var ts;
|
|
|
42483
42607
|
if (ambientModule) {
|
|
42484
42608
|
return ambientModule;
|
|
42485
42609
|
}
|
|
42486
|
-
var currentSourceFile =
|
|
42610
|
+
var currentSourceFile = getSourceFileOfNode(location);
|
|
42487
42611
|
var contextSpecifier = ts.isStringLiteralLike(location)
|
|
42488
42612
|
? location
|
|
42489
42613
|
: ((_a = ts.findAncestor(location, ts.isImportCall)) === null || _a === void 0 ? void 0 : _a.arguments[0]) ||
|
|
@@ -42494,7 +42618,7 @@ var ts;
|
|
|
42494
42618
|
((_f = (ts.isLiteralImportTypeNode(location) ? location : undefined)) === null || _f === void 0 ? void 0 : _f.argument.literal);
|
|
42495
42619
|
var mode = contextSpecifier && ts.isStringLiteralLike(contextSpecifier) ? ts.getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
|
|
42496
42620
|
var resolvedModule = ts.getResolvedModule(currentSourceFile, moduleReference, mode);
|
|
42497
|
-
var resolutionDiagnostic = resolvedModule && ts.getResolutionDiagnostic(compilerOptions, resolvedModule);
|
|
42621
|
+
var resolutionDiagnostic = resolvedModule && ts.getResolutionDiagnostic(currentSourceFile, compilerOptions, resolvedModule);
|
|
42498
42622
|
var sourceFile = resolvedModule
|
|
42499
42623
|
&& (!resolutionDiagnostic || resolutionDiagnostic === ts.Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set)
|
|
42500
42624
|
&& host.getSourceFile(resolvedModule.resolvedFileName);
|
|
@@ -42537,7 +42661,7 @@ var ts;
|
|
|
42537
42661
|
error(errorNode, diag, moduleReference, resolvedModule.resolvedFileName);
|
|
42538
42662
|
}
|
|
42539
42663
|
else {
|
|
42540
|
-
errorOnImplicitAnyModule(noImplicitAny && !!moduleNotFoundError, errorNode, resolvedModule, moduleReference);
|
|
42664
|
+
errorOnImplicitAnyModule(noImplicitAny(errorNode) && !!moduleNotFoundError, errorNode, resolvedModule, moduleReference);
|
|
42541
42665
|
}
|
|
42542
42666
|
return undefined;
|
|
42543
42667
|
}
|
|
@@ -42835,7 +42959,7 @@ var ts;
|
|
|
42835
42959
|
return getMergedSymbol(symbol.parent && getLateBoundSymbol(symbol.parent));
|
|
42836
42960
|
}
|
|
42837
42961
|
function getAlternativeContainingModules(symbol, enclosingDeclaration) {
|
|
42838
|
-
var containingFile =
|
|
42962
|
+
var containingFile = getSourceFileOfNode(enclosingDeclaration);
|
|
42839
42963
|
var id = getNodeId(containingFile);
|
|
42840
42964
|
var links = getSymbolLinks(symbol);
|
|
42841
42965
|
var results;
|
|
@@ -42914,7 +43038,7 @@ var ts;
|
|
|
42914
43038
|
}
|
|
42915
43039
|
if (ts.isClassExpression(d) && ts.isBinaryExpression(d.parent) && d.parent.operatorToken.kind === 63 && ts.isAccessExpression(d.parent.left) && ts.isEntityNameExpression(d.parent.left.expression)) {
|
|
42916
43040
|
if (ts.isModuleExportsAccessExpression(d.parent.left) || ts.isExportsIdentifier(d.parent.left.expression)) {
|
|
42917
|
-
return getSymbolOfNode(
|
|
43041
|
+
return getSymbolOfNode(getSourceFileOfNode(d));
|
|
42918
43042
|
}
|
|
42919
43043
|
checkExpressionCached(d.parent.left.expression);
|
|
42920
43044
|
return getNodeLinks(d.parent.left.expression).resolvedSymbol;
|
|
@@ -43158,7 +43282,7 @@ var ts;
|
|
|
43158
43282
|
if (symbolFromSymbolTable.flags & 2097152
|
|
43159
43283
|
&& symbolFromSymbolTable.escapedName !== "export="
|
|
43160
43284
|
&& symbolFromSymbolTable.escapedName !== "default"
|
|
43161
|
-
&& !(ts.isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && ts.isExternalModule(
|
|
43285
|
+
&& !(ts.isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && ts.isExternalModule(getSourceFileOfNode(enclosingDeclaration)))
|
|
43162
43286
|
&& (!useOnlyExternalAliasing || ts.some(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration))
|
|
43163
43287
|
&& (isLocalNameLookup ? !ts.some(symbolFromSymbolTable.declarations, ts.isNamespaceReexportDeclaration) : true)
|
|
43164
43288
|
&& (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 275))) {
|
|
@@ -43424,7 +43548,7 @@ var ts;
|
|
|
43424
43548
|
function symbolToStringWorker(writer) {
|
|
43425
43549
|
var entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags);
|
|
43426
43550
|
var printer = (enclosingDeclaration === null || enclosingDeclaration === void 0 ? void 0 : enclosingDeclaration.kind) === 305 ? ts.createPrinter({ removeComments: true, neverAsciiEscape: true }) : ts.createPrinter({ removeComments: true });
|
|
43427
|
-
var sourceFile = enclosingDeclaration &&
|
|
43551
|
+
var sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
43428
43552
|
printer.writeNode(4, entity, sourceFile, writer);
|
|
43429
43553
|
return writer;
|
|
43430
43554
|
}
|
|
@@ -43442,7 +43566,7 @@ var ts;
|
|
|
43442
43566
|
}
|
|
43443
43567
|
var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 | 512);
|
|
43444
43568
|
var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true });
|
|
43445
|
-
var sourceFile = enclosingDeclaration &&
|
|
43569
|
+
var sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
43446
43570
|
printer.writeNode(4, sig, sourceFile, ts.getTrailingSemicolonDeferringWriter(writer));
|
|
43447
43571
|
return writer;
|
|
43448
43572
|
}
|
|
@@ -43456,7 +43580,7 @@ var ts;
|
|
|
43456
43580
|
return ts.Debug.fail("should always get typenode");
|
|
43457
43581
|
var options = { removeComments: type !== unresolvedType };
|
|
43458
43582
|
var printer = ts.createPrinter(options);
|
|
43459
|
-
var sourceFile = enclosingDeclaration &&
|
|
43583
|
+
var sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
43460
43584
|
printer.writeNode(4, typeNode, sourceFile, writer);
|
|
43461
43585
|
var result = writer.getText();
|
|
43462
43586
|
var maxLength = noTruncation ? ts.noTruncationMaximumTruncationLength * 2 : ts.defaultMaximumTruncationLength * 2;
|
|
@@ -44670,9 +44794,9 @@ var ts;
|
|
|
44670
44794
|
if (ambientModuleSymbolRegex.test(symbol.escapedName)) {
|
|
44671
44795
|
return symbol.escapedName.substring(1, symbol.escapedName.length - 1);
|
|
44672
44796
|
}
|
|
44673
|
-
return
|
|
44797
|
+
return getSourceFileOfNode(ts.getNonAugmentationDeclaration(symbol)).fileName;
|
|
44674
44798
|
}
|
|
44675
|
-
var contextFile =
|
|
44799
|
+
var contextFile = getSourceFileOfNode(ts.getOriginalNode(context.enclosingDeclaration));
|
|
44676
44800
|
var resolutionMode = overrideImportMode || (contextFile === null || contextFile === void 0 ? void 0 : contextFile.impliedNodeFormat);
|
|
44677
44801
|
var cacheKey = getSpecifierCacheKey(contextFile.path, resolutionMode);
|
|
44678
44802
|
var links = getSymbolLinks(symbol);
|
|
@@ -44706,7 +44830,7 @@ var ts;
|
|
|
44706
44830
|
if (ts.some(chain[0].declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {
|
|
44707
44831
|
var nonRootParts = chain.length > 1 ? createAccessFromSymbolChain(chain, chain.length - 1, 1) : undefined;
|
|
44708
44832
|
var typeParameterNodes = overrideTypeArguments || lookupTypeParameterNodes(chain, 0, context);
|
|
44709
|
-
var contextFile =
|
|
44833
|
+
var contextFile = getSourceFileOfNode(ts.getOriginalNode(context.enclosingDeclaration));
|
|
44710
44834
|
var targetFile = ts.getSourceFileOfModule(chain[0]);
|
|
44711
44835
|
var specifier = void 0;
|
|
44712
44836
|
var assertion = void 0;
|
|
@@ -45009,7 +45133,7 @@ var ts;
|
|
|
45009
45133
|
}
|
|
45010
45134
|
var oldFlags = context.flags;
|
|
45011
45135
|
if (type.flags & 8192 &&
|
|
45012
|
-
type.symbol === symbol && (!context.enclosingDeclaration || ts.some(symbol.declarations, function (d) { return
|
|
45136
|
+
type.symbol === symbol && (!context.enclosingDeclaration || ts.some(symbol.declarations, function (d) { return getSourceFileOfNode(d) === getSourceFileOfNode(context.enclosingDeclaration); }))) {
|
|
45013
45137
|
context.flags |= 1048576;
|
|
45014
45138
|
}
|
|
45015
45139
|
var result = typeToTypeNodeHelper(type, context);
|
|
@@ -45073,7 +45197,7 @@ var ts;
|
|
|
45073
45197
|
cancellationToken.throwIfCancellationRequested();
|
|
45074
45198
|
}
|
|
45075
45199
|
var hadError = false;
|
|
45076
|
-
var file =
|
|
45200
|
+
var file = getSourceFileOfNode(existing);
|
|
45077
45201
|
var transformed = ts.visitNode(existing, visitExistingNodeTreeSymbols);
|
|
45078
45202
|
if (hadError) {
|
|
45079
45203
|
return undefined;
|
|
@@ -45501,7 +45625,7 @@ var ts;
|
|
|
45501
45625
|
if (ts.canHaveModifiers(node)) {
|
|
45502
45626
|
var newModifierFlags = 0;
|
|
45503
45627
|
var enclosingDeclaration_1 = context.enclosingDeclaration &&
|
|
45504
|
-
(ts.isJSDocTypeAlias(context.enclosingDeclaration) ?
|
|
45628
|
+
(ts.isJSDocTypeAlias(context.enclosingDeclaration) ? getSourceFileOfNode(context.enclosingDeclaration) : context.enclosingDeclaration);
|
|
45505
45629
|
if (additionalModifierFlags & 1 &&
|
|
45506
45630
|
enclosingDeclaration_1 && (isExportingScope(enclosingDeclaration_1) || ts.isModuleDeclaration(enclosingDeclaration_1)) &&
|
|
45507
45631
|
canHaveExportModifier(node)) {
|
|
@@ -45569,14 +45693,14 @@ var ts;
|
|
|
45569
45693
|
serializeAsNamespaceDeclaration(realMembers, localName, modifierFlags, !!(symbol.flags & (16 | 67108864)));
|
|
45570
45694
|
}
|
|
45571
45695
|
if (ts.length(mergedMembers)) {
|
|
45572
|
-
var containingFile_1 =
|
|
45696
|
+
var containingFile_1 = getSourceFileOfNode(context.enclosingDeclaration);
|
|
45573
45697
|
var localName = getInternalSymbolName(symbol, symbolName);
|
|
45574
45698
|
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) {
|
|
45575
45699
|
var _a, _b;
|
|
45576
45700
|
var name = ts.unescapeLeadingUnderscores(s.escapedName);
|
|
45577
45701
|
var localName = getInternalSymbolName(s, name);
|
|
45578
45702
|
var aliasDecl = s.declarations && getDeclarationOfAliasSymbol(s);
|
|
45579
|
-
if (containingFile_1 && (aliasDecl ? containingFile_1 !==
|
|
45703
|
+
if (containingFile_1 && (aliasDecl ? containingFile_1 !== getSourceFileOfNode(aliasDecl) : !ts.some(s.declarations, function (d) { return getSourceFileOfNode(d) === containingFile_1; }))) {
|
|
45580
45704
|
(_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);
|
|
45581
45705
|
return undefined;
|
|
45582
45706
|
}
|
|
@@ -45623,7 +45747,7 @@ var ts;
|
|
|
45623
45747
|
if (ts.length(props)) {
|
|
45624
45748
|
var localVsRemoteMap = ts.arrayToMultiMap(props, function (p) {
|
|
45625
45749
|
return !ts.length(p.declarations) || ts.some(p.declarations, function (d) {
|
|
45626
|
-
return
|
|
45750
|
+
return getSourceFileOfNode(d) === getSourceFileOfNode(context.enclosingDeclaration);
|
|
45627
45751
|
}) ? "local" : "remote";
|
|
45628
45752
|
});
|
|
45629
45753
|
var localProps = localVsRemoteMap.get("local") || ts.emptyArray;
|
|
@@ -45846,7 +45970,7 @@ var ts;
|
|
|
45846
45970
|
var isExportAssignmentCompatibleSymbolName = isExportEquals || isDefault;
|
|
45847
45971
|
var aliasDecl = symbol.declarations && getDeclarationOfAliasSymbol(symbol);
|
|
45848
45972
|
var target = aliasDecl && getTargetOfAliasDeclaration(aliasDecl, true);
|
|
45849
|
-
if (target && ts.length(target.declarations) && ts.some(target.declarations, function (d) { return
|
|
45973
|
+
if (target && ts.length(target.declarations) && ts.some(target.declarations, function (d) { return getSourceFileOfNode(d) === getSourceFileOfNode(enclosingDeclaration); })) {
|
|
45850
45974
|
var expr = aliasDecl && ((ts.isExportAssignment(aliasDecl) || ts.isBinaryExpression(aliasDecl)) ? ts.getExportAssignmentExpression(aliasDecl) : ts.getPropertyAssignmentAliasLikeExpression(aliasDecl));
|
|
45851
45975
|
var first_1 = expr && ts.isEntityNameExpression(expr) ? getFirstNonModuleExportsIdentifier(expr) : undefined;
|
|
45852
45976
|
var referenced = first_1 && resolveEntityName(first_1, 67108863, true, true, enclosingDeclaration);
|
|
@@ -45900,16 +46024,16 @@ var ts;
|
|
|
45900
46024
|
}
|
|
45901
46025
|
}
|
|
45902
46026
|
function isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, hostSymbol) {
|
|
45903
|
-
var ctxSrc =
|
|
46027
|
+
var ctxSrc = getSourceFileOfNode(context.enclosingDeclaration);
|
|
45904
46028
|
return ts.getObjectFlags(typeToSerialize) & (16 | 32) &&
|
|
45905
46029
|
!ts.length(getIndexInfosOfType(typeToSerialize)) &&
|
|
45906
46030
|
!isClassInstanceSide(typeToSerialize) &&
|
|
45907
46031
|
!!(ts.length(ts.filter(getPropertiesOfType(typeToSerialize), isNamespaceMember)) || ts.length(getSignaturesOfType(typeToSerialize, 0))) &&
|
|
45908
46032
|
!ts.length(getSignaturesOfType(typeToSerialize, 1)) &&
|
|
45909
46033
|
!getDeclarationWithTypeAnnotation(hostSymbol, enclosingDeclaration) &&
|
|
45910
|
-
!(typeToSerialize.symbol && ts.some(typeToSerialize.symbol.declarations, function (d) { return
|
|
46034
|
+
!(typeToSerialize.symbol && ts.some(typeToSerialize.symbol.declarations, function (d) { return getSourceFileOfNode(d) !== ctxSrc; })) &&
|
|
45911
46035
|
!ts.some(getPropertiesOfType(typeToSerialize), function (p) { return isLateBoundName(p.escapedName); }) &&
|
|
45912
|
-
!ts.some(getPropertiesOfType(typeToSerialize), function (p) { return ts.some(p.declarations, function (d) { return
|
|
46036
|
+
!ts.some(getPropertiesOfType(typeToSerialize), function (p) { return ts.some(p.declarations, function (d) { return getSourceFileOfNode(d) !== ctxSrc; }); }) &&
|
|
45913
46037
|
ts.every(getPropertiesOfType(typeToSerialize), function (p) { return ts.isIdentifierText(ts.symbolName(p), languageVersion); });
|
|
45914
46038
|
}
|
|
45915
46039
|
function makeSerializePropertySymbol(createProperty, methodKind, useAccessors) {
|
|
@@ -46120,7 +46244,7 @@ var ts;
|
|
|
46120
46244
|
function typePredicateToStringWorker(writer) {
|
|
46121
46245
|
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));
|
|
46122
46246
|
var printer = ts.createPrinter({ removeComments: true });
|
|
46123
|
-
var sourceFile = enclosingDeclaration &&
|
|
46247
|
+
var sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
46124
46248
|
printer.writeNode(4, predicate, sourceFile, writer);
|
|
46125
46249
|
return writer;
|
|
46126
46250
|
}
|
|
@@ -46426,19 +46550,9 @@ var ts;
|
|
|
46426
46550
|
}
|
|
46427
46551
|
}).parent;
|
|
46428
46552
|
}
|
|
46429
|
-
function getInstanceTypeOfClassSymbol(classSymbol) {
|
|
46430
|
-
var classType = getDeclaredTypeOfSymbol(classSymbol);
|
|
46431
|
-
if (!classType.typeParameters) {
|
|
46432
|
-
return classType;
|
|
46433
|
-
}
|
|
46434
|
-
var typeArguments = ts.map(classType.typeParameters, function (typeParameter) {
|
|
46435
|
-
return (inferInstanceTypeArgumentsAsConstraint) ? getBaseConstraintOfType(typeParameter) || unknownType : anyType;
|
|
46436
|
-
});
|
|
46437
|
-
return createTypeReference(classType, typeArguments);
|
|
46438
|
-
}
|
|
46439
46553
|
function getTypeOfPrototypeProperty(prototype) {
|
|
46440
|
-
var
|
|
46441
|
-
return
|
|
46554
|
+
var classType = getDeclaredTypeOfSymbol(getParentOfSymbol(prototype));
|
|
46555
|
+
return classType.typeParameters ? createTypeReference(classType, ts.map(classType.typeParameters, function (_) { return anyType; })) : classType;
|
|
46442
46556
|
}
|
|
46443
46557
|
function getTypeOfPropertyOfType(type, name) {
|
|
46444
46558
|
var prop = getPropertyOfType(type, name);
|
|
@@ -46645,7 +46759,7 @@ var ts;
|
|
|
46645
46759
|
return expr.kind === 204 && expr.elements.length === 0;
|
|
46646
46760
|
}
|
|
46647
46761
|
function addOptionality(type, isProperty, isOptional) {
|
|
46648
|
-
if (isProperty === void 0) { isProperty =
|
|
46762
|
+
if (isProperty === void 0) { isProperty = undefined; }
|
|
46649
46763
|
if (isOptional === void 0) { isOptional = true; }
|
|
46650
46764
|
return strictNullChecks && isOptional ? getOptionalType(type, isProperty) : type;
|
|
46651
46765
|
}
|
|
@@ -46667,9 +46781,9 @@ var ts;
|
|
|
46667
46781
|
isOptionalJSDocPropertyLikeTag(declaration));
|
|
46668
46782
|
var declaredType = tryGetTypeFromEffectiveTypeNode(declaration);
|
|
46669
46783
|
if (declaredType) {
|
|
46670
|
-
return addOptionality(declaredType, isProperty, isOptional);
|
|
46784
|
+
return addOptionality(declaredType, isProperty ? declaration : undefined, isOptional);
|
|
46671
46785
|
}
|
|
46672
|
-
if ((noImplicitAny || ts.isInJSFile(declaration)) &&
|
|
46786
|
+
if ((noImplicitAny(declaration) || ts.isInJSFile(declaration)) &&
|
|
46673
46787
|
ts.isVariableDeclaration(declaration) && !ts.isBindingPattern(declaration.name) &&
|
|
46674
46788
|
!(ts.getCombinedModifierFlags(declaration) & 1) && !(declaration.flags & 16777216)) {
|
|
46675
46789
|
if (!(ts.getCombinedNodeFlags(declaration) & 2) && (!declaration.initializer || isNullOrUndefined(declaration.initializer))) {
|
|
@@ -46700,7 +46814,7 @@ var ts;
|
|
|
46700
46814
|
}
|
|
46701
46815
|
var type = declaration.symbol.escapedName === "this" ? getContextualThisParameterType(func) : getContextuallyTypedParameterType(declaration);
|
|
46702
46816
|
if (type) {
|
|
46703
|
-
return addOptionality(type,
|
|
46817
|
+
return addOptionality(type, undefined, isOptional);
|
|
46704
46818
|
}
|
|
46705
46819
|
}
|
|
46706
46820
|
if (ts.hasOnlyExpressionInitializer(declaration) && !!declaration.initializer) {
|
|
@@ -46711,22 +46825,22 @@ var ts;
|
|
|
46711
46825
|
}
|
|
46712
46826
|
}
|
|
46713
46827
|
var type = widenTypeInferredFromInitializer(declaration, checkDeclarationInitializer(declaration, checkMode));
|
|
46714
|
-
return addOptionality(type, isProperty, isOptional);
|
|
46828
|
+
return addOptionality(type, isProperty ? declaration : undefined, isOptional);
|
|
46715
46829
|
}
|
|
46716
|
-
if (ts.isPropertyDeclaration(declaration) && (noImplicitAny || ts.isInJSFile(declaration))) {
|
|
46830
|
+
if (ts.isPropertyDeclaration(declaration) && (noImplicitAny(declaration) || ts.isInJSFile(declaration))) {
|
|
46717
46831
|
if (!ts.hasStaticModifier(declaration)) {
|
|
46718
46832
|
var constructor = findConstructorDeclaration(declaration.parent);
|
|
46719
46833
|
var type = constructor ? getFlowTypeInConstructor(declaration.symbol, constructor) :
|
|
46720
46834
|
ts.getEffectiveModifierFlags(declaration) & 2 ? getTypeOfPropertyInBaseClass(declaration.symbol) :
|
|
46721
46835
|
undefined;
|
|
46722
|
-
return type && addOptionality(type,
|
|
46836
|
+
return type && addOptionality(type, declaration, isOptional);
|
|
46723
46837
|
}
|
|
46724
46838
|
else {
|
|
46725
46839
|
var staticBlocks = ts.filter(declaration.parent.members, ts.isClassStaticBlockDeclaration);
|
|
46726
46840
|
var type = staticBlocks.length ? getFlowTypeInStaticBlocks(declaration.symbol, staticBlocks) :
|
|
46727
46841
|
ts.getEffectiveModifierFlags(declaration) & 2 ? getTypeOfPropertyInBaseClass(declaration.symbol) :
|
|
46728
46842
|
undefined;
|
|
46729
|
-
return type && addOptionality(type,
|
|
46843
|
+
return type && addOptionality(type, declaration, isOptional);
|
|
46730
46844
|
}
|
|
46731
46845
|
}
|
|
46732
46846
|
if (ts.isJsxAttribute(declaration)) {
|
|
@@ -46756,7 +46870,7 @@ var ts;
|
|
|
46756
46870
|
function isAutoTypedProperty(symbol) {
|
|
46757
46871
|
var declaration = symbol.valueDeclaration;
|
|
46758
46872
|
return declaration && ts.isPropertyDeclaration(declaration) && !ts.getEffectiveTypeAnnotationNode(declaration) &&
|
|
46759
|
-
!declaration.initializer && (noImplicitAny || ts.isInJSFile(declaration));
|
|
46873
|
+
!declaration.initializer && (noImplicitAny(declaration) || ts.isInJSFile(declaration));
|
|
46760
46874
|
}
|
|
46761
46875
|
function getDeclaringConstructor(symbol) {
|
|
46762
46876
|
if (!symbol.declarations) {
|
|
@@ -46772,7 +46886,7 @@ var ts;
|
|
|
46772
46886
|
;
|
|
46773
46887
|
}
|
|
46774
46888
|
function getFlowTypeFromCommonJSExport(symbol) {
|
|
46775
|
-
var file =
|
|
46889
|
+
var file = getSourceFileOfNode(symbol.declarations[0]);
|
|
46776
46890
|
var accessName = ts.unescapeLeadingUnderscores(symbol.escapedName);
|
|
46777
46891
|
var areAllModuleExports = symbol.declarations.every(function (d) { return ts.isInJSFile(d) && ts.isAccessExpression(d) && ts.isModuleExportsAccessExpression(d.expression); });
|
|
46778
46892
|
var reference = areAllModuleExports
|
|
@@ -46797,7 +46911,7 @@ var ts;
|
|
|
46797
46911
|
ts.setParent(reference, staticBlock);
|
|
46798
46912
|
reference.flowNode = staticBlock.returnFlowNode;
|
|
46799
46913
|
var flowType = getFlowTypeOfProperty(reference, symbol);
|
|
46800
|
-
if (noImplicitAny && (flowType === autoType || flowType === autoArrayType)) {
|
|
46914
|
+
if (noImplicitAny(reference) && (flowType === autoType || flowType === autoArrayType)) {
|
|
46801
46915
|
error(symbol.valueDeclaration, ts.Diagnostics.Member_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(flowType));
|
|
46802
46916
|
}
|
|
46803
46917
|
if (everyType(flowType, isNullableType)) {
|
|
@@ -46815,7 +46929,7 @@ var ts;
|
|
|
46815
46929
|
ts.setParent(reference, constructor);
|
|
46816
46930
|
reference.flowNode = constructor.returnFlowNode;
|
|
46817
46931
|
var flowType = getFlowTypeOfProperty(reference, symbol);
|
|
46818
|
-
if (noImplicitAny && (flowType === autoType || flowType === autoArrayType)) {
|
|
46932
|
+
if (noImplicitAny(reference) && (flowType === autoType || flowType === autoArrayType)) {
|
|
46819
46933
|
error(symbol.valueDeclaration, ts.Diagnostics.Member_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(flowType));
|
|
46820
46934
|
}
|
|
46821
46935
|
return everyType(flowType, isNullableType) ? undefined : convertAutoToAny(flowType);
|
|
@@ -46891,7 +47005,7 @@ var ts;
|
|
|
46891
47005
|
type = getUnionType(sourceTypes);
|
|
46892
47006
|
}
|
|
46893
47007
|
}
|
|
46894
|
-
var widened = getWidenedType(addOptionality(type,
|
|
47008
|
+
var widened = getWidenedType(addOptionality(type, undefined, definedInMethod && !definedInConstructor));
|
|
46895
47009
|
if (symbol.valueDeclaration && filterType(widened, function (t) { return !!(t.flags & ~98304); }) === neverType) {
|
|
46896
47010
|
reportImplicitAny(symbol.valueDeclaration, anyType);
|
|
46897
47011
|
return anyType;
|
|
@@ -46990,7 +47104,7 @@ var ts;
|
|
|
46990
47104
|
var exportedMember = members_4.get(name);
|
|
46991
47105
|
if (exportedMember && exportedMember !== s) {
|
|
46992
47106
|
if (s.flags & 111551 && exportedMember.flags & 111551) {
|
|
46993
|
-
if (s.valueDeclaration && exportedMember.valueDeclaration &&
|
|
47107
|
+
if (s.valueDeclaration && exportedMember.valueDeclaration && getSourceFileOfNode(s.valueDeclaration) !== getSourceFileOfNode(exportedMember.valueDeclaration)) {
|
|
46994
47108
|
var unescapedName = ts.unescapeLeadingUnderscores(s.escapedName);
|
|
46995
47109
|
var exportedMemberName = ((_a = ts.tryCast(exportedMember.valueDeclaration, ts.isNamedDeclaration)) === null || _a === void 0 ? void 0 : _a.name) || exportedMember.valueDeclaration;
|
|
46996
47110
|
ts.addRelatedInfo(error(s.valueDeclaration, ts.Diagnostics.Duplicate_identifier_0, unescapedName), ts.createDiagnosticForNode(exportedMemberName, ts.Diagnostics._0_was_also_declared_here, unescapedName));
|
|
@@ -47180,7 +47294,7 @@ var ts;
|
|
|
47180
47294
|
return anyType;
|
|
47181
47295
|
}
|
|
47182
47296
|
if (symbol.flags & 134217728 && symbol.valueDeclaration) {
|
|
47183
|
-
var fileSymbol = getSymbolOfNode(
|
|
47297
|
+
var fileSymbol = getSymbolOfNode(getSourceFileOfNode(symbol.valueDeclaration));
|
|
47184
47298
|
var result = createSymbol(fileSymbol.flags, "exports");
|
|
47185
47299
|
result.declarations = fileSymbol.declarations ? fileSymbol.declarations.slice() : [];
|
|
47186
47300
|
result.parent = symbol;
|
|
@@ -47200,7 +47314,7 @@ var ts;
|
|
|
47200
47314
|
if (ts.isCatchClauseVariableDeclarationOrBindingElement(declaration)) {
|
|
47201
47315
|
var typeNode = ts.getEffectiveTypeAnnotationNode(declaration);
|
|
47202
47316
|
if (typeNode === undefined) {
|
|
47203
|
-
return useUnknownInCatchVariables ? unknownType : anyType;
|
|
47317
|
+
return useUnknownInCatchVariables(getSourceFileOfNode(declaration)) ? unknownType : anyType;
|
|
47204
47318
|
}
|
|
47205
47319
|
var type_2 = getTypeOfNode(typeNode);
|
|
47206
47320
|
return isTypeAny(type_2) || type_2 === unknownType ? type_2 : errorType;
|
|
@@ -47321,10 +47435,10 @@ var ts;
|
|
|
47321
47435
|
getter && getter.body && getReturnTypeFromBody(getter);
|
|
47322
47436
|
if (!type) {
|
|
47323
47437
|
if (setter && !isPrivateWithinAmbient(setter)) {
|
|
47324
|
-
errorOrSuggestion(noImplicitAny, setter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation, symbolToString(symbol));
|
|
47438
|
+
errorOrSuggestion(noImplicitAny(setter), setter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation, symbolToString(symbol));
|
|
47325
47439
|
}
|
|
47326
47440
|
else if (getter && !isPrivateWithinAmbient(getter)) {
|
|
47327
|
-
errorOrSuggestion(noImplicitAny, getter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation, symbolToString(symbol));
|
|
47441
|
+
errorOrSuggestion(noImplicitAny(getter), getter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation, symbolToString(symbol));
|
|
47328
47442
|
}
|
|
47329
47443
|
type = anyType;
|
|
47330
47444
|
}
|
|
@@ -47335,7 +47449,7 @@ var ts;
|
|
|
47335
47449
|
else if (getAnnotatedAccessorTypeNode(setter)) {
|
|
47336
47450
|
error(setter, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol));
|
|
47337
47451
|
}
|
|
47338
|
-
else if (getter && noImplicitAny) {
|
|
47452
|
+
else if (getter && noImplicitAny(getter)) {
|
|
47339
47453
|
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));
|
|
47340
47454
|
}
|
|
47341
47455
|
type = anyType;
|
|
@@ -47448,7 +47562,7 @@ var ts;
|
|
|
47448
47562
|
error(symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol));
|
|
47449
47563
|
return errorType;
|
|
47450
47564
|
}
|
|
47451
|
-
if (noImplicitAny && (declaration.kind !== 164 || declaration.initializer)) {
|
|
47565
|
+
if (noImplicitAny(declaration) && (declaration.kind !== 164 || declaration.initializer)) {
|
|
47452
47566
|
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));
|
|
47453
47567
|
}
|
|
47454
47568
|
return anyType;
|
|
@@ -48986,8 +49100,8 @@ var ts;
|
|
|
48986
49100
|
var templateType = getTemplateTypeFromMappedType(mappedType.target || mappedType);
|
|
48987
49101
|
var mapper = appendTypeMapping(mappedType.mapper, getTypeParameterFromMappedType(mappedType), symbol.keyType);
|
|
48988
49102
|
var propType = instantiateType(templateType, mapper);
|
|
48989
|
-
var type = strictNullChecks && symbol.flags & 16777216 && !maybeTypeOfKind(propType, 32768 | 16384) ? getOptionalType(propType,
|
|
48990
|
-
symbol.checkFlags & 524288 ? removeMissingOrUndefinedType(propType) :
|
|
49103
|
+
var type = strictNullChecks && symbol.flags & 16777216 && !maybeTypeOfKind(propType, 32768 | 16384) ? getOptionalType(propType, mappedType.declaration) :
|
|
49104
|
+
symbol.checkFlags & 524288 ? removeMissingOrUndefinedType(propType, mappedType.declaration) :
|
|
48991
49105
|
propType;
|
|
48992
49106
|
if (!popTypeResolution()) {
|
|
48993
49107
|
error(currentNode, ts.Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1, symbolToString(symbol), typeToString(mappedType));
|
|
@@ -49013,7 +49127,7 @@ var ts;
|
|
|
49013
49127
|
function getTemplateTypeFromMappedType(type) {
|
|
49014
49128
|
return type.templateType ||
|
|
49015
49129
|
(type.templateType = type.declaration.type ?
|
|
49016
|
-
instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type),
|
|
49130
|
+
instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), type.declaration, !!(getMappedTypeModifiers(type) & 4)), type.mapper) :
|
|
49017
49131
|
errorType);
|
|
49018
49132
|
}
|
|
49019
49133
|
function getConstraintDeclarationForMappedType(type) {
|
|
@@ -49667,9 +49781,10 @@ var ts;
|
|
|
49667
49781
|
}
|
|
49668
49782
|
if (skipObjectFunctionPropertyAugment)
|
|
49669
49783
|
return undefined;
|
|
49784
|
+
var file = (symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration) && getSourceFileOfNode(symbol.valueDeclaration);
|
|
49670
49785
|
var functionType = resolved === anyFunctionType ? globalFunctionType :
|
|
49671
|
-
resolved.callSignatures.length ? globalCallableFunctionType :
|
|
49672
|
-
resolved.constructSignatures.length ? globalNewableFunctionType :
|
|
49786
|
+
resolved.callSignatures.length ? globalCallableFunctionType(file) :
|
|
49787
|
+
resolved.constructSignatures.length ? globalNewableFunctionType(file) :
|
|
49673
49788
|
undefined;
|
|
49674
49789
|
if (functionType) {
|
|
49675
49790
|
var symbol_1 = getPropertyOfObjectType(functionType, name);
|
|
@@ -50081,7 +50196,7 @@ var ts;
|
|
|
50081
50196
|
if (typeNode) {
|
|
50082
50197
|
error(typeNode, ts.Diagnostics.Return_type_annotation_circularly_references_itself);
|
|
50083
50198
|
}
|
|
50084
|
-
else if (noImplicitAny) {
|
|
50199
|
+
else if (noImplicitAny(signature.declaration)) {
|
|
50085
50200
|
var declaration = signature.declaration;
|
|
50086
50201
|
var name = ts.getNameOfDeclaration(declaration);
|
|
50087
50202
|
if (name) {
|
|
@@ -50438,7 +50553,7 @@ var ts;
|
|
|
50438
50553
|
var numTypeArguments = ts.length(node.typeArguments);
|
|
50439
50554
|
var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters);
|
|
50440
50555
|
var isJs = ts.isInJSFile(node);
|
|
50441
|
-
var isJsImplicitAny = !noImplicitAny && isJs;
|
|
50556
|
+
var isJsImplicitAny = !noImplicitAny(node) && isJs;
|
|
50442
50557
|
if (!isJsImplicitAny && (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length)) {
|
|
50443
50558
|
var missingAugmentsTag = isJs && ts.isExpressionWithTypeArguments(node) && !ts.isJSDocAugmentsTag(node.parent);
|
|
50444
50559
|
var diag = minTypeArgumentCount === typeParameters.length ?
|
|
@@ -50687,9 +50802,9 @@ var ts;
|
|
|
50687
50802
|
checkNoTypeArguments(node);
|
|
50688
50803
|
return globalFunctionType;
|
|
50689
50804
|
case "array":
|
|
50690
|
-
return (!typeArgs || !typeArgs.length) && !noImplicitAny ? anyArrayType : undefined;
|
|
50805
|
+
return (!typeArgs || !typeArgs.length) && !noImplicitAny(node) ? anyArrayType : undefined;
|
|
50691
50806
|
case "promise":
|
|
50692
|
-
return (!typeArgs || !typeArgs.length) && !noImplicitAny ? createPromiseType(anyType) : undefined;
|
|
50807
|
+
return (!typeArgs || !typeArgs.length) && !noImplicitAny(node) ? createPromiseType(anyType) : undefined;
|
|
50693
50808
|
case "Object":
|
|
50694
50809
|
if (typeArgs && typeArgs.length === 2) {
|
|
50695
50810
|
if (ts.isJSDocIndexSignature(node)) {
|
|
@@ -50701,7 +50816,7 @@ var ts;
|
|
|
50701
50816
|
return anyType;
|
|
50702
50817
|
}
|
|
50703
50818
|
checkNoTypeArguments(node);
|
|
50704
|
-
return !noImplicitAny ? anyType : undefined;
|
|
50819
|
+
return !noImplicitAny(node) ? anyType : undefined;
|
|
50705
50820
|
}
|
|
50706
50821
|
}
|
|
50707
50822
|
}
|
|
@@ -51195,7 +51310,7 @@ var ts;
|
|
|
51195
51310
|
return type.elementFlags.length - ts.findLastIndex(type.elementFlags, function (f) { return !(f & flags); }) - 1;
|
|
51196
51311
|
}
|
|
51197
51312
|
function getTypeFromOptionalTypeNode(node) {
|
|
51198
|
-
return addOptionality(getTypeFromTypeNode(node.type),
|
|
51313
|
+
return addOptionality(getTypeFromTypeNode(node.type), node);
|
|
51199
51314
|
}
|
|
51200
51315
|
function getTypeId(type) {
|
|
51201
51316
|
return type.id;
|
|
@@ -51366,7 +51481,7 @@ var ts;
|
|
|
51366
51481
|
includes & 8388608 ? wildcardType : anyType :
|
|
51367
51482
|
includes & 65536 || containsType(typeSet, unknownType) ? unknownType : nonNullUnknownType;
|
|
51368
51483
|
}
|
|
51369
|
-
if (
|
|
51484
|
+
if (includes & 32768) {
|
|
51370
51485
|
var missingIndex = ts.binarySearch(typeSet, missingType, getTypeId, ts.compareValues);
|
|
51371
51486
|
if (missingIndex >= 0 && containsType(typeSet, undefinedType)) {
|
|
51372
51487
|
ts.orderedRemoveItemAt(typeSet, missingIndex);
|
|
@@ -51505,7 +51620,7 @@ var ts;
|
|
|
51505
51620
|
includes |= 8388608;
|
|
51506
51621
|
}
|
|
51507
51622
|
else if (strictNullChecks || !(flags & 98304)) {
|
|
51508
|
-
if (
|
|
51623
|
+
if (type === missingType) {
|
|
51509
51624
|
includes |= 262144;
|
|
51510
51625
|
type = undefinedType;
|
|
51511
51626
|
}
|
|
@@ -51683,7 +51798,7 @@ var ts;
|
|
|
51683
51798
|
result = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
|
|
51684
51799
|
}
|
|
51685
51800
|
else if (eachIsUnionContaining(typeSet, 32768)) {
|
|
51686
|
-
var undefinedOrMissingType =
|
|
51801
|
+
var undefinedOrMissingType = ts.some(typeSet, function (t) { return containsType(t.types, missingType); }) ? missingType : undefinedType;
|
|
51687
51802
|
removeFromEach(typeSet, 32768);
|
|
51688
51803
|
result = getUnionType([getIntersectionType(typeSet), undefinedOrMissingType], 1, aliasSymbol, aliasTypeArguments);
|
|
51689
51804
|
}
|
|
@@ -52039,15 +52154,15 @@ var ts;
|
|
|
52039
52154
|
type.aliasTypeArguments = aliasTypeArguments;
|
|
52040
52155
|
return type;
|
|
52041
52156
|
}
|
|
52042
|
-
function isJSLiteralType(type) {
|
|
52043
|
-
if (noImplicitAny) {
|
|
52157
|
+
function isJSLiteralType(type, context) {
|
|
52158
|
+
if (noImplicitAny(getSourceFileOfNode(context))) {
|
|
52044
52159
|
return false;
|
|
52045
52160
|
}
|
|
52046
52161
|
if (ts.getObjectFlags(type) & 4096) {
|
|
52047
52162
|
return true;
|
|
52048
52163
|
}
|
|
52049
52164
|
if (type.flags & 1048576) {
|
|
52050
|
-
return ts.every(type.types, isJSLiteralType);
|
|
52165
|
+
return ts.every(type.types, function (t) { return isJSLiteralType(t); });
|
|
52051
52166
|
}
|
|
52052
52167
|
if (type.flags & 2097152) {
|
|
52053
52168
|
return ts.some(type.types, isJSLiteralType);
|
|
@@ -52147,12 +52262,12 @@ var ts;
|
|
|
52147
52262
|
if (indexType.flags & 131072) {
|
|
52148
52263
|
return neverType;
|
|
52149
52264
|
}
|
|
52150
|
-
if (isJSLiteralType(objectType)) {
|
|
52265
|
+
if (isJSLiteralType(objectType, accessNode)) {
|
|
52151
52266
|
return anyType;
|
|
52152
52267
|
}
|
|
52153
52268
|
if (accessExpression && !isConstEnumObjectType(objectType)) {
|
|
52154
52269
|
if (isObjectLiteralType(objectType)) {
|
|
52155
|
-
if (noImplicitAny && indexType.flags & (128 | 256)) {
|
|
52270
|
+
if (noImplicitAny(accessNode) && indexType.flags & (128 | 256)) {
|
|
52156
52271
|
diagnostics.add(ts.createDiagnosticForNode(accessExpression, ts.Diagnostics.Property_0_does_not_exist_on_type_1, indexType.value, typeToString(objectType)));
|
|
52157
52272
|
return undefinedType;
|
|
52158
52273
|
}
|
|
@@ -52166,7 +52281,7 @@ var ts;
|
|
|
52166
52281
|
if (objectType.symbol === globalThisSymbol && propName !== undefined && globalThisSymbol.exports.has(propName) && (globalThisSymbol.exports.get(propName).flags & 418)) {
|
|
52167
52282
|
error(accessExpression, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.unescapeLeadingUnderscores(propName), typeToString(objectType));
|
|
52168
52283
|
}
|
|
52169
|
-
else if (noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors && !(accessFlags & 128)) {
|
|
52284
|
+
else if (noImplicitAny(accessExpression) && !compilerOptions.suppressImplicitAnyIndexErrors && !(accessFlags & 128)) {
|
|
52170
52285
|
if (propName !== undefined && typeHasStaticProperty(propName, objectType)) {
|
|
52171
52286
|
var typeName = typeToString(objectType);
|
|
52172
52287
|
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) + "]");
|
|
@@ -52213,7 +52328,7 @@ var ts;
|
|
|
52213
52328
|
return undefined;
|
|
52214
52329
|
}
|
|
52215
52330
|
}
|
|
52216
|
-
if (isJSLiteralType(objectType)) {
|
|
52331
|
+
if (isJSLiteralType(objectType, accessNode)) {
|
|
52217
52332
|
return anyType;
|
|
52218
52333
|
}
|
|
52219
52334
|
if (accessNode) {
|
|
@@ -52381,7 +52496,7 @@ var ts;
|
|
|
52381
52496
|
if (isStringIndexSignatureOnlyType(objectType) && !(indexType.flags & 98304) && isTypeAssignableToKind(indexType, 4 | 8)) {
|
|
52382
52497
|
indexType = stringType;
|
|
52383
52498
|
}
|
|
52384
|
-
if (compilerOptions
|
|
52499
|
+
if (ts.getFileLocalCompilerOption(getSourceFileOfNode(accessNode), compilerOptions, "noUncheckedIndexedAccess") && accessFlags & 32)
|
|
52385
52500
|
accessFlags |= 1;
|
|
52386
52501
|
if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 194 ?
|
|
52387
52502
|
isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target.fixedLength) :
|
|
@@ -52777,7 +52892,7 @@ var ts;
|
|
|
52777
52892
|
var isSetonlyAccessor = prop.flags & 65536 && !(prop.flags & 32768);
|
|
52778
52893
|
var flags = 4 | 16777216;
|
|
52779
52894
|
var result = createSymbol(flags, prop.escapedName, getIsLateCheckFlag(prop) | (readonly ? 8 : 0));
|
|
52780
|
-
result.type = isSetonlyAccessor ? undefinedType : addOptionality(getTypeOfSymbol(prop),
|
|
52895
|
+
result.type = isSetonlyAccessor ? undefinedType : addOptionality(getTypeOfSymbol(prop), prop.valueDeclaration || ts.factory.createEmptyStatement());
|
|
52781
52896
|
result.declarations = prop.declarations;
|
|
52782
52897
|
result.nameType = getSymbolLinks(prop).nameType;
|
|
52783
52898
|
result.syntheticOrigin = prop;
|
|
@@ -52854,7 +52969,7 @@ var ts;
|
|
|
52854
52969
|
var declarations = ts.concatenate(leftProp.declarations, rightProp.declarations);
|
|
52855
52970
|
var flags = 4 | (leftProp.flags & 16777216);
|
|
52856
52971
|
var result = createSymbol(flags, leftProp.escapedName);
|
|
52857
|
-
result.type = getUnionType([getTypeOfSymbol(leftProp), removeMissingOrUndefinedType(rightType)], 2);
|
|
52972
|
+
result.type = getUnionType([getTypeOfSymbol(leftProp), removeMissingOrUndefinedType(rightType, rightProp.valueDeclaration)], 2);
|
|
52858
52973
|
result.leftSpread = leftProp;
|
|
52859
52974
|
result.rightSpread = rightProp;
|
|
52860
52975
|
result.declarations = declarations;
|
|
@@ -53021,7 +53136,7 @@ var ts;
|
|
|
53021
53136
|
var links = getNodeLinks(node);
|
|
53022
53137
|
return links.resolvedType || (links.resolvedType =
|
|
53023
53138
|
node.dotDotDotToken ? getTypeFromRestTypeNode(node) :
|
|
53024
|
-
addOptionality(getTypeFromTypeNode(node.type),
|
|
53139
|
+
addOptionality(getTypeFromTypeNode(node.type), node, !!node.questionToken));
|
|
53025
53140
|
}
|
|
53026
53141
|
function getTypeFromTypeNode(node) {
|
|
53027
53142
|
return getConditionalFlowTypeOfType(getTypeFromTypeNodeWorker(node), node);
|
|
@@ -53053,7 +53168,7 @@ var ts;
|
|
|
53053
53168
|
case 143:
|
|
53054
53169
|
return neverType;
|
|
53055
53170
|
case 148:
|
|
53056
|
-
return node.flags & 262144 && !noImplicitAny ? anyType : nonPrimitiveType;
|
|
53171
|
+
return node.flags & 262144 && !noImplicitAny(node) ? anyType : nonPrimitiveType;
|
|
53057
53172
|
case 138:
|
|
53058
53173
|
return intrinsicMarkerType;
|
|
53059
53174
|
case 192:
|
|
@@ -53418,7 +53533,7 @@ var ts;
|
|
|
53418
53533
|
var templateMapper = appendTypeMapping(mapper, getTypeParameterFromMappedType(type), key);
|
|
53419
53534
|
var propType = instantiateType(getTemplateTypeFromMappedType(type.target || type), templateMapper);
|
|
53420
53535
|
var modifiers = getMappedTypeModifiers(type);
|
|
53421
|
-
return strictNullChecks && modifiers & 4 && !maybeTypeOfKind(propType, 32768 | 16384) ? getOptionalType(propType,
|
|
53536
|
+
return strictNullChecks && modifiers & 4 && !maybeTypeOfKind(propType, 32768 | 16384) ? getOptionalType(propType, type.declaration) :
|
|
53422
53537
|
strictNullChecks && modifiers & 8 && isOptional ? getTypeWithFacts(propType, 524288) :
|
|
53423
53538
|
propType;
|
|
53424
53539
|
}
|
|
@@ -53818,7 +53933,7 @@ var ts;
|
|
|
53818
53933
|
if (!elaborated) {
|
|
53819
53934
|
var resultObj = errorOutputContainer || {};
|
|
53820
53935
|
var specificSource = next ? checkExpressionForMutableLocationWithContextualType(next, sourcePropType) : sourcePropType;
|
|
53821
|
-
if (exactOptionalPropertyTypes && isExactOptionalPropertyMismatch(specificSource, targetPropType)) {
|
|
53936
|
+
if (exactOptionalPropertyTypes(prop) && isExactOptionalPropertyMismatch(specificSource, targetPropType)) {
|
|
53822
53937
|
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));
|
|
53823
53938
|
diagnostics.add(diag);
|
|
53824
53939
|
resultObj.errors = [diag];
|
|
@@ -53840,14 +53955,14 @@ var ts;
|
|
|
53840
53955
|
var issuedElaboration = false;
|
|
53841
53956
|
if (!targetProp) {
|
|
53842
53957
|
var indexInfo = getApplicableIndexInfo(target, nameType);
|
|
53843
|
-
if (indexInfo && indexInfo.declaration && !
|
|
53958
|
+
if (indexInfo && indexInfo.declaration && !getSourceFileOfNode(indexInfo.declaration).hasNoDefaultLib) {
|
|
53844
53959
|
issuedElaboration = true;
|
|
53845
53960
|
ts.addRelatedInfo(reportedDiag, ts.createDiagnosticForNode(indexInfo.declaration, ts.Diagnostics.The_expected_type_comes_from_this_index_signature));
|
|
53846
53961
|
}
|
|
53847
53962
|
}
|
|
53848
53963
|
if (!issuedElaboration && (targetProp && ts.length(targetProp.declarations) || target.symbol && ts.length(target.symbol.declarations))) {
|
|
53849
53964
|
var targetNode = targetProp && ts.length(targetProp.declarations) ? targetProp.declarations[0] : target.symbol.declarations[0];
|
|
53850
|
-
if (!
|
|
53965
|
+
if (!getSourceFileOfNode(targetNode).hasNoDefaultLib) {
|
|
53851
53966
|
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)));
|
|
53852
53967
|
}
|
|
53853
53968
|
}
|
|
@@ -54130,7 +54245,10 @@ var ts;
|
|
|
54130
54245
|
void instantiateType(sourceRestType || targetRestType, reportUnreliableMarkers);
|
|
54131
54246
|
}
|
|
54132
54247
|
var kind = target.declaration ? target.declaration.kind : 0;
|
|
54133
|
-
var
|
|
54248
|
+
var sourceFile = source.declaration && getSourceFileOfNode(source.declaration);
|
|
54249
|
+
var targetFile = target.declaration && getSourceFileOfNode(target.declaration);
|
|
54250
|
+
var strictSignatureComparison = strictFunctionTypes(sourceFile) || strictFunctionTypes(targetFile);
|
|
54251
|
+
var strictVariance = !(checkMode & 3) && strictSignatureComparison && kind !== 169 &&
|
|
54134
54252
|
kind !== 168 && kind !== 171;
|
|
54135
54253
|
var result = -1;
|
|
54136
54254
|
var sourceThisType = getThisTypeOfSignature(source);
|
|
@@ -54647,7 +54765,7 @@ var ts;
|
|
|
54647
54765
|
else if (sourceType === targetType) {
|
|
54648
54766
|
message = ts.Diagnostics.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated;
|
|
54649
54767
|
}
|
|
54650
|
-
else if (
|
|
54768
|
+
else if (getExactOptionalUnassignableProperties(source, target).length) {
|
|
54651
54769
|
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;
|
|
54652
54770
|
}
|
|
54653
54771
|
else {
|
|
@@ -54662,7 +54780,6 @@ var ts;
|
|
|
54662
54780
|
}
|
|
54663
54781
|
}
|
|
54664
54782
|
else if (message === ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1
|
|
54665
|
-
&& exactOptionalPropertyTypes
|
|
54666
54783
|
&& getExactOptionalUnassignableProperties(source, target).length) {
|
|
54667
54784
|
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;
|
|
54668
54785
|
}
|
|
@@ -54880,8 +54997,10 @@ var ts;
|
|
|
54880
54997
|
return getUnionType(ts.reduceLeft(types, appendPropType, undefined) || ts.emptyArray);
|
|
54881
54998
|
}
|
|
54882
54999
|
function hasExcessProperties(source, target, reportErrors) {
|
|
54883
|
-
var _a;
|
|
54884
|
-
|
|
55000
|
+
var _a, _b, _c;
|
|
55001
|
+
var sourceNoImplicitAny = noImplicitAny((_a = source.symbol) === null || _a === void 0 ? void 0 : _a.valueDeclaration);
|
|
55002
|
+
var targetNoImplicitAny = noImplicitAny((_b = target.symbol) === null || _b === void 0 ? void 0 : _b.valueDeclaration);
|
|
55003
|
+
if (!isExcessPropertyCheckTarget(target) || !(sourceNoImplicitAny || targetNoImplicitAny) && ts.getObjectFlags(target) & 4096) {
|
|
54885
55004
|
return false;
|
|
54886
55005
|
}
|
|
54887
55006
|
var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 2048);
|
|
@@ -54903,7 +55022,7 @@ var ts;
|
|
|
54903
55022
|
if (!errorNode)
|
|
54904
55023
|
return { value: ts.Debug.fail() };
|
|
54905
55024
|
if (ts.isJsxAttributes(errorNode) || ts.isJsxOpeningLikeElement(errorNode) || ts.isJsxOpeningLikeElement(errorNode.parent)) {
|
|
54906
|
-
if (prop.valueDeclaration && ts.isJsxAttribute(prop.valueDeclaration) &&
|
|
55025
|
+
if (prop.valueDeclaration && ts.isJsxAttribute(prop.valueDeclaration) && getSourceFileOfNode(errorNode) === getSourceFileOfNode(prop.valueDeclaration.name)) {
|
|
54907
55026
|
errorNode = prop.valueDeclaration.name;
|
|
54908
55027
|
}
|
|
54909
55028
|
var propName = symbolToString(prop);
|
|
@@ -54917,9 +55036,9 @@ var ts;
|
|
|
54917
55036
|
}
|
|
54918
55037
|
}
|
|
54919
55038
|
else {
|
|
54920
|
-
var objectLiteralDeclaration_1 = ((
|
|
55039
|
+
var objectLiteralDeclaration_1 = ((_c = source.symbol) === null || _c === void 0 ? void 0 : _c.declarations) && ts.firstOrUndefined(source.symbol.declarations);
|
|
54921
55040
|
var suggestion = void 0;
|
|
54922
|
-
if (prop.valueDeclaration && ts.findAncestor(prop.valueDeclaration, function (d) { return d === objectLiteralDeclaration_1; }) &&
|
|
55041
|
+
if (prop.valueDeclaration && ts.findAncestor(prop.valueDeclaration, function (d) { return d === objectLiteralDeclaration_1; }) && getSourceFileOfNode(objectLiteralDeclaration_1) === getSourceFileOfNode(errorNode)) {
|
|
54923
55042
|
var propDeclaration = prop.valueDeclaration;
|
|
54924
55043
|
ts.Debug.assertNode(propDeclaration, ts.isObjectLiteralElementLike);
|
|
54925
55044
|
errorNode = propDeclaration;
|
|
@@ -54946,8 +55065,8 @@ var ts;
|
|
|
54946
55065
|
}
|
|
54947
55066
|
}
|
|
54948
55067
|
};
|
|
54949
|
-
for (var _i = 0,
|
|
54950
|
-
var prop =
|
|
55068
|
+
for (var _i = 0, _d = getPropertiesOfType(source); _i < _d.length; _i++) {
|
|
55069
|
+
var prop = _d[_i];
|
|
54951
55070
|
var state_6 = _loop_20(prop);
|
|
54952
55071
|
if (typeof state_6 === "object")
|
|
54953
55072
|
return state_6.value;
|
|
@@ -55793,7 +55912,7 @@ var ts;
|
|
|
55793
55912
|
}
|
|
55794
55913
|
function isPropertySymbolTypeRelated(sourceProp, targetProp, getTypeOfSourceProperty, reportErrors, intersectionState) {
|
|
55795
55914
|
var targetIsOptional = strictNullChecks && !!(ts.getCheckFlags(targetProp) & 48);
|
|
55796
|
-
var effectiveTarget = addOptionality(getNonMissingTypeOfSymbol(targetProp),
|
|
55915
|
+
var effectiveTarget = addOptionality(getNonMissingTypeOfSymbol(targetProp), undefined, targetIsOptional);
|
|
55797
55916
|
var effectiveSource = getTypeOfSourceProperty(sourceProp);
|
|
55798
55917
|
return isRelatedTo(effectiveSource, effectiveTarget, 3, reportErrors, undefined, intersectionState);
|
|
55799
55918
|
}
|
|
@@ -56187,7 +56306,7 @@ var ts;
|
|
|
56187
56306
|
}
|
|
56188
56307
|
if (isApplicableIndexType(getLiteralTypeFromProperty(prop, 8576), keyType)) {
|
|
56189
56308
|
var propType = getNonMissingTypeOfSymbol(prop);
|
|
56190
|
-
var type = exactOptionalPropertyTypes || propType.flags & 32768 || keyType === numberType || !(prop.flags & 16777216)
|
|
56309
|
+
var type = exactOptionalPropertyTypes(prop.valueDeclaration) || propType.flags & 32768 || keyType === numberType || !(prop.flags & 16777216)
|
|
56191
56310
|
? propType
|
|
56192
56311
|
: getTypeWithFacts(propType, 524288);
|
|
56193
56312
|
var related = isRelatedTo(type, targetInfo.type, 3, reportErrors);
|
|
@@ -56941,10 +57060,10 @@ var ts;
|
|
|
56941
57060
|
missing === 65536 ? getUnionType([type, nullType]) :
|
|
56942
57061
|
getUnionType([type, undefinedType, nullType]);
|
|
56943
57062
|
}
|
|
56944
|
-
function getOptionalType(type,
|
|
56945
|
-
if (
|
|
57063
|
+
function getOptionalType(type, property) {
|
|
57064
|
+
if (property === void 0) { property = undefined; }
|
|
56946
57065
|
ts.Debug.assert(strictNullChecks);
|
|
56947
|
-
return type.flags & 32768 ? type : getUnionType([type,
|
|
57066
|
+
return type.flags & 32768 ? type : getUnionType([type, property ? getMissingOrUndefinedType(property) : undefinedType]);
|
|
56948
57067
|
}
|
|
56949
57068
|
function getGlobalNonNullableTypeInstantiation(type) {
|
|
56950
57069
|
if (!deferredGlobalNonNullableTypeAlias) {
|
|
@@ -56972,13 +57091,13 @@ var ts;
|
|
|
56972
57091
|
exprType;
|
|
56973
57092
|
}
|
|
56974
57093
|
function removeMissingType(type, isOptional) {
|
|
56975
|
-
return
|
|
57094
|
+
return isOptional ? removeType(type, missingType) : type;
|
|
56976
57095
|
}
|
|
56977
57096
|
function containsMissingType(type) {
|
|
56978
|
-
return
|
|
57097
|
+
return (type === missingType || type.flags & 1048576 && containsType(type.types, missingType));
|
|
56979
57098
|
}
|
|
56980
|
-
function removeMissingOrUndefinedType(type) {
|
|
56981
|
-
return exactOptionalPropertyTypes ? removeType(type, missingType) : getTypeWithFacts(type, 524288);
|
|
57099
|
+
function removeMissingOrUndefinedType(type, context) {
|
|
57100
|
+
return exactOptionalPropertyTypes(context) ? removeType(type, missingType) : getTypeWithFacts(type, 524288);
|
|
56982
57101
|
}
|
|
56983
57102
|
function isCoercibleUnderDoubleEquals(source, target) {
|
|
56984
57103
|
return ((source.flags & (8 | 4 | 512)) !== 0)
|
|
@@ -57085,7 +57204,7 @@ var ts;
|
|
|
57085
57204
|
if (cached) {
|
|
57086
57205
|
return cached;
|
|
57087
57206
|
}
|
|
57088
|
-
var result = createSymbolWithType(prop,
|
|
57207
|
+
var result = createSymbolWithType(prop, getMissingOrUndefinedType(prop.valueDeclaration));
|
|
57089
57208
|
result.flags |= 16777216;
|
|
57090
57209
|
undefinedProperties.set(prop.escapedName, result);
|
|
57091
57210
|
return result;
|
|
@@ -57182,7 +57301,7 @@ var ts;
|
|
|
57182
57301
|
}
|
|
57183
57302
|
function reportImplicitAny(declaration, type, wideningKind) {
|
|
57184
57303
|
var typeAsString = typeToString(getWidenedType(type));
|
|
57185
|
-
if (ts.isInJSFile(declaration) && !ts.isCheckJsEnabledForFile(
|
|
57304
|
+
if (ts.isInJSFile(declaration) && !ts.isCheckJsEnabledForFile(getSourceFileOfNode(declaration), compilerOptions)) {
|
|
57186
57305
|
return;
|
|
57187
57306
|
}
|
|
57188
57307
|
var diagnostic;
|
|
@@ -57190,7 +57309,7 @@ var ts;
|
|
|
57190
57309
|
case 221:
|
|
57191
57310
|
case 167:
|
|
57192
57311
|
case 166:
|
|
57193
|
-
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;
|
|
57312
|
+
diagnostic = noImplicitAny(declaration) ? 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;
|
|
57194
57313
|
break;
|
|
57195
57314
|
case 164:
|
|
57196
57315
|
var param = declaration;
|
|
@@ -57201,16 +57320,16 @@ var ts;
|
|
|
57201
57320
|
param.name.originalKeywordKind && ts.isTypeNodeKind(param.name.originalKeywordKind))) {
|
|
57202
57321
|
var newName = "arg" + param.parent.parameters.indexOf(param);
|
|
57203
57322
|
var typeName = ts.declarationNameToString(param.name) + (param.dotDotDotToken ? "[]" : "");
|
|
57204
|
-
errorOrSuggestion(noImplicitAny, declaration, ts.Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, typeName);
|
|
57323
|
+
errorOrSuggestion(noImplicitAny(declaration), declaration, ts.Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, typeName);
|
|
57205
57324
|
return;
|
|
57206
57325
|
}
|
|
57207
57326
|
diagnostic = declaration.dotDotDotToken ?
|
|
57208
|
-
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 :
|
|
57209
|
-
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;
|
|
57327
|
+
noImplicitAny(declaration) ? 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 :
|
|
57328
|
+
noImplicitAny(declaration) ? 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;
|
|
57210
57329
|
break;
|
|
57211
57330
|
case 203:
|
|
57212
57331
|
diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type;
|
|
57213
|
-
if (!noImplicitAny) {
|
|
57332
|
+
if (!noImplicitAny(declaration)) {
|
|
57214
57333
|
return;
|
|
57215
57334
|
}
|
|
57216
57335
|
break;
|
|
@@ -57224,7 +57343,7 @@ var ts;
|
|
|
57224
57343
|
case 173:
|
|
57225
57344
|
case 213:
|
|
57226
57345
|
case 214:
|
|
57227
|
-
if (noImplicitAny && !declaration.name) {
|
|
57346
|
+
if (noImplicitAny(declaration) && !declaration.name) {
|
|
57228
57347
|
if (wideningKind === 3) {
|
|
57229
57348
|
error(declaration, ts.Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, typeAsString);
|
|
57230
57349
|
}
|
|
@@ -57233,23 +57352,23 @@ var ts;
|
|
|
57233
57352
|
}
|
|
57234
57353
|
return;
|
|
57235
57354
|
}
|
|
57236
|
-
diagnostic = !noImplicitAny ? ts.Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage :
|
|
57355
|
+
diagnostic = !noImplicitAny(declaration) ? ts.Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage :
|
|
57237
57356
|
wideningKind === 3 ? ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type :
|
|
57238
57357
|
ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type;
|
|
57239
57358
|
break;
|
|
57240
57359
|
case 195:
|
|
57241
|
-
if (noImplicitAny) {
|
|
57360
|
+
if (noImplicitAny(declaration)) {
|
|
57242
57361
|
error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type);
|
|
57243
57362
|
}
|
|
57244
57363
|
return;
|
|
57245
57364
|
default:
|
|
57246
|
-
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;
|
|
57365
|
+
diagnostic = noImplicitAny(declaration) ? 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;
|
|
57247
57366
|
}
|
|
57248
|
-
errorOrSuggestion(noImplicitAny, declaration, diagnostic, ts.declarationNameToString(ts.getNameOfDeclaration(declaration)), typeAsString);
|
|
57367
|
+
errorOrSuggestion(noImplicitAny(declaration), declaration, diagnostic, ts.declarationNameToString(ts.getNameOfDeclaration(declaration)), typeAsString);
|
|
57249
57368
|
}
|
|
57250
57369
|
function reportErrorsFromWidening(declaration, type, wideningKind) {
|
|
57251
57370
|
addLazyDiagnostic(function () {
|
|
57252
|
-
if (noImplicitAny && ts.getObjectFlags(type) & 65536 && (!wideningKind || !getContextualSignatureForFunctionLikeDeclaration(declaration))) {
|
|
57371
|
+
if (noImplicitAny(declaration) && ts.getObjectFlags(type) & 65536 && (!wideningKind || !getContextualSignatureForFunctionLikeDeclaration(declaration))) {
|
|
57253
57372
|
if (!reportWideningErrorsInType(type)) {
|
|
57254
57373
|
reportImplicitAny(declaration, type, wideningKind);
|
|
57255
57374
|
}
|
|
@@ -57925,7 +58044,11 @@ var ts;
|
|
|
57925
58044
|
}
|
|
57926
58045
|
}
|
|
57927
58046
|
function inferFromContravariantTypes(source, target) {
|
|
57928
|
-
|
|
58047
|
+
var _a, _b, _c, _d;
|
|
58048
|
+
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);
|
|
58049
|
+
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);
|
|
58050
|
+
var strictSignatureComparison = strictFunctionTypes(sourceFile) || strictFunctionTypes(targetFile);
|
|
58051
|
+
if (strictSignatureComparison || priority & 1024) {
|
|
57929
58052
|
contravariant = !contravariant;
|
|
57930
58053
|
inferFromTypes(source, target);
|
|
57931
58054
|
contravariant = !contravariant;
|
|
@@ -58240,7 +58363,7 @@ var ts;
|
|
|
58240
58363
|
var prop = _b[_a];
|
|
58241
58364
|
if (isApplicableIndexType(getLiteralTypeFromProperty(prop, 8576), targetInfo.keyType)) {
|
|
58242
58365
|
var propType = getTypeOfSymbol(prop);
|
|
58243
|
-
propTypes.push(prop.flags & 16777216 ? removeMissingOrUndefinedType(propType) : propType);
|
|
58366
|
+
propTypes.push(prop.flags & 16777216 ? removeMissingOrUndefinedType(propType, prop.valueDeclaration) : propType);
|
|
58244
58367
|
}
|
|
58245
58368
|
}
|
|
58246
58369
|
for (var _c = 0, _d = getIndexInfosOfType(source); _c < _d.length; _c++) {
|
|
@@ -58264,7 +58387,7 @@ var ts;
|
|
|
58264
58387
|
}
|
|
58265
58388
|
}
|
|
58266
58389
|
function isTypeOrBaseIdenticalTo(s, t) {
|
|
58267
|
-
return
|
|
58390
|
+
return t === missingType ? s === t :
|
|
58268
58391
|
(isTypeIdenticalTo(s, t) || !!(t.flags & 4 && s.flags & 128 || t.flags & 8 && s.flags & 256));
|
|
58269
58392
|
}
|
|
58270
58393
|
function isTypeCloselyMatchedBy(s, t) {
|
|
@@ -58836,17 +58959,18 @@ var ts;
|
|
|
58836
58959
|
if (!isTypeUsableAsPropertyName(nameType))
|
|
58837
58960
|
return errorType;
|
|
58838
58961
|
var text = getPropertyNameFromType(nameType);
|
|
58839
|
-
return getTypeOfPropertyOfType(type, text) || includeUndefinedInIndexSignature((_a = getApplicableIndexInfoForName(type, text)) === null || _a === void 0 ? void 0 : _a.type) || errorType;
|
|
58962
|
+
return getTypeOfPropertyOfType(type, text) || includeUndefinedInIndexSignature((_a = getApplicableIndexInfoForName(type, text)) === null || _a === void 0 ? void 0 : _a.type, type) || errorType;
|
|
58840
58963
|
}
|
|
58841
58964
|
function getTypeOfDestructuredArrayElement(type, index) {
|
|
58842
58965
|
return everyType(type, isTupleLikeType) && getTupleElementType(type, index) ||
|
|
58843
|
-
includeUndefinedInIndexSignature(checkIteratedTypeOrElementType(65, type, undefinedType, undefined)) ||
|
|
58966
|
+
includeUndefinedInIndexSignature(checkIteratedTypeOrElementType(65, type, undefinedType, undefined), type) ||
|
|
58844
58967
|
errorType;
|
|
58845
58968
|
}
|
|
58846
|
-
function includeUndefinedInIndexSignature(type) {
|
|
58969
|
+
function includeUndefinedInIndexSignature(type, parentType) {
|
|
58970
|
+
var _a;
|
|
58847
58971
|
if (!type)
|
|
58848
58972
|
return type;
|
|
58849
|
-
return compilerOptions
|
|
58973
|
+
return ts.getFileLocalCompilerOption(getSourceFileOfNode((_a = parentType.symbol) === null || _a === void 0 ? void 0 : _a.valueDeclaration), compilerOptions, "noUncheckedIndexedAccess") ?
|
|
58850
58974
|
getUnionType([type, undefinedType]) :
|
|
58851
58975
|
type;
|
|
58852
58976
|
}
|
|
@@ -59267,7 +59391,7 @@ var ts;
|
|
|
59267
59391
|
}
|
|
59268
59392
|
function reportFlowControlError(node) {
|
|
59269
59393
|
var block = ts.findAncestor(node, ts.isFunctionOrModuleBlock);
|
|
59270
|
-
var sourceFile =
|
|
59394
|
+
var sourceFile = getSourceFileOfNode(node);
|
|
59271
59395
|
var span = ts.getSpanOfTokenAtPosition(sourceFile, block.statements.pos);
|
|
59272
59396
|
diagnostics.add(ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.The_containing_function_or_module_body_is_too_large_for_control_flow_analysis));
|
|
59273
59397
|
}
|
|
@@ -59975,10 +60099,10 @@ var ts;
|
|
|
59975
60099
|
if (symbol === undefined) {
|
|
59976
60100
|
return type;
|
|
59977
60101
|
}
|
|
59978
|
-
var classSymbol =
|
|
60102
|
+
var classSymbol = symbol.parent;
|
|
59979
60103
|
var targetType = ts.hasStaticModifier(ts.Debug.checkDefined(symbol.valueDeclaration, "should always have a declaration"))
|
|
59980
60104
|
? getTypeOfSymbol(classSymbol)
|
|
59981
|
-
:
|
|
60105
|
+
: getDeclaredTypeOfSymbol(classSymbol);
|
|
59982
60106
|
return getNarrowedType(type, targetType, assumeTrue, true);
|
|
59983
60107
|
}
|
|
59984
60108
|
function narrowTypeByOptionalChainContainment(type, operator, value, assumeTrue) {
|
|
@@ -60600,7 +60724,7 @@ var ts;
|
|
|
60600
60724
|
var flowType = getFlowTypeOfReference(node, type, initialType, flowContainer);
|
|
60601
60725
|
if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) {
|
|
60602
60726
|
if (flowType === autoType || flowType === autoArrayType) {
|
|
60603
|
-
if (noImplicitAny) {
|
|
60727
|
+
if (noImplicitAny(node)) {
|
|
60604
60728
|
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));
|
|
60605
60729
|
error(node, ts.Diagnostics.Variable_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(flowType));
|
|
60606
60730
|
}
|
|
@@ -60774,7 +60898,7 @@ var ts;
|
|
|
60774
60898
|
captureLexicalThis(node, container);
|
|
60775
60899
|
}
|
|
60776
60900
|
var type = tryGetThisTypeAt(node, true, container);
|
|
60777
|
-
if (noImplicitThis) {
|
|
60901
|
+
if (noImplicitThis(getSourceFileOfNode(node))) {
|
|
60778
60902
|
var globalThisType_1 = getTypeOfSymbol(globalThisSymbol);
|
|
60779
60903
|
if (type === globalThisType_1 && capturedByArrowFunction) {
|
|
60780
60904
|
error(node, ts.Diagnostics.The_containing_arrow_function_captures_the_global_value_of_this);
|
|
@@ -61051,7 +61175,7 @@ var ts;
|
|
|
61051
61175
|
}
|
|
61052
61176
|
}
|
|
61053
61177
|
var inJs = ts.isInJSFile(func);
|
|
61054
|
-
if (noImplicitThis || inJs) {
|
|
61178
|
+
if (noImplicitThis(getSourceFileOfNode(func)) || inJs) {
|
|
61055
61179
|
var containingLiteral = getContainingObjectLiteral(func);
|
|
61056
61180
|
if (containingLiteral) {
|
|
61057
61181
|
var contextualType = getApparentTypeOfContextualType(containingLiteral, undefined);
|
|
@@ -61076,7 +61200,7 @@ var ts;
|
|
|
61076
61200
|
if (ts.isAccessExpression(target)) {
|
|
61077
61201
|
var expression = target.expression;
|
|
61078
61202
|
if (inJs && ts.isIdentifier(expression)) {
|
|
61079
|
-
var sourceFile =
|
|
61203
|
+
var sourceFile = getSourceFileOfNode(parent);
|
|
61080
61204
|
if (sourceFile.commonJsModuleIndicator && getResolvedSymbol(expression) === sourceFile.symbol) {
|
|
61081
61205
|
return undefined;
|
|
61082
61206
|
}
|
|
@@ -61790,7 +61914,7 @@ var ts;
|
|
|
61790
61914
|
}
|
|
61791
61915
|
}
|
|
61792
61916
|
function getIntersectedSignatures(signatures) {
|
|
61793
|
-
return ts.
|
|
61917
|
+
return ts.some(signatures, function (s) { return noImplicitAny(s.declaration); })
|
|
61794
61918
|
? ts.reduceLeft(signatures, function (left, right) {
|
|
61795
61919
|
return left === right || !left ? left
|
|
61796
61920
|
: compareTypeParametersIdentical(left.typeParameters, right.typeParameters) ? combineSignaturesOfIntersectionMembers(left, right)
|
|
@@ -61967,7 +62091,7 @@ var ts;
|
|
|
61967
62091
|
elementFlags.push(4);
|
|
61968
62092
|
}
|
|
61969
62093
|
}
|
|
61970
|
-
else if (exactOptionalPropertyTypes && e.kind === 227) {
|
|
62094
|
+
else if (exactOptionalPropertyTypes(e) && e.kind === 227) {
|
|
61971
62095
|
hasOmittedExpression = true;
|
|
61972
62096
|
elementTypes.push(missingType);
|
|
61973
62097
|
elementFlags.push(2);
|
|
@@ -61975,7 +62099,7 @@ var ts;
|
|
|
61975
62099
|
else {
|
|
61976
62100
|
var elementContextualType = getContextualTypeForElementExpression(contextualType, elementTypes.length);
|
|
61977
62101
|
var type = checkExpressionForMutableLocation(e, checkMode, elementContextualType, forceTuple);
|
|
61978
|
-
elementTypes.push(addOptionality(type,
|
|
62102
|
+
elementTypes.push(addOptionality(type, e, hasOmittedExpression));
|
|
61979
62103
|
elementFlags.push(hasOmittedExpression ? 2 : 1);
|
|
61980
62104
|
if (contextualType && someType(contextualType, isTupleLikeType) && checkMode && checkMode & 2 && !(checkMode & 4) && isContextSensitive(e)) {
|
|
61981
62105
|
var inferenceContext = getInferenceContext(node);
|
|
@@ -62302,7 +62426,7 @@ var ts;
|
|
|
62302
62426
|
}
|
|
62303
62427
|
function checkJsxFragment(node) {
|
|
62304
62428
|
checkJsxOpeningLikeElementOrOpeningFragment(node.openingFragment);
|
|
62305
|
-
var nodeSourceFile =
|
|
62429
|
+
var nodeSourceFile = getSourceFileOfNode(node);
|
|
62306
62430
|
if (ts.getJSXTransformEnabled(compilerOptions) && (compilerOptions.jsxFactory || nodeSourceFile.pragmas.has("jsx"))
|
|
62307
62431
|
&& !compilerOptions.jsxFragmentFactory && !nodeSourceFile.pragmas.has("jsxfrag")) {
|
|
62308
62432
|
error(node, compilerOptions.jsxFactory
|
|
@@ -62475,7 +62599,7 @@ var ts;
|
|
|
62475
62599
|
return links.resolvedSymbol = unknownSymbol;
|
|
62476
62600
|
}
|
|
62477
62601
|
else {
|
|
62478
|
-
if (noImplicitAny) {
|
|
62602
|
+
if (noImplicitAny(node)) {
|
|
62479
62603
|
error(node, ts.Diagnostics.JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists, ts.unescapeLeadingUnderscores(JsxNames.IntrinsicElements));
|
|
62480
62604
|
}
|
|
62481
62605
|
return links.resolvedSymbol = unknownSymbol;
|
|
@@ -62484,7 +62608,7 @@ var ts;
|
|
|
62484
62608
|
return links.resolvedSymbol;
|
|
62485
62609
|
}
|
|
62486
62610
|
function getJsxNamespaceContainerForImplicitImport(location) {
|
|
62487
|
-
var file = location &&
|
|
62611
|
+
var file = location && getSourceFileOfNode(location);
|
|
62488
62612
|
var links = file && getNodeLinks(file);
|
|
62489
62613
|
if (links && links.jsxImplicitImportContainer === false) {
|
|
62490
62614
|
return undefined;
|
|
@@ -62673,7 +62797,7 @@ var ts;
|
|
|
62673
62797
|
error(errorNode, ts.Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided);
|
|
62674
62798
|
}
|
|
62675
62799
|
if (getJsxElementTypeAt(errorNode) === undefined) {
|
|
62676
|
-
if (noImplicitAny) {
|
|
62800
|
+
if (noImplicitAny(errorNode)) {
|
|
62677
62801
|
error(errorNode, ts.Diagnostics.JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist);
|
|
62678
62802
|
}
|
|
62679
62803
|
}
|
|
@@ -62699,7 +62823,7 @@ var ts;
|
|
|
62699
62823
|
}
|
|
62700
62824
|
}
|
|
62701
62825
|
if (ts.isJsxOpeningFragment(node)) {
|
|
62702
|
-
var file =
|
|
62826
|
+
var file = getSourceFileOfNode(node);
|
|
62703
62827
|
var localJsxNamespace = getLocalJsxNamespace(file);
|
|
62704
62828
|
if (localJsxNamespace) {
|
|
62705
62829
|
resolveName(jsxFactoryLocation, localJsxNamespace, 111551, jsxFactoryRefErr, localJsxNamespace, true);
|
|
@@ -63065,14 +63189,14 @@ var ts;
|
|
|
63065
63189
|
getApplicableIndexInfoForName(apparentType, right.escapedText) : undefined;
|
|
63066
63190
|
if (!(indexInfo && indexInfo.type)) {
|
|
63067
63191
|
var isUncheckedJS = isUncheckedJSSuggestion(node, leftType.symbol, true);
|
|
63068
|
-
if (!isUncheckedJS && isJSLiteralType(leftType)) {
|
|
63192
|
+
if (!isUncheckedJS && isJSLiteralType(leftType, node)) {
|
|
63069
63193
|
return anyType;
|
|
63070
63194
|
}
|
|
63071
63195
|
if (leftType.symbol === globalThisSymbol) {
|
|
63072
63196
|
if (globalThisSymbol.exports.has(right.escapedText) && (globalThisSymbol.exports.get(right.escapedText).flags & 418)) {
|
|
63073
63197
|
error(right, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.unescapeLeadingUnderscores(right.escapedText), typeToString(leftType));
|
|
63074
63198
|
}
|
|
63075
|
-
else if (noImplicitAny) {
|
|
63199
|
+
else if (noImplicitAny(right)) {
|
|
63076
63200
|
error(right, ts.Diagnostics.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature, typeToString(leftType));
|
|
63077
63201
|
}
|
|
63078
63202
|
return anyType;
|
|
@@ -63085,8 +63209,8 @@ var ts;
|
|
|
63085
63209
|
if (indexInfo.isReadonly && (ts.isAssignmentTarget(node) || ts.isDeleteTarget(node))) {
|
|
63086
63210
|
error(node, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType));
|
|
63087
63211
|
}
|
|
63088
|
-
propType = (compilerOptions
|
|
63089
|
-
if (compilerOptions
|
|
63212
|
+
propType = (ts.getFileLocalCompilerOption(getSourceFileOfNode(node), compilerOptions, "noUncheckedIndexedAccess") && !ts.isAssignmentTarget(node)) ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;
|
|
63213
|
+
if (ts.getFileLocalCompilerOption(getSourceFileOfNode(node), compilerOptions, "noPropertyAccessFromIndexSignature") && ts.isPropertyAccessExpression(node)) {
|
|
63090
63214
|
error(right, ts.Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0, ts.unescapeLeadingUnderscores(right.escapedText));
|
|
63091
63215
|
}
|
|
63092
63216
|
if (indexInfo.declaration && ts.getCombinedNodeFlags(indexInfo.declaration) & 268435456) {
|
|
@@ -63111,10 +63235,10 @@ var ts;
|
|
|
63111
63235
|
return getFlowTypeOfAccessExpression(node, prop, propType, right, checkMode);
|
|
63112
63236
|
}
|
|
63113
63237
|
function isUncheckedJSSuggestion(node, suggestion, excludeClasses) {
|
|
63114
|
-
var file =
|
|
63238
|
+
var file = getSourceFileOfNode(node);
|
|
63115
63239
|
if (file) {
|
|
63116
63240
|
if (compilerOptions.checkJs === undefined && file.checkJsDirective === undefined && (file.scriptKind === 1 || file.scriptKind === 2)) {
|
|
63117
|
-
var declarationFile = ts.forEach(suggestion === null || suggestion === void 0 ? void 0 : suggestion.declarations,
|
|
63241
|
+
var declarationFile = ts.forEach(suggestion === null || suggestion === void 0 ? void 0 : suggestion.declarations, getSourceFileOfNode);
|
|
63118
63242
|
return !(file !== declarationFile && !!declarationFile && isGlobalSourceFile(declarationFile))
|
|
63119
63243
|
&& !(excludeClasses && suggestion && suggestion.flags & 32)
|
|
63120
63244
|
&& !(!!node && excludeClasses && ts.isPropertyAccessExpression(node) && node.expression.kind === 108);
|
|
@@ -63138,7 +63262,8 @@ var ts;
|
|
|
63138
63262
|
}
|
|
63139
63263
|
propType = getNarrowableTypeForReference(propType, node, checkMode);
|
|
63140
63264
|
var assumeUninitialized = false;
|
|
63141
|
-
|
|
63265
|
+
var file = getSourceFileOfNode(node);
|
|
63266
|
+
if (strictNullChecks && strictPropertyInitialization(file) && ts.isAccessExpression(node) && node.expression.kind === 108) {
|
|
63142
63267
|
var declaration = prop && prop.valueDeclaration;
|
|
63143
63268
|
if (declaration && isPropertyWithoutInitializer(declaration)) {
|
|
63144
63269
|
if (!ts.isStatic(declaration)) {
|
|
@@ -63164,7 +63289,7 @@ var ts;
|
|
|
63164
63289
|
}
|
|
63165
63290
|
function checkPropertyNotUsedBeforeDeclaration(prop, node, right) {
|
|
63166
63291
|
var valueDeclaration = prop.valueDeclaration;
|
|
63167
|
-
if (!valueDeclaration ||
|
|
63292
|
+
if (!valueDeclaration || getSourceFileOfNode(node).isDeclarationFile) {
|
|
63168
63293
|
return;
|
|
63169
63294
|
}
|
|
63170
63295
|
var diagnosticMessage;
|
|
@@ -64122,7 +64247,7 @@ var ts;
|
|
|
64122
64247
|
function getDiagnosticSpanForCallNode(node, doNotIncludeArguments) {
|
|
64123
64248
|
var start;
|
|
64124
64249
|
var length;
|
|
64125
|
-
var sourceFile =
|
|
64250
|
+
var sourceFile = getSourceFileOfNode(node);
|
|
64126
64251
|
if (ts.isPropertyAccessExpression(node.expression)) {
|
|
64127
64252
|
var nameSpan = ts.getErrorSpanForNode(sourceFile, node.expression.name);
|
|
64128
64253
|
start = nameSpan.start;
|
|
@@ -64218,7 +64343,7 @@ var ts;
|
|
|
64218
64343
|
end++;
|
|
64219
64344
|
}
|
|
64220
64345
|
ts.setTextRangePosEnd(errorSpan, pos, end);
|
|
64221
|
-
return ts.createDiagnosticForNodeArray(
|
|
64346
|
+
return ts.createDiagnosticForNodeArray(getSourceFileOfNode(node), errorSpan, error, parameterRange, args.length);
|
|
64222
64347
|
}
|
|
64223
64348
|
}
|
|
64224
64349
|
function getTypeArgumentArityError(node, signatures, typeArguments) {
|
|
@@ -64227,7 +64352,7 @@ var ts;
|
|
|
64227
64352
|
var sig = signatures[0];
|
|
64228
64353
|
var min_1 = getMinTypeArgumentCount(sig.typeParameters);
|
|
64229
64354
|
var max = ts.length(sig.typeParameters);
|
|
64230
|
-
return ts.createDiagnosticForNodeArray(
|
|
64355
|
+
return ts.createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, min_1 < max ? min_1 + "-" + max : min_1, argCount);
|
|
64231
64356
|
}
|
|
64232
64357
|
var belowArgCount = -Infinity;
|
|
64233
64358
|
var aboveArgCount = Infinity;
|
|
@@ -64243,9 +64368,9 @@ var ts;
|
|
|
64243
64368
|
}
|
|
64244
64369
|
}
|
|
64245
64370
|
if (belowArgCount !== -Infinity && aboveArgCount !== Infinity) {
|
|
64246
|
-
return ts.createDiagnosticForNodeArray(
|
|
64371
|
+
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);
|
|
64247
64372
|
}
|
|
64248
|
-
return ts.createDiagnosticForNodeArray(
|
|
64373
|
+
return ts.createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount);
|
|
64249
64374
|
}
|
|
64250
64375
|
function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) {
|
|
64251
64376
|
var isTaggedTemplate = node.kind === 210;
|
|
@@ -64609,7 +64734,7 @@ var ts;
|
|
|
64609
64734
|
else {
|
|
64610
64735
|
var relatedInformation = void 0;
|
|
64611
64736
|
if (node.arguments.length === 1) {
|
|
64612
|
-
var text =
|
|
64737
|
+
var text = getSourceFileOfNode(node).text;
|
|
64613
64738
|
if (ts.isLineBreak(text.charCodeAt(ts.skipTrivia(text, node.expression.end, true) - 1))) {
|
|
64614
64739
|
relatedInformation = ts.createDiagnosticForNode(node.expression, ts.Diagnostics.Are_you_missing_a_semicolon);
|
|
64615
64740
|
}
|
|
@@ -64675,7 +64800,7 @@ var ts;
|
|
|
64675
64800
|
var callSignatures = getSignaturesOfType(expressionType, 0);
|
|
64676
64801
|
if (callSignatures.length) {
|
|
64677
64802
|
var signature = resolveCall(node, callSignatures, candidatesOutArray, checkMode, 0);
|
|
64678
|
-
if (!noImplicitAny) {
|
|
64803
|
+
if (!noImplicitAny(node)) {
|
|
64679
64804
|
if (signature.declaration && !isJSConstructor(signature.declaration) && getReturnTypeOfSignature(signature) !== voidType) {
|
|
64680
64805
|
error(node, ts.Diagnostics.Only_a_void_function_can_be_called_with_the_new_keyword);
|
|
64681
64806
|
}
|
|
@@ -64925,7 +65050,7 @@ var ts;
|
|
|
64925
65050
|
checkTypeAssignableToAndOptionallyElaborate(checkExpressionWithContextualType(node.attributes, getEffectiveFirstArgumentForJsxSignature(fakeSignature, node), undefined, 0), result, node.tagName, node.attributes);
|
|
64926
65051
|
if (ts.length(node.typeArguments)) {
|
|
64927
65052
|
ts.forEach(node.typeArguments, checkSourceElement);
|
|
64928
|
-
diagnostics.add(ts.createDiagnosticForNodeArray(
|
|
65053
|
+
diagnostics.add(ts.createDiagnosticForNodeArray(getSourceFileOfNode(node), node.typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, 0, ts.length(node.typeArguments)));
|
|
64929
65054
|
}
|
|
64930
65055
|
return fakeSignature;
|
|
64931
65056
|
}
|
|
@@ -65099,7 +65224,7 @@ var ts;
|
|
|
65099
65224
|
declaration.kind !== 180 &&
|
|
65100
65225
|
!ts.isJSDocConstructSignature(declaration) &&
|
|
65101
65226
|
!isJSConstructor(declaration)) {
|
|
65102
|
-
if (noImplicitAny) {
|
|
65227
|
+
if (noImplicitAny(declaration)) {
|
|
65103
65228
|
error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type);
|
|
65104
65229
|
}
|
|
65105
65230
|
return anyType;
|
|
@@ -65286,7 +65411,7 @@ var ts;
|
|
|
65286
65411
|
}
|
|
65287
65412
|
function checkAssertion(node) {
|
|
65288
65413
|
if (node.kind === 211) {
|
|
65289
|
-
var file =
|
|
65414
|
+
var file = getSourceFileOfNode(node);
|
|
65290
65415
|
if (file && ts.fileExtensionIsOneOf(file.fileName, [".cts", ".mts"])) {
|
|
65291
65416
|
grammarErrorOnNode(node, ts.Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead);
|
|
65292
65417
|
}
|
|
@@ -65367,7 +65492,7 @@ var ts;
|
|
|
65367
65492
|
var result = getInstantiatedType(exprType);
|
|
65368
65493
|
var errorType = hasSomeApplicableSignature ? nonApplicableType : exprType;
|
|
65369
65494
|
if (errorType) {
|
|
65370
|
-
diagnostics.add(ts.createDiagnosticForNodeArray(
|
|
65495
|
+
diagnostics.add(ts.createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable, typeToString(errorType)));
|
|
65371
65496
|
}
|
|
65372
65497
|
return result;
|
|
65373
65498
|
function getInstantiatedType(type) {
|
|
@@ -65457,14 +65582,14 @@ var ts;
|
|
|
65457
65582
|
}
|
|
65458
65583
|
function checkImportMetaProperty(node) {
|
|
65459
65584
|
if (moduleKind === ts.ModuleKind.Node16 || moduleKind === ts.ModuleKind.NodeNext) {
|
|
65460
|
-
if (
|
|
65585
|
+
if (getSourceFileOfNode(node).impliedNodeFormat !== ts.ModuleKind.ESNext) {
|
|
65461
65586
|
error(node, ts.Diagnostics.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output);
|
|
65462
65587
|
}
|
|
65463
65588
|
}
|
|
65464
65589
|
else if (moduleKind < ts.ModuleKind.ES2020 && moduleKind !== ts.ModuleKind.System) {
|
|
65465
65590
|
error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext);
|
|
65466
65591
|
}
|
|
65467
|
-
var file =
|
|
65592
|
+
var file = getSourceFileOfNode(node);
|
|
65468
65593
|
ts.Debug.assert(!!(file.flags & 4194304), "Containing file is missing import meta node flag.");
|
|
65469
65594
|
return node.name.escapedText === "meta" ? getGlobalImportMetaType() : errorType;
|
|
65470
65595
|
}
|
|
@@ -66026,7 +66151,7 @@ var ts;
|
|
|
66026
66151
|
else if (type && strictNullChecks && !isTypeAssignableTo(undefinedType, type)) {
|
|
66027
66152
|
error(errorNode, ts.Diagnostics.Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined);
|
|
66028
66153
|
}
|
|
66029
|
-
else if (compilerOptions
|
|
66154
|
+
else if (ts.getFileLocalCompilerOption(getSourceFileOfNode(errorNode), compilerOptions, "noImplicitReturns")) {
|
|
66030
66155
|
if (!type) {
|
|
66031
66156
|
if (!hasExplicitReturn) {
|
|
66032
66157
|
return;
|
|
@@ -66256,7 +66381,7 @@ var ts;
|
|
|
66256
66381
|
var type = getTypeOfSymbol(symbol);
|
|
66257
66382
|
if (strictNullChecks &&
|
|
66258
66383
|
!(type.flags & (3 | 131072)) &&
|
|
66259
|
-
!(exactOptionalPropertyTypes ? symbol.flags & 16777216 : getTypeFacts(type) & 16777216)) {
|
|
66384
|
+
!(exactOptionalPropertyTypes(expr) ? symbol.flags & 16777216 : getTypeFacts(type) & 16777216)) {
|
|
66260
66385
|
error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_optional);
|
|
66261
66386
|
}
|
|
66262
66387
|
}
|
|
@@ -66275,7 +66400,7 @@ var ts;
|
|
|
66275
66400
|
}
|
|
66276
66401
|
else if (!(node.flags & 32768)) {
|
|
66277
66402
|
if (ts.isInTopLevelContext(node)) {
|
|
66278
|
-
var sourceFile =
|
|
66403
|
+
var sourceFile = getSourceFileOfNode(node);
|
|
66279
66404
|
if (!hasParseDiagnostics(sourceFile)) {
|
|
66280
66405
|
var span = void 0;
|
|
66281
66406
|
if (!ts.isEffectiveExternalModule(sourceFile, compilerOptions)) {
|
|
@@ -66305,7 +66430,7 @@ var ts;
|
|
|
66305
66430
|
}
|
|
66306
66431
|
}
|
|
66307
66432
|
else {
|
|
66308
|
-
var sourceFile =
|
|
66433
|
+
var sourceFile = getSourceFileOfNode(node);
|
|
66309
66434
|
if (!hasParseDiagnostics(sourceFile)) {
|
|
66310
66435
|
var span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos);
|
|
66311
66436
|
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);
|
|
@@ -66556,7 +66681,7 @@ var ts;
|
|
|
66556
66681
|
checkExternalEmitHelpers(node, 512);
|
|
66557
66682
|
}
|
|
66558
66683
|
var possiblyOutOfBoundsType = checkIteratedTypeOrElementType(65 | 128, sourceType, undefinedType, node) || errorType;
|
|
66559
|
-
var inBoundsType = compilerOptions
|
|
66684
|
+
var inBoundsType = ts.getFileLocalCompilerOption(getSourceFileOfNode(node), compilerOptions, "noUncheckedIndexedAccess") ? undefined : possiblyOutOfBoundsType;
|
|
66560
66685
|
for (var i = 0; i < elements.length; i++) {
|
|
66561
66686
|
var type = possiblyOutOfBoundsType;
|
|
66562
66687
|
if (node.elements[i].kind === 225) {
|
|
@@ -67011,7 +67136,7 @@ var ts;
|
|
|
67011
67136
|
}
|
|
67012
67137
|
case 27:
|
|
67013
67138
|
if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left) && !isEvalNode(right)) {
|
|
67014
|
-
var sf =
|
|
67139
|
+
var sf = getSourceFileOfNode(left);
|
|
67015
67140
|
var sourceText = sf.text;
|
|
67016
67141
|
var start_3 = ts.skipTrivia(sourceText, left.pos);
|
|
67017
67142
|
var isInDiag2657 = sf.parseDiagnostics.some(function (diag) {
|
|
@@ -67081,7 +67206,7 @@ var ts;
|
|
|
67081
67206
|
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)
|
|
67082
67207
|
&& (!ts.isIdentifier(left) || ts.unescapeLeadingUnderscores(left.escapedText) !== "exports")) {
|
|
67083
67208
|
var headMessage = void 0;
|
|
67084
|
-
if (exactOptionalPropertyTypes && ts.isPropertyAccessExpression(left) && maybeTypeOfKind(valueType, 32768)) {
|
|
67209
|
+
if (exactOptionalPropertyTypes(left) && ts.isPropertyAccessExpression(left) && maybeTypeOfKind(valueType, 32768)) {
|
|
67085
67210
|
var target = getTypeOfPropertyOfType(getTypeOfExpression(left.expression), left.name.escapedText);
|
|
67086
67211
|
if (isExactOptionalPropertyMismatch(valueType, target)) {
|
|
67087
67212
|
headMessage = ts.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target;
|
|
@@ -67206,7 +67331,7 @@ var ts;
|
|
|
67206
67331
|
if (!type) {
|
|
67207
67332
|
type = anyType;
|
|
67208
67333
|
addLazyDiagnostic(function () {
|
|
67209
|
-
if (noImplicitAny && !ts.expressionResultIsUnused(node)) {
|
|
67334
|
+
if (noImplicitAny(node) && !ts.expressionResultIsUnused(node)) {
|
|
67210
67335
|
var contextualType = getContextualType(node, undefined);
|
|
67211
67336
|
if (!contextualType || isTypeAny(contextualType)) {
|
|
67212
67337
|
error(node, ts.Diagnostics.yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation);
|
|
@@ -67908,7 +68033,7 @@ var ts;
|
|
|
67908
68033
|
function checkSignatureDeclarationDiagnostics() {
|
|
67909
68034
|
checkCollisionWithArgumentsInGeneratedCode(node);
|
|
67910
68035
|
var returnTypeNode = ts.getEffectiveReturnTypeNode(node);
|
|
67911
|
-
if (noImplicitAny && !returnTypeNode) {
|
|
68036
|
+
if (noImplicitAny(node) && !returnTypeNode) {
|
|
67912
68037
|
switch (node.kind) {
|
|
67913
68038
|
case 175:
|
|
67914
68039
|
error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);
|
|
@@ -69394,7 +69519,7 @@ var ts;
|
|
|
69394
69519
|
function registerForUnusedIdentifiersCheck(node) {
|
|
69395
69520
|
addLazyDiagnostic(registerForUnusedIdentifiersCheckDiagnostics);
|
|
69396
69521
|
function registerForUnusedIdentifiersCheckDiagnostics() {
|
|
69397
|
-
var sourceFile =
|
|
69522
|
+
var sourceFile = getSourceFileOfNode(node);
|
|
69398
69523
|
var potentiallyUnusedIdentifiers = allPotentiallyUnusedIdentifiers.get(sourceFile.path);
|
|
69399
69524
|
if (!potentiallyUnusedIdentifiers) {
|
|
69400
69525
|
potentiallyUnusedIdentifiers = [];
|
|
@@ -69513,7 +69638,7 @@ var ts;
|
|
|
69513
69638
|
var parent = typeParameter.parent;
|
|
69514
69639
|
if (parent.kind !== 190 && parent.typeParameters.every(isTypeParameterUnused)) {
|
|
69515
69640
|
if (ts.tryAddToSet(seenParentsWithEveryUnused, parent)) {
|
|
69516
|
-
var sourceFile =
|
|
69641
|
+
var sourceFile = getSourceFileOfNode(parent);
|
|
69517
69642
|
var range = ts.isJSDocTemplateTag(parent)
|
|
69518
69643
|
? ts.rangeOfNode(parent)
|
|
69519
69644
|
: ts.rangeOfTypeParameters(sourceFile, parent.typeParameters);
|
|
@@ -69663,7 +69788,7 @@ var ts;
|
|
|
69663
69788
|
ts.Debug.assert(ts.isParameterDeclaration(wrappingDeclaration), "Only parameter declaration should be checked here");
|
|
69664
69789
|
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));
|
|
69665
69790
|
if (!wrappingDeclaration.type) {
|
|
69666
|
-
ts.addRelatedInfo(diagnostic, ts.createFileDiagnostic(
|
|
69791
|
+
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)));
|
|
69667
69792
|
}
|
|
69668
69793
|
diagnostics.add(diagnostic);
|
|
69669
69794
|
}
|
|
@@ -69770,7 +69895,7 @@ var ts;
|
|
|
69770
69895
|
});
|
|
69771
69896
|
}
|
|
69772
69897
|
function checkCollisionWithRequireExportsInGeneratedCode(node, name) {
|
|
69773
|
-
if (moduleKind >= ts.ModuleKind.ES2015 && !(moduleKind >= ts.ModuleKind.Node16 &&
|
|
69898
|
+
if (moduleKind >= ts.ModuleKind.ES2015 && !(moduleKind >= ts.ModuleKind.Node16 && getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS)) {
|
|
69774
69899
|
return;
|
|
69775
69900
|
}
|
|
69776
69901
|
if (!name || !needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) {
|
|
@@ -70310,7 +70435,7 @@ var ts;
|
|
|
70310
70435
|
}
|
|
70311
70436
|
var uplevelIteration = languageVersion >= 2;
|
|
70312
70437
|
var downlevelIteration = !uplevelIteration && compilerOptions.downlevelIteration;
|
|
70313
|
-
var possibleOutOfBounds = compilerOptions
|
|
70438
|
+
var possibleOutOfBounds = ts.getFileLocalCompilerOption(getSourceFileOfNode(errorNode), compilerOptions, "noUncheckedIndexedAccess") && !!(use & 128);
|
|
70314
70439
|
if (uplevelIteration || downlevelIteration || allowAsyncIterables) {
|
|
70315
70440
|
var iterationTypes = getIterationTypesOfIterable(inputType, use, uplevelIteration ? errorNode : undefined);
|
|
70316
70441
|
if (checkAssignability) {
|
|
@@ -70326,7 +70451,7 @@ var ts;
|
|
|
70326
70451
|
}
|
|
70327
70452
|
}
|
|
70328
70453
|
if (iterationTypes || uplevelIteration) {
|
|
70329
|
-
return possibleOutOfBounds ? includeUndefinedInIndexSignature(iterationTypes && iterationTypes.yieldType) : (iterationTypes && iterationTypes.yieldType);
|
|
70454
|
+
return possibleOutOfBounds ? includeUndefinedInIndexSignature(iterationTypes && iterationTypes.yieldType, inputType) : (iterationTypes && iterationTypes.yieldType);
|
|
70330
70455
|
}
|
|
70331
70456
|
}
|
|
70332
70457
|
var arrayType = inputType;
|
|
@@ -70352,7 +70477,7 @@ var ts;
|
|
|
70352
70477
|
}
|
|
70353
70478
|
}
|
|
70354
70479
|
if (arrayType.flags & 131072) {
|
|
70355
|
-
return possibleOutOfBounds ? includeUndefinedInIndexSignature(stringType) : stringType;
|
|
70480
|
+
return possibleOutOfBounds ? includeUndefinedInIndexSignature(stringType, globalStringType) : stringType;
|
|
70356
70481
|
}
|
|
70357
70482
|
}
|
|
70358
70483
|
}
|
|
@@ -70362,16 +70487,16 @@ var ts;
|
|
|
70362
70487
|
var _a = getIterationDiagnosticDetails(allowsStrings, downlevelIteration), defaultDiagnostic = _a[0], maybeMissingAwait = _a[1];
|
|
70363
70488
|
errorAndMaybeSuggestAwait(errorNode, maybeMissingAwait && !!getAwaitedTypeOfPromise(arrayType), defaultDiagnostic, typeToString(arrayType));
|
|
70364
70489
|
}
|
|
70365
|
-
return hasStringConstituent ? possibleOutOfBounds ? includeUndefinedInIndexSignature(stringType) : stringType : undefined;
|
|
70490
|
+
return hasStringConstituent ? possibleOutOfBounds ? includeUndefinedInIndexSignature(stringType, globalStringType) : stringType : undefined;
|
|
70366
70491
|
}
|
|
70367
70492
|
var arrayElementType = getIndexTypeOfType(arrayType, numberType);
|
|
70368
70493
|
if (hasStringConstituent && arrayElementType) {
|
|
70369
|
-
if (arrayElementType.flags & 402653316 && !compilerOptions
|
|
70494
|
+
if (arrayElementType.flags & 402653316 && !ts.getFileLocalCompilerOption(getSourceFileOfNode(errorNode), compilerOptions, "noUncheckedIndexedAccess")) {
|
|
70370
70495
|
return stringType;
|
|
70371
70496
|
}
|
|
70372
70497
|
return getUnionType(possibleOutOfBounds ? [arrayElementType, stringType, undefinedType] : [arrayElementType, stringType], 2);
|
|
70373
70498
|
}
|
|
70374
|
-
return (use & 128) ? includeUndefinedInIndexSignature(arrayElementType) : arrayElementType;
|
|
70499
|
+
return (use & 128) ? includeUndefinedInIndexSignature(arrayElementType, arrayType) : arrayElementType;
|
|
70375
70500
|
function getIterationDiagnosticDetails(allowsStrings, downlevelIteration) {
|
|
70376
70501
|
var _a;
|
|
70377
70502
|
if (downlevelIteration) {
|
|
@@ -70812,7 +70937,7 @@ var ts;
|
|
|
70812
70937
|
}
|
|
70813
70938
|
}
|
|
70814
70939
|
}
|
|
70815
|
-
else if (container.kind !== 171 && compilerOptions
|
|
70940
|
+
else if (container.kind !== 171 && ts.getFileLocalCompilerOption(getSourceFileOfNode(node), compilerOptions, "noImplicitReturns") && !isUnwrappedReturnTypeVoidOrAny(container, returnType)) {
|
|
70816
70941
|
error(node, ts.Diagnostics.Not_all_code_paths_return_a_value);
|
|
70817
70942
|
}
|
|
70818
70943
|
}
|
|
@@ -70823,7 +70948,7 @@ var ts;
|
|
|
70823
70948
|
}
|
|
70824
70949
|
}
|
|
70825
70950
|
checkExpression(node.expression);
|
|
70826
|
-
var sourceFile =
|
|
70951
|
+
var sourceFile = getSourceFileOfNode(node);
|
|
70827
70952
|
if (!hasParseDiagnostics(sourceFile)) {
|
|
70828
70953
|
var start = ts.getSpanOfTokenAtPosition(sourceFile, node.pos).start;
|
|
70829
70954
|
var end = node.statement.pos;
|
|
@@ -70850,7 +70975,7 @@ var ts;
|
|
|
70850
70975
|
addLazyDiagnostic(createLazyCaseClauseDiagnostics(clause));
|
|
70851
70976
|
}
|
|
70852
70977
|
ts.forEach(clause.statements, checkSourceElement);
|
|
70853
|
-
if (compilerOptions
|
|
70978
|
+
if (ts.getFileLocalCompilerOption(getSourceFileOfNode(clause), compilerOptions, "noFallthroughCasesInSwitch") && clause.fallthroughFlowNode && isReachableFlowNode(clause.fallthroughFlowNode)) {
|
|
70854
70979
|
error(clause, ts.Diagnostics.Fallthrough_case_in_switch);
|
|
70855
70980
|
}
|
|
70856
70981
|
function createLazyCaseClauseDiagnostics(clause) {
|
|
@@ -71020,7 +71145,7 @@ var ts;
|
|
|
71020
71145
|
}
|
|
71021
71146
|
function checkClassNameCollisionWithObject(name) {
|
|
71022
71147
|
if (languageVersion >= 1 && name.escapedText === "Object"
|
|
71023
|
-
&& (moduleKind < ts.ModuleKind.ES2015 ||
|
|
71148
|
+
&& (moduleKind < ts.ModuleKind.ES2015 || getSourceFileOfNode(name).impliedNodeFormat === ts.ModuleKind.CommonJS)) {
|
|
71024
71149
|
error(name, ts.Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0, ts.ModuleKind[moduleKind]);
|
|
71025
71150
|
}
|
|
71026
71151
|
}
|
|
@@ -71326,7 +71451,7 @@ var ts;
|
|
|
71326
71451
|
function checkMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, memberHasOverrideModifier, memberHasAbstractModifier, memberIsStatic, memberIsParameterProperty, memberName, errorNode) {
|
|
71327
71452
|
var isJs = ts.isInJSFile(node);
|
|
71328
71453
|
var nodeInAmbientContext = !!(node.flags & 16777216);
|
|
71329
|
-
if (baseWithThis && (memberHasOverrideModifier || compilerOptions
|
|
71454
|
+
if (baseWithThis && (memberHasOverrideModifier || ts.getFileLocalCompilerOption(getSourceFileOfNode(node), compilerOptions, "noImplicitOverride"))) {
|
|
71330
71455
|
var memberEscapedName = ts.escapeLeadingUnderscores(memberName);
|
|
71331
71456
|
var thisType = memberIsStatic ? staticType : typeWithThis;
|
|
71332
71457
|
var baseType = memberIsStatic ? baseStaticType : baseWithThis;
|
|
@@ -71346,7 +71471,7 @@ var ts;
|
|
|
71346
71471
|
}
|
|
71347
71472
|
return 2;
|
|
71348
71473
|
}
|
|
71349
|
-
else if (prop && (baseProp === null || baseProp === void 0 ? void 0 : baseProp.declarations) && compilerOptions
|
|
71474
|
+
else if (prop && (baseProp === null || baseProp === void 0 ? void 0 : baseProp.declarations) && ts.getFileLocalCompilerOption(getSourceFileOfNode(node), compilerOptions, "noImplicitOverride") && !nodeInAmbientContext) {
|
|
71350
71475
|
var baseHasAbstract = ts.some(baseProp.declarations, ts.hasAbstractModifier);
|
|
71351
71476
|
if (memberHasOverrideModifier) {
|
|
71352
71477
|
return 0;
|
|
@@ -71614,7 +71739,7 @@ var ts;
|
|
|
71614
71739
|
return ok;
|
|
71615
71740
|
}
|
|
71616
71741
|
function checkPropertyInitialization(node) {
|
|
71617
|
-
if (!strictNullChecks || !strictPropertyInitialization || node.flags & 16777216) {
|
|
71742
|
+
if (!strictNullChecks || !strictPropertyInitialization(getSourceFileOfNode(node)) || node.flags & 16777216) {
|
|
71618
71743
|
return;
|
|
71619
71744
|
}
|
|
71620
71745
|
var constructor = findConstructorDeclaration(node);
|
|
@@ -71992,7 +72117,7 @@ var ts;
|
|
|
71992
72117
|
&& isInstantiatedModule(node, ts.shouldPreserveConstEnums(compilerOptions))) {
|
|
71993
72118
|
var firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol);
|
|
71994
72119
|
if (firstNonAmbientClassOrFunc) {
|
|
71995
|
-
if (
|
|
72120
|
+
if (getSourceFileOfNode(node) !== getSourceFileOfNode(firstNonAmbientClassOrFunc)) {
|
|
71996
72121
|
error(node.name, ts.Diagnostics.A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged);
|
|
71997
72122
|
}
|
|
71998
72123
|
else if (node.pos < firstNonAmbientClassOrFunc.pos) {
|
|
@@ -72147,7 +72272,7 @@ var ts;
|
|
|
72147
72272
|
ts.Debug.assert(node.kind !== 274);
|
|
72148
72273
|
if (node.kind === 275) {
|
|
72149
72274
|
var diag = error(errorNode, ts.Diagnostics.Types_cannot_appear_in_export_declarations_in_JavaScript_files);
|
|
72150
|
-
var alreadyExportedSymbol = (_b = (_a =
|
|
72275
|
+
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);
|
|
72151
72276
|
if (alreadyExportedSymbol === target) {
|
|
72152
72277
|
var exportingDeclaration = (_c = alreadyExportedSymbol.declarations) === null || _c === void 0 ? void 0 : _c.find(ts.isJSDocNode);
|
|
72153
72278
|
if (exportingDeclaration) {
|
|
@@ -72197,7 +72322,7 @@ var ts;
|
|
|
72197
72322
|
break;
|
|
72198
72323
|
}
|
|
72199
72324
|
case 275: {
|
|
72200
|
-
if (
|
|
72325
|
+
if (getSourceFileOfNode(typeOnlyAlias) !== getSourceFileOfNode(node)) {
|
|
72201
72326
|
var message = isType
|
|
72202
72327
|
? ts.Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type
|
|
72203
72328
|
: ts.Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isolatedModules_is_enabled;
|
|
@@ -72255,7 +72380,7 @@ var ts;
|
|
|
72255
72380
|
if (node.kind === 270 &&
|
|
72256
72381
|
ts.idText(node.propertyName || node.name) === "default" &&
|
|
72257
72382
|
ts.getESModuleInterop(compilerOptions) &&
|
|
72258
|
-
moduleKind !== ts.ModuleKind.System && (moduleKind < ts.ModuleKind.ES2015 ||
|
|
72383
|
+
moduleKind !== ts.ModuleKind.System && (moduleKind < ts.ModuleKind.ES2015 || getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS)) {
|
|
72259
72384
|
checkExternalEmitHelpers(node, 131072);
|
|
72260
72385
|
}
|
|
72261
72386
|
}
|
|
@@ -72303,7 +72428,7 @@ var ts;
|
|
|
72303
72428
|
if (importClause.namedBindings) {
|
|
72304
72429
|
if (importClause.namedBindings.kind === 268) {
|
|
72305
72430
|
checkImportBinding(importClause.namedBindings);
|
|
72306
|
-
if (moduleKind !== ts.ModuleKind.System && (moduleKind < ts.ModuleKind.ES2015 ||
|
|
72431
|
+
if (moduleKind !== ts.ModuleKind.System && (moduleKind < ts.ModuleKind.ES2015 || getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS) && ts.getESModuleInterop(compilerOptions)) {
|
|
72307
72432
|
checkExternalEmitHelpers(node, 65536);
|
|
72308
72433
|
}
|
|
72309
72434
|
}
|
|
@@ -72346,7 +72471,7 @@ var ts;
|
|
|
72346
72471
|
}
|
|
72347
72472
|
}
|
|
72348
72473
|
else {
|
|
72349
|
-
if (moduleKind >= ts.ModuleKind.ES2015 &&
|
|
72474
|
+
if (moduleKind >= ts.ModuleKind.ES2015 && getSourceFileOfNode(node).impliedNodeFormat === undefined && !node.isTypeOnly && !(node.flags & 16777216)) {
|
|
72350
72475
|
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);
|
|
72351
72476
|
}
|
|
72352
72477
|
}
|
|
@@ -72381,7 +72506,7 @@ var ts;
|
|
|
72381
72506
|
else if (node.exportClause) {
|
|
72382
72507
|
checkAliasSymbol(node.exportClause);
|
|
72383
72508
|
}
|
|
72384
|
-
if (moduleKind !== ts.ModuleKind.System && (moduleKind < ts.ModuleKind.ES2015 ||
|
|
72509
|
+
if (moduleKind !== ts.ModuleKind.System && (moduleKind < ts.ModuleKind.ES2015 || getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS)) {
|
|
72385
72510
|
if (node.exportClause) {
|
|
72386
72511
|
if (ts.getESModuleInterop(compilerOptions)) {
|
|
72387
72512
|
checkExternalEmitHelpers(node, 65536);
|
|
@@ -72472,7 +72597,7 @@ var ts;
|
|
|
72472
72597
|
else {
|
|
72473
72598
|
if (ts.getESModuleInterop(compilerOptions) &&
|
|
72474
72599
|
moduleKind !== ts.ModuleKind.System &&
|
|
72475
|
-
(moduleKind < ts.ModuleKind.ES2015 ||
|
|
72600
|
+
(moduleKind < ts.ModuleKind.ES2015 || getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS) &&
|
|
72476
72601
|
ts.idText(node.propertyName || node.name) === "default") {
|
|
72477
72602
|
checkExternalEmitHelpers(node, 131072);
|
|
72478
72603
|
}
|
|
@@ -72527,7 +72652,7 @@ var ts;
|
|
|
72527
72652
|
grammarErrorOnNode(node.expression, ts.Diagnostics.The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context);
|
|
72528
72653
|
}
|
|
72529
72654
|
if (node.isExportEquals && !(node.flags & 16777216)) {
|
|
72530
|
-
if (moduleKind >= ts.ModuleKind.ES2015 &&
|
|
72655
|
+
if (moduleKind >= ts.ModuleKind.ES2015 && getSourceFileOfNode(node).impliedNodeFormat !== ts.ModuleKind.CommonJS) {
|
|
72531
72656
|
grammarErrorOnNode(node, ts.Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead);
|
|
72532
72657
|
}
|
|
72533
72658
|
else if (moduleKind === ts.ModuleKind.System) {
|
|
@@ -72848,7 +72973,7 @@ var ts;
|
|
|
72848
72973
|
return addOptionality(type);
|
|
72849
72974
|
}
|
|
72850
72975
|
function checkNodeDeferred(node) {
|
|
72851
|
-
var enclosingFile =
|
|
72976
|
+
var enclosingFile = getSourceFileOfNode(node);
|
|
72852
72977
|
var links = getNodeLinks(enclosingFile);
|
|
72853
72978
|
if (!(links.flags & 1)) {
|
|
72854
72979
|
links.deferredNodes || (links.deferredNodes = new ts.Set());
|
|
@@ -72908,15 +73033,15 @@ var ts;
|
|
|
72908
73033
|
ts.performance.measure("Check", "beforeCheck", "afterCheck");
|
|
72909
73034
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
72910
73035
|
}
|
|
72911
|
-
function unusedIsError(kind, isAmbient) {
|
|
73036
|
+
function unusedIsError(kind, isAmbient, file) {
|
|
72912
73037
|
if (isAmbient) {
|
|
72913
73038
|
return false;
|
|
72914
73039
|
}
|
|
72915
73040
|
switch (kind) {
|
|
72916
73041
|
case 0:
|
|
72917
|
-
return !!compilerOptions
|
|
73042
|
+
return !!ts.getFileLocalCompilerOption(file, compilerOptions, "noUnusedLocals");
|
|
72918
73043
|
case 1:
|
|
72919
|
-
return !!compilerOptions
|
|
73044
|
+
return !!ts.getFileLocalCompilerOption(file, compilerOptions, "noUnusedParameters");
|
|
72920
73045
|
default:
|
|
72921
73046
|
return ts.Debug.assertNever(kind);
|
|
72922
73047
|
}
|
|
@@ -72943,9 +73068,9 @@ var ts;
|
|
|
72943
73068
|
registerForUnusedIdentifiersCheck(node);
|
|
72944
73069
|
}
|
|
72945
73070
|
addLazyDiagnostic(function () {
|
|
72946
|
-
if (!node.isDeclarationFile && (compilerOptions
|
|
73071
|
+
if (!node.isDeclarationFile && (ts.getFileLocalCompilerOption(node, compilerOptions, "noUnusedLocals") || ts.getFileLocalCompilerOption(node, compilerOptions, "noUnusedParameters"))) {
|
|
72947
73072
|
checkUnusedIdentifiers(getPotentiallyUnusedIdentifiers(node), function (containingNode, kind, diag) {
|
|
72948
|
-
if (!ts.containsParseError(containingNode) && unusedIsError(kind, !!(containingNode.flags & 16777216))) {
|
|
73073
|
+
if (!ts.containsParseError(containingNode) && unusedIsError(kind, !!(containingNode.flags & 16777216), node)) {
|
|
72949
73074
|
diagnostics.add(diag);
|
|
72950
73075
|
}
|
|
72951
73076
|
});
|
|
@@ -73574,10 +73699,12 @@ var ts;
|
|
|
73574
73699
|
}
|
|
73575
73700
|
}
|
|
73576
73701
|
function getAugmentedPropertiesOfType(type) {
|
|
73702
|
+
var _a;
|
|
73577
73703
|
type = getApparentType(type);
|
|
73578
73704
|
var propsByName = ts.createSymbolTable(getPropertiesOfType(type));
|
|
73579
|
-
var
|
|
73580
|
-
|
|
73705
|
+
var file = ((_a = type.symbol) === null || _a === void 0 ? void 0 : _a.valueDeclaration) && getSourceFileOfNode(type.symbol.valueDeclaration);
|
|
73706
|
+
var functionType = getSignaturesOfType(type, 0).length ? globalCallableFunctionType(file) :
|
|
73707
|
+
getSignaturesOfType(type, 1).length ? globalNewableFunctionType(file) :
|
|
73581
73708
|
undefined;
|
|
73582
73709
|
if (functionType) {
|
|
73583
73710
|
ts.forEach(getPropertiesOfType(functionType), function (p) {
|
|
@@ -73668,7 +73795,7 @@ var ts;
|
|
|
73668
73795
|
if (parentSymbol_1) {
|
|
73669
73796
|
if (parentSymbol_1.flags & 512 && ((_a = parentSymbol_1.valueDeclaration) === null || _a === void 0 ? void 0 : _a.kind) === 305) {
|
|
73670
73797
|
var symbolFile = parentSymbol_1.valueDeclaration;
|
|
73671
|
-
var referenceFile =
|
|
73798
|
+
var referenceFile = getSourceFileOfNode(node);
|
|
73672
73799
|
var symbolIsUmdExport = symbolFile !== referenceFile;
|
|
73673
73800
|
return symbolIsUmdExport ? undefined : symbolFile;
|
|
73674
73801
|
}
|
|
@@ -74037,11 +74164,11 @@ var ts;
|
|
|
74037
74164
|
return literalTypeToNode(type, node, tracker);
|
|
74038
74165
|
}
|
|
74039
74166
|
function getJsxFactoryEntity(location) {
|
|
74040
|
-
return location ? (getJsxNamespace(location), (
|
|
74167
|
+
return location ? (getJsxNamespace(location), (getSourceFileOfNode(location).localJsxFactory || _jsxFactoryEntity)) : _jsxFactoryEntity;
|
|
74041
74168
|
}
|
|
74042
74169
|
function getJsxFragmentFactoryEntity(location) {
|
|
74043
74170
|
if (location) {
|
|
74044
|
-
var file =
|
|
74171
|
+
var file = getSourceFileOfNode(location);
|
|
74045
74172
|
if (file) {
|
|
74046
74173
|
if (file.localJsxFragmentFactory) {
|
|
74047
74174
|
return file.localJsxFragmentFactory;
|
|
@@ -74161,7 +74288,7 @@ var ts;
|
|
|
74161
74288
|
isImportRequiredByAugmentation: isImportRequiredByAugmentation,
|
|
74162
74289
|
};
|
|
74163
74290
|
function isImportRequiredByAugmentation(node) {
|
|
74164
|
-
var file =
|
|
74291
|
+
var file = getSourceFileOfNode(node);
|
|
74165
74292
|
if (!file.symbol)
|
|
74166
74293
|
return false;
|
|
74167
74294
|
var importTarget = getExternalModuleFileFromDeclaration(node);
|
|
@@ -74177,7 +74304,7 @@ var ts;
|
|
|
74177
74304
|
if (merged.declarations) {
|
|
74178
74305
|
for (var _b = 0, _c = merged.declarations; _b < _c.length; _b++) {
|
|
74179
74306
|
var d = _c[_b];
|
|
74180
|
-
var declFile =
|
|
74307
|
+
var declFile = getSourceFileOfNode(d);
|
|
74181
74308
|
if (declFile === importTarget) {
|
|
74182
74309
|
return true;
|
|
74183
74310
|
}
|
|
@@ -74215,7 +74342,7 @@ var ts;
|
|
|
74215
74342
|
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
|
|
74216
74343
|
var decl = _a[_i];
|
|
74217
74344
|
if (decl.symbol && decl.symbol.flags & meaning) {
|
|
74218
|
-
var file =
|
|
74345
|
+
var file = getSourceFileOfNode(decl);
|
|
74219
74346
|
var typeReferenceDirective = fileToDirective.get(file.path);
|
|
74220
74347
|
if (typeReferenceDirective) {
|
|
74221
74348
|
(typeReferenceDirectives || (typeReferenceDirectives = [])).push(typeReferenceDirective);
|
|
@@ -74246,7 +74373,7 @@ var ts;
|
|
|
74246
74373
|
}
|
|
74247
74374
|
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
|
|
74248
74375
|
var decl = _a[_i];
|
|
74249
|
-
var file =
|
|
74376
|
+
var file = getSourceFileOfNode(decl);
|
|
74250
74377
|
if (fileToDirective.has(file.path)) {
|
|
74251
74378
|
return true;
|
|
74252
74379
|
}
|
|
@@ -74334,8 +74461,8 @@ var ts;
|
|
|
74334
74461
|
globalArrayType = getGlobalType("Array", 1, true);
|
|
74335
74462
|
globalObjectType = getGlobalType("Object", 0, true);
|
|
74336
74463
|
globalFunctionType = getGlobalType("Function", 0, true);
|
|
74337
|
-
globalCallableFunctionType = strictBindCallApply && getGlobalType("CallableFunction", 0, true) || globalFunctionType;
|
|
74338
|
-
globalNewableFunctionType = strictBindCallApply && getGlobalType("NewableFunction", 0, true) || globalFunctionType;
|
|
74464
|
+
globalCallableFunctionType = function (file) { return strictBindCallApply(file) && getGlobalType("CallableFunction", 0, true) || globalFunctionType; };
|
|
74465
|
+
globalNewableFunctionType = function (file) { return strictBindCallApply(file) && getGlobalType("NewableFunction", 0, true) || globalFunctionType; };
|
|
74339
74466
|
globalStringType = getGlobalType("String", 0, true);
|
|
74340
74467
|
globalNumberType = getGlobalType("Number", 0, true);
|
|
74341
74468
|
globalBooleanType = getGlobalType("Boolean", 0, true);
|
|
@@ -74385,7 +74512,7 @@ var ts;
|
|
|
74385
74512
|
}
|
|
74386
74513
|
function checkExternalEmitHelpers(location, helpers) {
|
|
74387
74514
|
if ((requestedExternalEmitHelpers & helpers) !== helpers && compilerOptions.importHelpers) {
|
|
74388
|
-
var sourceFile =
|
|
74515
|
+
var sourceFile = getSourceFileOfNode(location);
|
|
74389
74516
|
if (ts.isEffectiveExternalModule(sourceFile, compilerOptions) && !(location.flags & 16777216)) {
|
|
74390
74517
|
var helpersModule = resolveHelpersModule(sourceFile, location);
|
|
74391
74518
|
if (helpersModule !== unknownSymbol) {
|
|
@@ -74883,7 +75010,7 @@ var ts;
|
|
|
74883
75010
|
return false;
|
|
74884
75011
|
}
|
|
74885
75012
|
function checkGrammarFunctionLikeDeclaration(node) {
|
|
74886
|
-
var file =
|
|
75013
|
+
var file = getSourceFileOfNode(node);
|
|
74887
75014
|
return checkGrammarDecoratorsAndModifiers(node) ||
|
|
74888
75015
|
checkGrammarTypeParameterList(node.typeParameters, file) ||
|
|
74889
75016
|
checkGrammarParameterList(node.parameters) ||
|
|
@@ -74891,7 +75018,7 @@ var ts;
|
|
|
74891
75018
|
(ts.isFunctionLikeDeclaration(node) && checkGrammarForUseStrictSimpleParameterList(node));
|
|
74892
75019
|
}
|
|
74893
75020
|
function checkGrammarClassLikeDeclaration(node) {
|
|
74894
|
-
var file =
|
|
75021
|
+
var file = getSourceFileOfNode(node);
|
|
74895
75022
|
return checkGrammarClassDeclarationHeritageClauses(node) ||
|
|
74896
75023
|
checkGrammarTypeParameterList(node.typeParameters, file);
|
|
74897
75024
|
}
|
|
@@ -74952,7 +75079,7 @@ var ts;
|
|
|
74952
75079
|
}
|
|
74953
75080
|
function checkGrammarForAtLeastOneTypeArgument(node, typeArguments) {
|
|
74954
75081
|
if (typeArguments && typeArguments.length === 0) {
|
|
74955
|
-
var sourceFile =
|
|
75082
|
+
var sourceFile = getSourceFileOfNode(node);
|
|
74956
75083
|
var start = typeArguments.pos - "<".length;
|
|
74957
75084
|
var end = ts.skipTrivia(sourceFile.text, typeArguments.end) + ">".length;
|
|
74958
75085
|
return grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Type_argument_list_cannot_be_empty);
|
|
@@ -75208,7 +75335,7 @@ var ts;
|
|
|
75208
75335
|
}
|
|
75209
75336
|
if (forInOrOfStatement.kind === 244 && forInOrOfStatement.awaitModifier) {
|
|
75210
75337
|
if (!(forInOrOfStatement.flags & 32768)) {
|
|
75211
|
-
var sourceFile =
|
|
75338
|
+
var sourceFile = getSourceFileOfNode(forInOrOfStatement);
|
|
75212
75339
|
if (ts.isInTopLevelContext(forInOrOfStatement)) {
|
|
75213
75340
|
if (!hasParseDiagnostics(sourceFile)) {
|
|
75214
75341
|
if (!ts.isEffectiveExternalModule(sourceFile, compilerOptions)) {
|
|
@@ -75543,7 +75670,7 @@ var ts;
|
|
|
75543
75670
|
: ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context;
|
|
75544
75671
|
return grammarErrorOnNode(node.exclamationToken, message);
|
|
75545
75672
|
}
|
|
75546
|
-
if ((moduleKind < ts.ModuleKind.ES2015 ||
|
|
75673
|
+
if ((moduleKind < ts.ModuleKind.ES2015 || getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS) && moduleKind !== ts.ModuleKind.System &&
|
|
75547
75674
|
!(node.parent.parent.flags & 16777216) && ts.hasSyntacticModifier(node.parent.parent, 1)) {
|
|
75548
75675
|
checkESModuleMarker(node.name);
|
|
75549
75676
|
}
|
|
@@ -75638,7 +75765,7 @@ var ts;
|
|
|
75638
75765
|
return sourceFile.parseDiagnostics.length > 0;
|
|
75639
75766
|
}
|
|
75640
75767
|
function grammarErrorOnFirstToken(node, message, arg0, arg1, arg2) {
|
|
75641
|
-
var sourceFile =
|
|
75768
|
+
var sourceFile = getSourceFileOfNode(node);
|
|
75642
75769
|
if (!hasParseDiagnostics(sourceFile)) {
|
|
75643
75770
|
var span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos);
|
|
75644
75771
|
diagnostics.add(ts.createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2));
|
|
@@ -75647,7 +75774,7 @@ var ts;
|
|
|
75647
75774
|
return false;
|
|
75648
75775
|
}
|
|
75649
75776
|
function grammarErrorAtPos(nodeForSourceFile, start, length, message, arg0, arg1, arg2) {
|
|
75650
|
-
var sourceFile =
|
|
75777
|
+
var sourceFile = getSourceFileOfNode(nodeForSourceFile);
|
|
75651
75778
|
if (!hasParseDiagnostics(sourceFile)) {
|
|
75652
75779
|
diagnostics.add(ts.createFileDiagnostic(sourceFile, start, length, message, arg0, arg1, arg2));
|
|
75653
75780
|
return true;
|
|
@@ -75655,7 +75782,7 @@ var ts;
|
|
|
75655
75782
|
return false;
|
|
75656
75783
|
}
|
|
75657
75784
|
function grammarErrorOnNodeSkippedOn(key, node, message, arg0, arg1, arg2) {
|
|
75658
|
-
var sourceFile =
|
|
75785
|
+
var sourceFile = getSourceFileOfNode(node);
|
|
75659
75786
|
if (!hasParseDiagnostics(sourceFile)) {
|
|
75660
75787
|
errorSkippedOn(key, node, message, arg0, arg1, arg2);
|
|
75661
75788
|
return true;
|
|
@@ -75663,7 +75790,7 @@ var ts;
|
|
|
75663
75790
|
return false;
|
|
75664
75791
|
}
|
|
75665
75792
|
function grammarErrorOnNode(node, message, arg0, arg1, arg2) {
|
|
75666
|
-
var sourceFile =
|
|
75793
|
+
var sourceFile = getSourceFileOfNode(node);
|
|
75667
75794
|
if (!hasParseDiagnostics(sourceFile)) {
|
|
75668
75795
|
diagnostics.add(ts.createDiagnosticForNode(node, message, arg0, arg1, arg2));
|
|
75669
75796
|
return true;
|
|
@@ -75674,7 +75801,7 @@ var ts;
|
|
|
75674
75801
|
var jsdocTypeParameters = ts.isInJSFile(node) ? ts.getJSDocTypeParameterDeclarations(node) : undefined;
|
|
75675
75802
|
var range = node.typeParameters || jsdocTypeParameters && ts.firstOrUndefined(jsdocTypeParameters);
|
|
75676
75803
|
if (range) {
|
|
75677
|
-
var pos = range.pos === range.end ? range.pos : ts.skipTrivia(
|
|
75804
|
+
var pos = range.pos === range.end ? range.pos : ts.skipTrivia(getSourceFileOfNode(node).text, range.pos);
|
|
75678
75805
|
return grammarErrorAtPos(node, pos, range.end - pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration);
|
|
75679
75806
|
}
|
|
75680
75807
|
}
|
|
@@ -75820,7 +75947,7 @@ var ts;
|
|
|
75820
75947
|
return false;
|
|
75821
75948
|
}
|
|
75822
75949
|
function grammarErrorAfterFirstToken(node, message, arg0, arg1, arg2) {
|
|
75823
|
-
var sourceFile =
|
|
75950
|
+
var sourceFile = getSourceFileOfNode(node);
|
|
75824
75951
|
if (!hasParseDiagnostics(sourceFile)) {
|
|
75825
75952
|
var span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos);
|
|
75826
75953
|
diagnostics.add(ts.createFileDiagnostic(sourceFile, ts.textSpanEnd(span), 0, message, arg0, arg1, arg2));
|
|
@@ -78349,7 +78476,7 @@ var ts;
|
|
|
78349
78476
|
}
|
|
78350
78477
|
}
|
|
78351
78478
|
function visitSourceFile(node) {
|
|
78352
|
-
var alwaysStrict = ts.getStrictOptionValue(compilerOptions, "alwaysStrict") &&
|
|
78479
|
+
var alwaysStrict = ts.getStrictOptionValue(node, compilerOptions, "alwaysStrict") &&
|
|
78353
78480
|
!(ts.isExternalModule(node) && moduleKind >= ts.ModuleKind.ES2015) &&
|
|
78354
78481
|
!ts.isJsonSourceFile(node);
|
|
78355
78482
|
return factory.updateSourceFile(node, ts.visitLexicalEnvironment(node.statements, sourceElementVisitor, context, 0, alwaysStrict));
|
|
@@ -80664,7 +80791,6 @@ var ts;
|
|
|
80664
80791
|
var resolver = context.getEmitResolver();
|
|
80665
80792
|
var compilerOptions = context.getCompilerOptions();
|
|
80666
80793
|
var languageVersion = ts.getEmitScriptTarget(compilerOptions);
|
|
80667
|
-
var strictNullChecks = ts.getStrictOptionValue(compilerOptions, "strictNullChecks");
|
|
80668
80794
|
var currentLexicalScope;
|
|
80669
80795
|
var currentNameScope;
|
|
80670
80796
|
return {
|
|
@@ -80865,7 +80991,7 @@ var ts;
|
|
|
80865
80991
|
if (typeNode.kind === 130) {
|
|
80866
80992
|
return ts.factory.createIdentifier("Object");
|
|
80867
80993
|
}
|
|
80868
|
-
if (!strictNullChecks && ((ts.isLiteralTypeNode(typeNode) && typeNode.literal.kind === 104) || typeNode.kind === 153)) {
|
|
80994
|
+
if (!ts.getStrictOptionValue(ts.getSourceFileOfNode(currentLexicalScope), compilerOptions, "strictNullChecks") && ((ts.isLiteralTypeNode(typeNode) && typeNode.literal.kind === 104) || typeNode.kind === 153)) {
|
|
80869
80995
|
continue;
|
|
80870
80996
|
}
|
|
80871
80997
|
var serializedConstituent = serializeTypeNode(typeNode);
|
|
@@ -87208,7 +87334,7 @@ var ts;
|
|
|
87208
87334
|
function transformCommonJSModule(node) {
|
|
87209
87335
|
startLexicalEnvironment();
|
|
87210
87336
|
var statements = [];
|
|
87211
|
-
var ensureUseStrict = ts.getStrictOptionValue(compilerOptions, "alwaysStrict") || (!compilerOptions.noImplicitUseStrict && ts.isExternalModule(currentSourceFile));
|
|
87337
|
+
var ensureUseStrict = ts.getStrictOptionValue(node, compilerOptions, "alwaysStrict") || (!compilerOptions.noImplicitUseStrict && ts.isExternalModule(currentSourceFile));
|
|
87212
87338
|
var statementOffset = factory.copyPrologue(node.statements, statements, ensureUseStrict && !ts.isJsonSourceFile(node), topLevelVisitor);
|
|
87213
87339
|
if (shouldEmitUnderscoreUnderscoreESModule()) {
|
|
87214
87340
|
ts.append(statements, createUnderscoreUnderscoreESModule());
|
|
@@ -88227,7 +88353,7 @@ var ts;
|
|
|
88227
88353
|
function createSystemModuleBody(node, dependencyGroups) {
|
|
88228
88354
|
var statements = [];
|
|
88229
88355
|
startLexicalEnvironment();
|
|
88230
|
-
var ensureUseStrict = ts.getStrictOptionValue(compilerOptions, "alwaysStrict") || (!compilerOptions.noImplicitUseStrict && ts.isExternalModule(currentSourceFile));
|
|
88356
|
+
var ensureUseStrict = ts.getStrictOptionValue(node, compilerOptions, "alwaysStrict") || (!compilerOptions.noImplicitUseStrict && ts.isExternalModule(currentSourceFile));
|
|
88231
88357
|
var statementOffset = factory.copyPrologue(node.statements, statements, ensureUseStrict, topLevelVisitor);
|
|
88232
88358
|
statements.push(factory.createVariableStatement(undefined, factory.createVariableDeclarationList([
|
|
88233
88359
|
factory.createVariableDeclaration("__moduleName", undefined, undefined, factory.createLogicalAnd(contextObject, factory.createPropertyAccessExpression(contextObject, "id")))
|
|
@@ -99104,7 +99230,7 @@ var ts;
|
|
|
99104
99230
|
}
|
|
99105
99231
|
var elideImport = isJsFileFromNodeModules && currentNodeModulesDepth > maxNodeModuleJsDepth;
|
|
99106
99232
|
var shouldAddFile = resolvedFileName
|
|
99107
|
-
&& !getResolutionDiagnostic(optionsForFile, resolution)
|
|
99233
|
+
&& !getResolutionDiagnostic(file, optionsForFile, resolution)
|
|
99108
99234
|
&& !optionsForFile.noResolve
|
|
99109
99235
|
&& index < file.imports.length
|
|
99110
99236
|
&& !elideImport
|
|
@@ -99185,10 +99311,10 @@ var ts;
|
|
|
99185
99311
|
return resolvedRef;
|
|
99186
99312
|
}
|
|
99187
99313
|
function verifyCompilerOptions() {
|
|
99188
|
-
if (options.strictPropertyInitialization && !ts.getStrictOptionValue(options, "strictNullChecks")) {
|
|
99314
|
+
if (options.strictPropertyInitialization && !ts.getStrictOptionValue(undefined, options, "strictNullChecks")) {
|
|
99189
99315
|
createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "strictPropertyInitialization", "strictNullChecks");
|
|
99190
99316
|
}
|
|
99191
|
-
if (options.exactOptionalPropertyTypes && !ts.getStrictOptionValue(options, "strictNullChecks")) {
|
|
99317
|
+
if (options.exactOptionalPropertyTypes && !ts.getStrictOptionValue(undefined, options, "strictNullChecks")) {
|
|
99192
99318
|
createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "exactOptionalPropertyTypes", "strictNullChecks");
|
|
99193
99319
|
}
|
|
99194
99320
|
if (options.isolatedModules) {
|
|
@@ -99296,7 +99422,7 @@ var ts;
|
|
|
99296
99422
|
if (options.lib && options.noLib) {
|
|
99297
99423
|
createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "lib", "noLib");
|
|
99298
99424
|
}
|
|
99299
|
-
if (options.noImplicitUseStrict && ts.getStrictOptionValue(options, "alwaysStrict")) {
|
|
99425
|
+
if (options.noImplicitUseStrict && ts.getStrictOptionValue(undefined, options, "alwaysStrict")) {
|
|
99300
99426
|
createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "noImplicitUseStrict", "alwaysStrict");
|
|
99301
99427
|
}
|
|
99302
99428
|
var languageVersion = ts.getEmitScriptTarget(options);
|
|
@@ -99933,7 +100059,7 @@ var ts;
|
|
|
99933
100059
|
return ts.resolveConfigFileProjectName(passedInRef.path);
|
|
99934
100060
|
}
|
|
99935
100061
|
ts.resolveProjectReferencePath = resolveProjectReferencePath;
|
|
99936
|
-
function getResolutionDiagnostic(options, _a) {
|
|
100062
|
+
function getResolutionDiagnostic(file, options, _a) {
|
|
99937
100063
|
var extension = _a.extension;
|
|
99938
100064
|
switch (extension) {
|
|
99939
100065
|
case ".ts":
|
|
@@ -99952,7 +100078,7 @@ var ts;
|
|
|
99952
100078
|
return options.jsx ? undefined : ts.Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set;
|
|
99953
100079
|
}
|
|
99954
100080
|
function needAllowJs() {
|
|
99955
|
-
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;
|
|
100081
|
+
return ts.getAllowJSCompilerOption(options) || !ts.getStrictOptionValue(file, options, "noImplicitAny") ? undefined : ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type;
|
|
99956
100082
|
}
|
|
99957
100083
|
function needResolveJsonModule() {
|
|
99958
100084
|
return options.resolveJsonModule ? undefined : ts.Diagnostics.Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used;
|
|
@@ -100591,10 +100717,10 @@ var ts;
|
|
|
100591
100717
|
if (!state.cleanedDiagnosticsOfLibFiles) {
|
|
100592
100718
|
state.cleanedDiagnosticsOfLibFiles = true;
|
|
100593
100719
|
var program_1 = ts.Debug.checkDefined(state.program);
|
|
100594
|
-
var
|
|
100720
|
+
var options_3 = program_1.getCompilerOptions();
|
|
100595
100721
|
ts.forEach(program_1.getSourceFiles(), function (f) {
|
|
100596
100722
|
return program_1.isSourceFileDefaultLibrary(f) &&
|
|
100597
|
-
!ts.skipTypeChecking(f,
|
|
100723
|
+
!ts.skipTypeChecking(f, options_3, program_1) &&
|
|
100598
100724
|
removeSemanticDiagnosticsOf(state, f.resolvedPath);
|
|
100599
100725
|
});
|
|
100600
100726
|
}
|