@typescript-deploys/pr-build 4.6.0-pr-47050-2 → 4.6.0-pr-47126-5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/lib.es2020.intl.d.ts +2 -1
- package/lib/lib.es2022.error.d.ts +50 -3
- package/lib/tsc.js +303 -187
- package/lib/tsserver.js +467 -259
- package/lib/tsserverlibrary.d.ts +6 -4
- package/lib/tsserverlibrary.js +438 -258
- package/lib/typescript.d.ts +5 -4
- package/lib/typescript.js +434 -257
- package/lib/typescriptServices.d.ts +5 -4
- package/lib/typescriptServices.js +434 -257
- package/lib/typingsInstaller.js +374 -219
- package/package.json +2 -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.6";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-insiders.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-insiders.20220107";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
function tryGetNativeMap() {
|
|
@@ -1855,6 +1855,14 @@ var ts;
|
|
|
1855
1855
|
}
|
|
1856
1856
|
return s.slice(0, end + 1);
|
|
1857
1857
|
}
|
|
1858
|
+
function startWhitespaceCount(s) {
|
|
1859
|
+
for (var i = 0; i < s.length; i++) {
|
|
1860
|
+
if (!ts.isWhiteSpaceLike(s.charCodeAt(i)))
|
|
1861
|
+
return i;
|
|
1862
|
+
}
|
|
1863
|
+
return s.length;
|
|
1864
|
+
}
|
|
1865
|
+
ts.startWhitespaceCount = startWhitespaceCount;
|
|
1858
1866
|
})(ts || (ts = {}));
|
|
1859
1867
|
var ts;
|
|
1860
1868
|
(function (ts) {
|
|
@@ -5806,12 +5814,12 @@ var ts;
|
|
|
5806
5814
|
Class_name_cannot_be_Object_when_targeting_ES5_with_module_0: diag(2725, ts.DiagnosticCategory.Error, "Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725", "Class name cannot be 'Object' when targeting ES5 with module {0}."),
|
|
5807
5815
|
Cannot_find_lib_definition_for_0: diag(2726, ts.DiagnosticCategory.Error, "Cannot_find_lib_definition_for_0_2726", "Cannot find lib definition for '{0}'."),
|
|
5808
5816
|
Cannot_find_lib_definition_for_0_Did_you_mean_1: diag(2727, ts.DiagnosticCategory.Error, "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727", "Cannot find lib definition for '{0}'. Did you mean '{1}'?"),
|
|
5809
|
-
|
|
5817
|
+
_0_is_declared_here_Colon: diag(2728, ts.DiagnosticCategory.Message, "_0_is_declared_here_Colon_2728", "'{0}' is declared here:"),
|
|
5810
5818
|
Property_0_is_used_before_its_initialization: diag(2729, ts.DiagnosticCategory.Error, "Property_0_is_used_before_its_initialization_2729", "Property '{0}' is used before its initialization."),
|
|
5811
5819
|
An_arrow_function_cannot_have_a_this_parameter: diag(2730, ts.DiagnosticCategory.Error, "An_arrow_function_cannot_have_a_this_parameter_2730", "An arrow function cannot have a 'this' parameter."),
|
|
5812
5820
|
Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String: diag(2731, ts.DiagnosticCategory.Error, "Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_i_2731", "Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'."),
|
|
5813
5821
|
Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension: diag(2732, ts.DiagnosticCategory.Error, "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732", "Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension."),
|
|
5814
|
-
|
|
5822
|
+
Property_0_was_also_declared_here_Colon: diag(2733, ts.DiagnosticCategory.Error, "Property_0_was_also_declared_here_Colon_2733", "Property '{0}' was also declared here:"),
|
|
5815
5823
|
Are_you_missing_a_semicolon: diag(2734, ts.DiagnosticCategory.Error, "Are_you_missing_a_semicolon_2734", "Are you missing a semicolon?"),
|
|
5816
5824
|
Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1: diag(2735, ts.DiagnosticCategory.Error, "Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1_2735", "Did you mean for '{0}' to be constrained to type 'new (...args: any[]) => {1}'?"),
|
|
5817
5825
|
Operator_0_cannot_be_applied_to_type_1: diag(2736, ts.DiagnosticCategory.Error, "Operator_0_cannot_be_applied_to_type_1_2736", "Operator '{0}' cannot be applied to type '{1}'."),
|
|
@@ -6242,7 +6250,7 @@ var ts;
|
|
|
6242
6250
|
Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0: diag(6200, ts.DiagnosticCategory.Error, "Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200", "Definitions of the following identifiers conflict with those in another file: {0}"),
|
|
6243
6251
|
Conflicts_are_in_this_file: diag(6201, ts.DiagnosticCategory.Message, "Conflicts_are_in_this_file_6201", "Conflicts are in this file."),
|
|
6244
6252
|
Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0: diag(6202, ts.DiagnosticCategory.Error, "Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202", "Project references may not form a circular graph. Cycle detected: {0}"),
|
|
6245
|
-
|
|
6253
|
+
_0_was_also_declared_here_Colon: diag(6203, ts.DiagnosticCategory.Message, "_0_was_also_declared_here_Colon_6203", "'{0}' was also declared here:"),
|
|
6246
6254
|
and_here: diag(6204, ts.DiagnosticCategory.Message, "and_here_6204", "and here."),
|
|
6247
6255
|
All_type_parameters_are_unused: diag(6205, ts.DiagnosticCategory.Error, "All_type_parameters_are_unused_6205", "All type parameters are unused."),
|
|
6248
6256
|
package_json_has_a_typesVersions_field_with_version_specific_path_mappings: diag(6206, ts.DiagnosticCategory.Message, "package_json_has_a_typesVersions_field_with_version_specific_path_mappings_6206", "'package.json' has a 'typesVersions' field with version-specific path mappings."),
|
|
@@ -11002,7 +11010,8 @@ var ts;
|
|
|
11002
11010
|
Float64Array: ["at"],
|
|
11003
11011
|
BigInt64Array: ["at"],
|
|
11004
11012
|
BigUint64Array: ["at"],
|
|
11005
|
-
ObjectConstructor: ["hasOwn"]
|
|
11013
|
+
ObjectConstructor: ["hasOwn"],
|
|
11014
|
+
Error: ["cause"]
|
|
11006
11015
|
}
|
|
11007
11016
|
};
|
|
11008
11017
|
}
|
|
@@ -15608,7 +15617,7 @@ var ts;
|
|
|
15608
15617
|
}
|
|
15609
15618
|
ts.getAllowJSCompilerOption = getAllowJSCompilerOption;
|
|
15610
15619
|
function getUseDefineForClassFields(compilerOptions) {
|
|
15611
|
-
return compilerOptions.useDefineForClassFields === undefined ? getEmitScriptTarget(compilerOptions)
|
|
15620
|
+
return compilerOptions.useDefineForClassFields === undefined ? getEmitScriptTarget(compilerOptions) >= 9 : compilerOptions.useDefineForClassFields;
|
|
15612
15621
|
}
|
|
15613
15622
|
ts.getUseDefineForClassFields = getUseDefineForClassFields;
|
|
15614
15623
|
function compilerOptionsAffectSemanticDiagnostics(newOptions, oldOptions) {
|
|
@@ -17785,7 +17794,7 @@ var ts;
|
|
|
17785
17794
|
result.push(createModifier(144));
|
|
17786
17795
|
if (flags & 256)
|
|
17787
17796
|
result.push(createModifier(131));
|
|
17788
|
-
return result;
|
|
17797
|
+
return result.length ? result : undefined;
|
|
17789
17798
|
}
|
|
17790
17799
|
function createQualifiedName(left, right) {
|
|
17791
17800
|
var node = createBaseNode(160);
|
|
@@ -19678,7 +19687,7 @@ var ts;
|
|
|
19678
19687
|
}
|
|
19679
19688
|
function createAssertClause(elements, multiLine) {
|
|
19680
19689
|
var node = createBaseNode(292);
|
|
19681
|
-
node.elements = elements;
|
|
19690
|
+
node.elements = createNodeArray(elements);
|
|
19682
19691
|
node.multiLine = multiLine;
|
|
19683
19692
|
node.transformFlags |= 4;
|
|
19684
19693
|
return node;
|
|
@@ -21036,32 +21045,36 @@ var ts;
|
|
|
21036
21045
|
}
|
|
21037
21046
|
function updateModifiers(node, modifiers) {
|
|
21038
21047
|
var _a;
|
|
21048
|
+
var modifierArray;
|
|
21039
21049
|
if (typeof modifiers === "number") {
|
|
21040
|
-
|
|
21041
|
-
}
|
|
21042
|
-
|
|
21043
|
-
|
|
21044
|
-
|
|
21045
|
-
|
|
21046
|
-
|
|
21047
|
-
|
|
21048
|
-
|
|
21049
|
-
|
|
21050
|
-
|
|
21051
|
-
|
|
21052
|
-
|
|
21053
|
-
|
|
21054
|
-
|
|
21055
|
-
|
|
21056
|
-
|
|
21057
|
-
|
|
21058
|
-
|
|
21059
|
-
|
|
21060
|
-
|
|
21061
|
-
|
|
21062
|
-
|
|
21063
|
-
|
|
21064
|
-
|
|
21050
|
+
modifierArray = createModifiersFromModifierFlags(modifiers);
|
|
21051
|
+
}
|
|
21052
|
+
else {
|
|
21053
|
+
modifierArray = modifiers;
|
|
21054
|
+
}
|
|
21055
|
+
return ts.isParameter(node) ? updateParameterDeclaration(node, node.decorators, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) :
|
|
21056
|
+
ts.isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) :
|
|
21057
|
+
ts.isPropertyDeclaration(node) ? updatePropertyDeclaration(node, node.decorators, modifierArray, node.name, (_a = node.questionToken) !== null && _a !== void 0 ? _a : node.exclamationToken, node.type, node.initializer) :
|
|
21058
|
+
ts.isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) :
|
|
21059
|
+
ts.isMethodDeclaration(node) ? updateMethodDeclaration(node, node.decorators, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) :
|
|
21060
|
+
ts.isConstructorDeclaration(node) ? updateConstructorDeclaration(node, node.decorators, modifierArray, node.parameters, node.body) :
|
|
21061
|
+
ts.isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, node.decorators, modifierArray, node.name, node.parameters, node.type, node.body) :
|
|
21062
|
+
ts.isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, node.decorators, modifierArray, node.name, node.parameters, node.body) :
|
|
21063
|
+
ts.isIndexSignatureDeclaration(node) ? updateIndexSignature(node, node.decorators, modifierArray, node.parameters, node.type) :
|
|
21064
|
+
ts.isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) :
|
|
21065
|
+
ts.isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) :
|
|
21066
|
+
ts.isClassExpression(node) ? updateClassExpression(node, node.decorators, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) :
|
|
21067
|
+
ts.isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) :
|
|
21068
|
+
ts.isFunctionDeclaration(node) ? updateFunctionDeclaration(node, node.decorators, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) :
|
|
21069
|
+
ts.isClassDeclaration(node) ? updateClassDeclaration(node, node.decorators, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) :
|
|
21070
|
+
ts.isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, node.decorators, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) :
|
|
21071
|
+
ts.isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, node.decorators, modifierArray, node.name, node.typeParameters, node.type) :
|
|
21072
|
+
ts.isEnumDeclaration(node) ? updateEnumDeclaration(node, node.decorators, modifierArray, node.name, node.members) :
|
|
21073
|
+
ts.isModuleDeclaration(node) ? updateModuleDeclaration(node, node.decorators, modifierArray, node.name, node.body) :
|
|
21074
|
+
ts.isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, node.decorators, modifierArray, node.isTypeOnly, node.name, node.moduleReference) :
|
|
21075
|
+
ts.isImportDeclaration(node) ? updateImportDeclaration(node, node.decorators, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) :
|
|
21076
|
+
ts.isExportAssignment(node) ? updateExportAssignment(node, node.decorators, modifierArray, node.expression) :
|
|
21077
|
+
ts.isExportDeclaration(node) ? updateExportDeclaration(node, node.decorators, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) :
|
|
21065
21078
|
ts.Debug.assertNever(node);
|
|
21066
21079
|
}
|
|
21067
21080
|
function asNodeArray(array) {
|
|
@@ -27016,7 +27029,7 @@ var ts;
|
|
|
27016
27029
|
return true;
|
|
27017
27030
|
}
|
|
27018
27031
|
}
|
|
27019
|
-
else if (third === 27) {
|
|
27032
|
+
else if (third === 27 || third === 63) {
|
|
27020
27033
|
return true;
|
|
27021
27034
|
}
|
|
27022
27035
|
return false;
|
|
@@ -39140,7 +39153,7 @@ var ts;
|
|
|
39140
39153
|
if (adjustedNode === errorNode)
|
|
39141
39154
|
return "continue";
|
|
39142
39155
|
err.relatedInformation = err.relatedInformation || [];
|
|
39143
|
-
var leadingMessage = ts.createDiagnosticForNode(adjustedNode, ts.Diagnostics.
|
|
39156
|
+
var leadingMessage = ts.createDiagnosticForNode(adjustedNode, ts.Diagnostics._0_was_also_declared_here_Colon, symbolName);
|
|
39144
39157
|
var followOnMessage = ts.createDiagnosticForNode(adjustedNode, ts.Diagnostics.and_here);
|
|
39145
39158
|
if (ts.length(err.relatedInformation) >= 5 || ts.some(err.relatedInformation, function (r) { return ts.compareDiagnostics(r, followOnMessage) === 0 || ts.compareDiagnostics(r, leadingMessage) === 0; }))
|
|
39146
39159
|
return "continue";
|
|
@@ -39734,7 +39747,7 @@ var ts;
|
|
|
39734
39747
|
var diagnostic = createError(errorLocation, message, diagnosticName(nameArg), suggestionName);
|
|
39735
39748
|
addErrorOrSuggestion(!isUncheckedJS, diagnostic);
|
|
39736
39749
|
if (suggestion.valueDeclaration) {
|
|
39737
|
-
ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics.
|
|
39750
|
+
ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here_Colon, suggestionName));
|
|
39738
39751
|
}
|
|
39739
39752
|
}
|
|
39740
39753
|
}
|
|
@@ -40031,7 +40044,7 @@ var ts;
|
|
|
40031
40044
|
}
|
|
40032
40045
|
}
|
|
40033
40046
|
if (diagnosticMessage) {
|
|
40034
|
-
ts.addRelatedInfo(diagnosticMessage, ts.createDiagnosticForNode(declaration, ts.Diagnostics.
|
|
40047
|
+
ts.addRelatedInfo(diagnosticMessage, ts.createDiagnosticForNode(declaration, ts.Diagnostics._0_is_declared_here_Colon, declarationName));
|
|
40035
40048
|
}
|
|
40036
40049
|
}
|
|
40037
40050
|
}
|
|
@@ -40303,7 +40316,7 @@ var ts;
|
|
|
40303
40316
|
var suggestionName = symbolToString(suggestion);
|
|
40304
40317
|
var diagnostic = error(name, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, moduleName, declarationName, suggestionName);
|
|
40305
40318
|
if (suggestion.valueDeclaration) {
|
|
40306
|
-
ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics.
|
|
40319
|
+
ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here_Colon, suggestionName));
|
|
40307
40320
|
}
|
|
40308
40321
|
}
|
|
40309
40322
|
else {
|
|
@@ -40335,7 +40348,7 @@ var ts;
|
|
|
40335
40348
|
error(name, ts.Diagnostics.Module_0_declares_1_locally_but_it_is_not_exported, moduleName, declarationName);
|
|
40336
40349
|
if (localSymbol.declarations) {
|
|
40337
40350
|
ts.addRelatedInfo.apply(void 0, __spreadArray([diagnostic], ts.map(localSymbol.declarations, function (decl, index) {
|
|
40338
|
-
return ts.createDiagnosticForNode(decl, index === 0 ? ts.Diagnostics.
|
|
40351
|
+
return ts.createDiagnosticForNode(decl, index === 0 ? ts.Diagnostics._0_is_declared_here_Colon : ts.Diagnostics.and_here, declarationName);
|
|
40339
40352
|
}), false));
|
|
40340
40353
|
}
|
|
40341
40354
|
}
|
|
@@ -44584,7 +44597,24 @@ var ts;
|
|
|
44584
44597
|
return mapType(source, function (t) { return getRestType(t, properties, symbol); });
|
|
44585
44598
|
}
|
|
44586
44599
|
var omitKeyType = getUnionType(ts.map(properties, getLiteralTypeFromPropertyName));
|
|
44600
|
+
var spreadableProperties = [];
|
|
44601
|
+
var unspreadableToRestKeys = [];
|
|
44602
|
+
for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) {
|
|
44603
|
+
var prop = _a[_i];
|
|
44604
|
+
var literalTypeFromProperty = getLiteralTypeFromProperty(prop, 8576);
|
|
44605
|
+
if (!isTypeAssignableTo(literalTypeFromProperty, omitKeyType)
|
|
44606
|
+
&& !(ts.getDeclarationModifierFlagsFromSymbol(prop) & (8 | 16))
|
|
44607
|
+
&& isSpreadableProperty(prop)) {
|
|
44608
|
+
spreadableProperties.push(prop);
|
|
44609
|
+
}
|
|
44610
|
+
else {
|
|
44611
|
+
unspreadableToRestKeys.push(literalTypeFromProperty);
|
|
44612
|
+
}
|
|
44613
|
+
}
|
|
44587
44614
|
if (isGenericObjectType(source) || isGenericIndexType(omitKeyType)) {
|
|
44615
|
+
if (unspreadableToRestKeys.length) {
|
|
44616
|
+
omitKeyType = getUnionType(__spreadArray([omitKeyType], unspreadableToRestKeys, true));
|
|
44617
|
+
}
|
|
44588
44618
|
if (omitKeyType.flags & 131072) {
|
|
44589
44619
|
return source;
|
|
44590
44620
|
}
|
|
@@ -44595,13 +44625,9 @@ var ts;
|
|
|
44595
44625
|
return getTypeAliasInstantiation(omitTypeAlias, [source, omitKeyType]);
|
|
44596
44626
|
}
|
|
44597
44627
|
var members = ts.createSymbolTable();
|
|
44598
|
-
for (var
|
|
44599
|
-
var prop =
|
|
44600
|
-
|
|
44601
|
-
&& !(ts.getDeclarationModifierFlagsFromSymbol(prop) & (8 | 16))
|
|
44602
|
-
&& isSpreadableProperty(prop)) {
|
|
44603
|
-
members.set(prop.escapedName, getSpreadSymbol(prop, false));
|
|
44604
|
-
}
|
|
44628
|
+
for (var _b = 0, spreadableProperties_1 = spreadableProperties; _b < spreadableProperties_1.length; _b++) {
|
|
44629
|
+
var prop = spreadableProperties_1[_b];
|
|
44630
|
+
members.set(prop.escapedName, getSpreadSymbol(prop, false));
|
|
44605
44631
|
}
|
|
44606
44632
|
var result = createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, getIndexInfosOfType(source));
|
|
44607
44633
|
result.objectFlags |= 8388608;
|
|
@@ -45093,8 +45119,8 @@ var ts;
|
|
|
45093
45119
|
if (s.valueDeclaration && exportedMember.valueDeclaration && ts.getSourceFileOfNode(s.valueDeclaration) !== ts.getSourceFileOfNode(exportedMember.valueDeclaration)) {
|
|
45094
45120
|
var unescapedName = ts.unescapeLeadingUnderscores(s.escapedName);
|
|
45095
45121
|
var exportedMemberName = ((_a = ts.tryCast(exportedMember.valueDeclaration, ts.isNamedDeclaration)) === null || _a === void 0 ? void 0 : _a.name) || exportedMember.valueDeclaration;
|
|
45096
|
-
ts.addRelatedInfo(error(s.valueDeclaration, ts.Diagnostics.Duplicate_identifier_0, unescapedName), ts.createDiagnosticForNode(exportedMemberName, ts.Diagnostics.
|
|
45097
|
-
ts.addRelatedInfo(error(exportedMemberName, ts.Diagnostics.Duplicate_identifier_0, unescapedName), ts.createDiagnosticForNode(s.valueDeclaration, ts.Diagnostics.
|
|
45122
|
+
ts.addRelatedInfo(error(s.valueDeclaration, ts.Diagnostics.Duplicate_identifier_0, unescapedName), ts.createDiagnosticForNode(exportedMemberName, ts.Diagnostics._0_was_also_declared_here_Colon, unescapedName));
|
|
45123
|
+
ts.addRelatedInfo(error(exportedMemberName, ts.Diagnostics.Duplicate_identifier_0, unescapedName), ts.createDiagnosticForNode(s.valueDeclaration, ts.Diagnostics._0_was_also_declared_here_Colon, unescapedName));
|
|
45098
45124
|
}
|
|
45099
45125
|
var union = createSymbol(s.flags | exportedMember.flags, name);
|
|
45100
45126
|
union.type = getUnionType([getTypeOfSymbol(s), getTypeOfSymbol(exportedMember)]);
|
|
@@ -45756,7 +45782,8 @@ var ts;
|
|
|
45756
45782
|
return false;
|
|
45757
45783
|
}
|
|
45758
45784
|
function getBaseTypeNodeOfClass(type) {
|
|
45759
|
-
|
|
45785
|
+
var decl = ts.getClassLikeDeclarationOfSymbol(type.symbol);
|
|
45786
|
+
return decl && ts.getEffectiveBaseTypeNode(decl);
|
|
45760
45787
|
}
|
|
45761
45788
|
function getConstructorsForTypeArguments(type, typeArgumentNodes, location) {
|
|
45762
45789
|
var typeArgCount = ts.length(typeArgumentNodes);
|
|
@@ -45770,8 +45797,8 @@ var ts;
|
|
|
45770
45797
|
}
|
|
45771
45798
|
function getBaseConstructorTypeOfClass(type) {
|
|
45772
45799
|
if (!type.resolvedBaseConstructorType) {
|
|
45773
|
-
var decl = type.symbol
|
|
45774
|
-
var extended = ts.getEffectiveBaseTypeNode(decl);
|
|
45800
|
+
var decl = ts.getClassLikeDeclarationOfSymbol(type.symbol);
|
|
45801
|
+
var extended = decl && ts.getEffectiveBaseTypeNode(decl);
|
|
45775
45802
|
var baseTypeNode = getBaseTypeNodeOfClass(type);
|
|
45776
45803
|
if (!baseTypeNode) {
|
|
45777
45804
|
return type.resolvedBaseConstructorType = undefinedType;
|
|
@@ -46343,7 +46370,7 @@ var ts;
|
|
|
46343
46370
|
if (lateSymbol.flags & getExcludedSymbolFlags(symbolFlags) || earlySymbol) {
|
|
46344
46371
|
var declarations = earlySymbol ? ts.concatenate(earlySymbol.declarations, lateSymbol.declarations) : lateSymbol.declarations;
|
|
46345
46372
|
var name_4 = !(type.flags & 8192) && ts.unescapeLeadingUnderscores(memberName) || ts.declarationNameToString(declName);
|
|
46346
|
-
ts.forEach(declarations, function (declaration) { return error(ts.getNameOfDeclaration(declaration) || declaration, ts.Diagnostics.
|
|
46373
|
+
ts.forEach(declarations, function (declaration) { return error(ts.getNameOfDeclaration(declaration) || declaration, ts.Diagnostics.Property_0_was_also_declared_here_Colon, name_4); });
|
|
46347
46374
|
error(declName || decl, ts.Diagnostics.Duplicate_property_0, name_4);
|
|
46348
46375
|
lateSymbol = createSymbol(0, memberName, 4096);
|
|
46349
46376
|
}
|
|
@@ -47441,7 +47468,7 @@ var ts;
|
|
|
47441
47468
|
}
|
|
47442
47469
|
if (t.flags & 268435456) {
|
|
47443
47470
|
var constraint = getBaseConstraint(t.type);
|
|
47444
|
-
return constraint
|
|
47471
|
+
return constraint ? getStringMappingType(t.symbol, constraint) : stringType;
|
|
47445
47472
|
}
|
|
47446
47473
|
if (t.flags & 8388608) {
|
|
47447
47474
|
var baseObjectType = getBaseConstraint(t.objectType);
|
|
@@ -47505,8 +47532,14 @@ var ts;
|
|
|
47505
47532
|
}
|
|
47506
47533
|
return type;
|
|
47507
47534
|
}
|
|
47535
|
+
function isMappedTypeGenericIndexedAccess(type) {
|
|
47536
|
+
return type.flags & 8388608 && ts.getObjectFlags(type.objectType) & 32 &&
|
|
47537
|
+
!isGenericMappedType(type.objectType) && isGenericIndexType(type.indexType);
|
|
47538
|
+
}
|
|
47508
47539
|
function getApparentType(type) {
|
|
47509
|
-
var t = type.flags & 465829888 ?
|
|
47540
|
+
var t = !(type.flags & 465829888) ? type :
|
|
47541
|
+
isMappedTypeGenericIndexedAccess(type) ? substituteIndexedMappedType(type.objectType, type.indexType) :
|
|
47542
|
+
getBaseConstraintOfType(type) || unknownType;
|
|
47510
47543
|
return ts.getObjectFlags(t) & 32 ? getApparentTypeOfMappedType(t) :
|
|
47511
47544
|
t.flags & 2097152 ? getApparentTypeOfIntersectionType(t) :
|
|
47512
47545
|
t.flags & 402653316 ? globalStringType :
|
|
@@ -48039,6 +48072,8 @@ var ts;
|
|
|
48039
48072
|
case 205:
|
|
48040
48073
|
case 206:
|
|
48041
48074
|
return traverse(node.expression);
|
|
48075
|
+
case 294:
|
|
48076
|
+
return traverse(node.initializer);
|
|
48042
48077
|
default:
|
|
48043
48078
|
return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && !!ts.forEachChild(node, traverse);
|
|
48044
48079
|
}
|
|
@@ -49990,11 +50025,9 @@ var ts;
|
|
|
49990
50025
|
}
|
|
49991
50026
|
function getStringMappingType(symbol, type) {
|
|
49992
50027
|
return type.flags & (1048576 | 131072) ? mapType(type, function (t) { return getStringMappingType(symbol, t); }) :
|
|
49993
|
-
type
|
|
49994
|
-
|
|
49995
|
-
type
|
|
49996
|
-
type.flags & 134217728 ? getTemplateLiteralType.apply(void 0, applyTemplateStringMapping(symbol, type.texts, type.types)) :
|
|
49997
|
-
type;
|
|
50028
|
+
isGenericIndexType(type) ? getStringMappingTypeForGenericType(symbol, type) :
|
|
50029
|
+
type.flags & 128 ? getStringLiteralType(applyStringMapping(symbol, type.value)) :
|
|
50030
|
+
type;
|
|
49998
50031
|
}
|
|
49999
50032
|
function applyStringMapping(symbol, str) {
|
|
50000
50033
|
switch (intrinsicTypeKinds.get(symbol.escapedName)) {
|
|
@@ -50005,15 +50038,6 @@ var ts;
|
|
|
50005
50038
|
}
|
|
50006
50039
|
return str;
|
|
50007
50040
|
}
|
|
50008
|
-
function applyTemplateStringMapping(symbol, texts, types) {
|
|
50009
|
-
switch (intrinsicTypeKinds.get(symbol.escapedName)) {
|
|
50010
|
-
case 0: return [texts.map(function (t) { return t.toUpperCase(); }), types.map(function (t) { return getStringMappingType(symbol, t); })];
|
|
50011
|
-
case 1: return [texts.map(function (t) { return t.toLowerCase(); }), types.map(function (t) { return getStringMappingType(symbol, t); })];
|
|
50012
|
-
case 2: return [texts[0] === "" ? texts : __spreadArray([texts[0].charAt(0).toUpperCase() + texts[0].slice(1)], texts.slice(1), true), texts[0] === "" ? __spreadArray([getStringMappingType(symbol, types[0])], types.slice(1), true) : types];
|
|
50013
|
-
case 3: return [texts[0] === "" ? texts : __spreadArray([texts[0].charAt(0).toLowerCase() + texts[0].slice(1)], texts.slice(1), true), texts[0] === "" ? __spreadArray([getStringMappingType(symbol, types[0])], types.slice(1), true) : types];
|
|
50014
|
-
}
|
|
50015
|
-
return [texts, types];
|
|
50016
|
-
}
|
|
50017
50041
|
function getStringMappingTypeForGenericType(symbol, type) {
|
|
50018
50042
|
var id = getSymbolId(symbol) + "," + getTypeId(type);
|
|
50019
50043
|
var result = stringMappingTypes.get(id);
|
|
@@ -50243,7 +50267,7 @@ var ts;
|
|
|
50243
50267
|
accessNode;
|
|
50244
50268
|
}
|
|
50245
50269
|
function isPatternLiteralPlaceholderType(type) {
|
|
50246
|
-
return !!(type.flags & (1 | 4 | 8 | 64))
|
|
50270
|
+
return !!(type.flags & (1 | 4 | 8 | 64));
|
|
50247
50271
|
}
|
|
50248
50272
|
function isPatternLiteralType(type) {
|
|
50249
50273
|
return !!(type.flags & 134217728) && ts.every(type.types, isPatternLiteralPlaceholderType);
|
|
@@ -53369,13 +53393,6 @@ var ts;
|
|
|
53369
53393
|
return -1;
|
|
53370
53394
|
}
|
|
53371
53395
|
}
|
|
53372
|
-
else if (target.flags & 268435456) {
|
|
53373
|
-
if (!(source.flags & 268435456)) {
|
|
53374
|
-
if (isUnchangedByStringMapping(target.symbol, source)) {
|
|
53375
|
-
return -1;
|
|
53376
|
-
}
|
|
53377
|
-
}
|
|
53378
|
-
}
|
|
53379
53396
|
if (source.flags & 8650752) {
|
|
53380
53397
|
if (!(source.flags & 8388608 && target.flags & 8388608)) {
|
|
53381
53398
|
var constraint = getConstraintOfType(source);
|
|
@@ -53411,10 +53428,7 @@ var ts;
|
|
|
53411
53428
|
}
|
|
53412
53429
|
}
|
|
53413
53430
|
else if (source.flags & 268435456) {
|
|
53414
|
-
if (target.flags & 268435456) {
|
|
53415
|
-
if (source.symbol !== target.symbol) {
|
|
53416
|
-
return 0;
|
|
53417
|
-
}
|
|
53431
|
+
if (target.flags & 268435456 && source.symbol === target.symbol) {
|
|
53418
53432
|
if (result = isRelatedTo(source.type, target.type, 3, reportErrors)) {
|
|
53419
53433
|
resetErrorInfo(saveErrorInfo);
|
|
53420
53434
|
return result;
|
|
@@ -53768,7 +53782,7 @@ var ts;
|
|
|
53768
53782
|
var propName = symbolToString(unmatchedProperty);
|
|
53769
53783
|
reportError.apply(void 0, __spreadArray([ts.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName], getTypeNamesForErrorDisplay(source, target), false));
|
|
53770
53784
|
if (ts.length(unmatchedProperty.declarations)) {
|
|
53771
|
-
associateRelatedInfo(ts.createDiagnosticForNode(unmatchedProperty.declarations[0], ts.Diagnostics.
|
|
53785
|
+
associateRelatedInfo(ts.createDiagnosticForNode(unmatchedProperty.declarations[0], ts.Diagnostics._0_is_declared_here_Colon, propName));
|
|
53772
53786
|
}
|
|
53773
53787
|
if (shouldSkipElaboration && errorInfo) {
|
|
53774
53788
|
overrideNextErrorInfo++;
|
|
@@ -54188,7 +54202,7 @@ var ts;
|
|
|
54188
54202
|
return typeCouldHaveTopLevelSingletonTypes(constraint);
|
|
54189
54203
|
}
|
|
54190
54204
|
}
|
|
54191
|
-
return isUnitType(type) || !!(type.flags & 134217728)
|
|
54205
|
+
return isUnitType(type) || !!(type.flags & 134217728);
|
|
54192
54206
|
}
|
|
54193
54207
|
function getExactOptionalUnassignableProperties(source, target) {
|
|
54194
54208
|
if (isTupleType(source) && isTupleType(target))
|
|
@@ -54784,7 +54798,7 @@ var ts;
|
|
|
54784
54798
|
return result;
|
|
54785
54799
|
}
|
|
54786
54800
|
function getFalsyFlags(type) {
|
|
54787
|
-
return type.flags &
|
|
54801
|
+
return type.flags & 1048576 ? getFalsyFlagsOfTypes(type.types) :
|
|
54788
54802
|
type.flags & 128 ? type.value === "" ? 128 : 0 :
|
|
54789
54803
|
type.flags & 256 ? type.value === 0 ? 256 : 0 :
|
|
54790
54804
|
type.flags & 2048 ? isZeroBigInt(type) ? 2048 : 0 :
|
|
@@ -55415,9 +55429,6 @@ var ts;
|
|
|
55415
55429
|
var flags = scanner.getTokenFlags();
|
|
55416
55430
|
return success && result === 9 && scanner.getTextPos() === (s.length + 1) && !(flags & 512);
|
|
55417
55431
|
}
|
|
55418
|
-
function isUnchangedByStringMapping(symbol, value) {
|
|
55419
|
-
return value === getStringMappingType(symbol, value);
|
|
55420
|
-
}
|
|
55421
55432
|
function isValidTypeForTemplateLiteralPlaceholder(source, target) {
|
|
55422
55433
|
if (source === target || target.flags & (1 | 4)) {
|
|
55423
55434
|
return true;
|
|
@@ -55426,8 +55437,7 @@ var ts;
|
|
|
55426
55437
|
var value = source.value;
|
|
55427
55438
|
return !!(target.flags & 8 && value !== "" && isFinite(+value) ||
|
|
55428
55439
|
target.flags & 64 && value !== "" && isValidBigIntString(value) ||
|
|
55429
|
-
target.flags & (512 | 98304) && value === target.intrinsicName
|
|
55430
|
-
target.flags & 268435456 && isUnchangedByStringMapping(target.symbol, getStringLiteralType(value)));
|
|
55440
|
+
target.flags & (512 | 98304) && value === target.intrinsicName);
|
|
55431
55441
|
}
|
|
55432
55442
|
if (source.flags & 134217728) {
|
|
55433
55443
|
var texts = source.texts;
|
|
@@ -55566,12 +55576,14 @@ var ts;
|
|
|
55566
55576
|
target = getActualTypeVariable(target);
|
|
55567
55577
|
}
|
|
55568
55578
|
if (target.flags & 8650752) {
|
|
55569
|
-
if (
|
|
55570
|
-
(priority & 128 && (source === autoType || source === autoArrayType)) || isFromInferenceBlockedSource(source)) {
|
|
55579
|
+
if (source === nonInferrableAnyType || source === silentNeverType || (priority & 128 && (source === autoType || source === autoArrayType)) || isFromInferenceBlockedSource(source)) {
|
|
55571
55580
|
return;
|
|
55572
55581
|
}
|
|
55573
55582
|
var inference = getInferenceInfoForType(target);
|
|
55574
55583
|
if (inference) {
|
|
55584
|
+
if (ts.getObjectFlags(source) & 524288) {
|
|
55585
|
+
return;
|
|
55586
|
+
}
|
|
55575
55587
|
if (!inference.isFixed) {
|
|
55576
55588
|
if (inference.priority === undefined || priority < inference.priority) {
|
|
55577
55589
|
inference.candidates = undefined;
|
|
@@ -55600,18 +55612,16 @@ var ts;
|
|
|
55600
55612
|
inferencePriority = Math.min(inferencePriority, priority);
|
|
55601
55613
|
return;
|
|
55602
55614
|
}
|
|
55603
|
-
|
|
55604
|
-
|
|
55605
|
-
|
|
55606
|
-
|
|
55607
|
-
|
|
55608
|
-
|
|
55609
|
-
|
|
55610
|
-
|
|
55611
|
-
|
|
55612
|
-
|
|
55613
|
-
invokeOnce(source, simplified_1, inferFromTypes);
|
|
55614
|
-
}
|
|
55615
|
+
var simplified = getSimplifiedType(target, false);
|
|
55616
|
+
if (simplified !== target) {
|
|
55617
|
+
inferFromTypes(source, simplified);
|
|
55618
|
+
}
|
|
55619
|
+
else if (target.flags & 8388608) {
|
|
55620
|
+
var indexType = getSimplifiedType(target.indexType, false);
|
|
55621
|
+
if (indexType.flags & 465829888) {
|
|
55622
|
+
var simplified_1 = distributeIndexOverObjectType(getSimplifiedType(target.objectType, false), indexType, false);
|
|
55623
|
+
if (simplified_1 && simplified_1 !== target) {
|
|
55624
|
+
inferFromTypes(source, simplified_1);
|
|
55615
55625
|
}
|
|
55616
55626
|
}
|
|
55617
55627
|
}
|
|
@@ -56272,7 +56282,8 @@ var ts;
|
|
|
56272
56282
|
return access.kind === 205 ? access.name.escapedText :
|
|
56273
56283
|
access.kind === 206 && ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) :
|
|
56274
56284
|
access.kind === 202 && (propertyName = getDestructuringPropertyName(access)) ? ts.escapeLeadingUnderscores(propertyName) :
|
|
56275
|
-
|
|
56285
|
+
access.kind === 163 ? ("" + access.parent.parameters.indexOf(access)) :
|
|
56286
|
+
undefined;
|
|
56276
56287
|
}
|
|
56277
56288
|
function containsMatchingReference(source, target) {
|
|
56278
56289
|
while (ts.isAccessExpression(source)) {
|
|
@@ -57473,11 +57484,11 @@ var ts;
|
|
|
57473
57484
|
return result;
|
|
57474
57485
|
}
|
|
57475
57486
|
function getCandidateDiscriminantPropertyAccess(expr) {
|
|
57476
|
-
if (ts.isBindingPattern(reference)) {
|
|
57487
|
+
if (ts.isBindingPattern(reference) || ts.isFunctionExpressionOrArrowFunction(reference)) {
|
|
57477
57488
|
if (ts.isIdentifier(expr)) {
|
|
57478
57489
|
var symbol = getResolvedSymbol(expr);
|
|
57479
57490
|
var declaration = symbol.valueDeclaration;
|
|
57480
|
-
if (declaration && ts.isBindingElement(declaration) &&
|
|
57491
|
+
if (declaration && (ts.isBindingElement(declaration) || ts.isParameter(declaration)) && reference === declaration.parent && !declaration.initializer && !declaration.dotDotDotToken) {
|
|
57481
57492
|
return declaration;
|
|
57482
57493
|
}
|
|
57483
57494
|
}
|
|
@@ -58128,7 +58139,7 @@ var ts;
|
|
|
58128
58139
|
var substituteConstraints = !(checkMode && checkMode & 2) &&
|
|
58129
58140
|
someType(type, isGenericTypeWithUnionConstraint) &&
|
|
58130
58141
|
(isConstraintPosition(type, reference) || hasNonBindingPatternContextualTypeWithNoGenericTypes(reference));
|
|
58131
|
-
return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 ? getBaseConstraintOrType(t) : t; }) : type;
|
|
58142
|
+
return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 && !isMappedTypeGenericIndexedAccess(t) ? getBaseConstraintOrType(t) : t; }) : type;
|
|
58132
58143
|
}
|
|
58133
58144
|
function isExportOrExportExpression(location) {
|
|
58134
58145
|
return !!ts.findAncestor(location, function (n) {
|
|
@@ -58162,18 +58173,34 @@ var ts;
|
|
|
58162
58173
|
}
|
|
58163
58174
|
function getNarrowedTypeOfSymbol(symbol, location) {
|
|
58164
58175
|
var declaration = symbol.valueDeclaration;
|
|
58165
|
-
if (declaration
|
|
58166
|
-
|
|
58167
|
-
|
|
58168
|
-
|
|
58169
|
-
|
|
58170
|
-
links.flags
|
|
58171
|
-
|
|
58172
|
-
|
|
58173
|
-
|
|
58174
|
-
|
|
58175
|
-
|
|
58176
|
-
|
|
58176
|
+
if (declaration) {
|
|
58177
|
+
if (ts.isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) {
|
|
58178
|
+
var parent = declaration.parent.parent;
|
|
58179
|
+
if (parent.kind === 253 && ts.getCombinedNodeFlags(declaration) & 2 || parent.kind === 163) {
|
|
58180
|
+
var links = getNodeLinks(location);
|
|
58181
|
+
if (!(links.flags & 268435456)) {
|
|
58182
|
+
links.flags |= 268435456;
|
|
58183
|
+
var parentType = getTypeForBindingElementParent(parent);
|
|
58184
|
+
links.flags &= ~268435456;
|
|
58185
|
+
if (parentType && parentType.flags & 1048576 && !(parent.kind === 163 && isSymbolAssigned(symbol))) {
|
|
58186
|
+
var pattern = declaration.parent;
|
|
58187
|
+
var narrowedType = getFlowTypeOfReference(pattern, parentType, parentType, undefined, location.flowNode);
|
|
58188
|
+
return getBindingElementTypeFromParentType(declaration, narrowedType);
|
|
58189
|
+
}
|
|
58190
|
+
}
|
|
58191
|
+
}
|
|
58192
|
+
}
|
|
58193
|
+
if (ts.isParameter(declaration) && !declaration.type && !declaration.initializer && !declaration.dotDotDotToken) {
|
|
58194
|
+
var func = declaration.parent;
|
|
58195
|
+
if (func.parameters.length >= 2 && isContextSensitiveFunctionOrObjectLiteralMethod(func)) {
|
|
58196
|
+
var contextualSignature = getContextualSignature(func);
|
|
58197
|
+
if (contextualSignature && contextualSignature.parameters.length === 1 && signatureHasRestParameter(contextualSignature)) {
|
|
58198
|
+
var restType = getTypeOfSymbol(contextualSignature.parameters[0]);
|
|
58199
|
+
if (restType.flags & 1048576 && everyType(restType, isTupleType) && !isSymbolAssigned(symbol)) {
|
|
58200
|
+
var narrowedType = getFlowTypeOfReference(func, restType, restType, undefined, location.flowNode);
|
|
58201
|
+
var index = func.parameters.indexOf(declaration) - (ts.getThisParameter(func) ? 1 : 0);
|
|
58202
|
+
return getIndexedAccessType(narrowedType, getNumberLiteralType(index));
|
|
58203
|
+
}
|
|
58177
58204
|
}
|
|
58178
58205
|
}
|
|
58179
58206
|
}
|
|
@@ -60575,11 +60602,14 @@ var ts;
|
|
|
60575
60602
|
if (!ts.getContainingClass(privId)) {
|
|
60576
60603
|
return grammarErrorOnNode(privId, ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
|
|
60577
60604
|
}
|
|
60578
|
-
if (!ts.
|
|
60579
|
-
|
|
60580
|
-
|
|
60581
|
-
|
|
60582
|
-
|
|
60605
|
+
if (!ts.isForInStatement(privId.parent)) {
|
|
60606
|
+
if (!ts.isExpressionNode(privId)) {
|
|
60607
|
+
return grammarErrorOnNode(privId, ts.Diagnostics.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression);
|
|
60608
|
+
}
|
|
60609
|
+
var isInOperation = ts.isBinaryExpression(privId.parent) && privId.parent.operatorToken.kind === 101;
|
|
60610
|
+
if (!getSymbolForPrivateIdentifierExpression(privId) && !isInOperation) {
|
|
60611
|
+
return grammarErrorOnNode(privId, ts.Diagnostics.Cannot_find_name_0, ts.idText(privId));
|
|
60612
|
+
}
|
|
60583
60613
|
}
|
|
60584
60614
|
return false;
|
|
60585
60615
|
}
|
|
@@ -60829,7 +60859,7 @@ var ts;
|
|
|
60829
60859
|
diagnosticMessage = error(right, ts.Diagnostics.Class_0_used_before_its_declaration, declarationName);
|
|
60830
60860
|
}
|
|
60831
60861
|
if (diagnosticMessage) {
|
|
60832
|
-
ts.addRelatedInfo(diagnosticMessage, ts.createDiagnosticForNode(valueDeclaration, ts.Diagnostics.
|
|
60862
|
+
ts.addRelatedInfo(diagnosticMessage, ts.createDiagnosticForNode(valueDeclaration, ts.Diagnostics._0_is_declared_here_Colon, declarationName));
|
|
60833
60863
|
}
|
|
60834
60864
|
}
|
|
60835
60865
|
function isInPropertyInitializerOrClassStaticBlock(node) {
|
|
@@ -60919,7 +60949,7 @@ var ts;
|
|
|
60919
60949
|
var suggestedName = ts.symbolName(suggestion);
|
|
60920
60950
|
var message = isUncheckedJS ? ts.Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2 : ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2;
|
|
60921
60951
|
errorInfo = ts.chainDiagnosticMessages(errorInfo, message, missingProperty, container, suggestedName);
|
|
60922
|
-
relatedInfo = suggestion.valueDeclaration && ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics.
|
|
60952
|
+
relatedInfo = suggestion.valueDeclaration && ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here_Colon, suggestedName);
|
|
60923
60953
|
}
|
|
60924
60954
|
else {
|
|
60925
60955
|
var diagnostic = containerSeemsToBeEmptyDomElement(containingType)
|
|
@@ -61577,7 +61607,7 @@ var ts;
|
|
|
61577
61607
|
var diag = ts.createDiagnosticForNode(node.tagName, ts.Diagnostics.Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3, ts.entityNameToString(node.tagName), absoluteMinArgCount, ts.entityNameToString(factory), maxParamCount);
|
|
61578
61608
|
var tagNameDeclaration = (_a = getSymbolAtLocation(node.tagName)) === null || _a === void 0 ? void 0 : _a.valueDeclaration;
|
|
61579
61609
|
if (tagNameDeclaration) {
|
|
61580
|
-
ts.addRelatedInfo(diag, ts.createDiagnosticForNode(tagNameDeclaration, ts.Diagnostics.
|
|
61610
|
+
ts.addRelatedInfo(diag, ts.createDiagnosticForNode(tagNameDeclaration, ts.Diagnostics._0_is_declared_here_Colon, ts.entityNameToString(node.tagName)));
|
|
61581
61611
|
}
|
|
61582
61612
|
if (errorOutputContainer && errorOutputContainer.skipLogging) {
|
|
61583
61613
|
(errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag);
|
|
@@ -62158,7 +62188,7 @@ var ts;
|
|
|
62158
62188
|
typeArguments.pop();
|
|
62159
62189
|
}
|
|
62160
62190
|
while (typeArguments.length < typeParameters.length) {
|
|
62161
|
-
typeArguments.push(getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
|
|
62191
|
+
typeArguments.push(getDefaultFromTypeParameter(typeParameters[typeArguments.length]) || getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
|
|
62162
62192
|
}
|
|
62163
62193
|
return typeArguments;
|
|
62164
62194
|
}
|
|
@@ -62704,8 +62734,7 @@ var ts;
|
|
|
62704
62734
|
}
|
|
62705
62735
|
function checkCallExpression(node, checkMode) {
|
|
62706
62736
|
var _a;
|
|
62707
|
-
|
|
62708
|
-
checkGrammarArguments(node.arguments);
|
|
62737
|
+
checkGrammarTypeArguments(node, node.typeArguments);
|
|
62709
62738
|
var signature = getResolvedSignature(node, undefined, checkMode);
|
|
62710
62739
|
if (signature === resolvingSignature) {
|
|
62711
62740
|
return nonInferrableType;
|
|
@@ -62802,8 +62831,7 @@ var ts;
|
|
|
62802
62831
|
return globalESSymbol === resolveName(left, "Symbol", 111551, undefined, undefined, false);
|
|
62803
62832
|
}
|
|
62804
62833
|
function checkImportCallExpression(node) {
|
|
62805
|
-
|
|
62806
|
-
checkGrammarImportCallExpression(node);
|
|
62834
|
+
checkGrammarImportCallExpression(node);
|
|
62807
62835
|
if (node.arguments.length === 0) {
|
|
62808
62836
|
return createPromiseReturnType(node, anyType);
|
|
62809
62837
|
}
|
|
@@ -67387,7 +67415,7 @@ var ts;
|
|
|
67387
67415
|
var declName = ts.declarationNameToString(nextDeclarationName);
|
|
67388
67416
|
var err = error(nextDeclarationName, message, declName, typeToString(firstType), typeToString(nextType));
|
|
67389
67417
|
if (firstDeclaration) {
|
|
67390
|
-
ts.addRelatedInfo(err, ts.createDiagnosticForNode(firstDeclaration, ts.Diagnostics.
|
|
67418
|
+
ts.addRelatedInfo(err, ts.createDiagnosticForNode(firstDeclaration, ts.Diagnostics._0_was_also_declared_here_Colon, declName));
|
|
67391
67419
|
}
|
|
67392
67420
|
}
|
|
67393
67421
|
function areDeclarationFlagsIdentical(left, right) {
|
|
@@ -68853,7 +68881,7 @@ var ts;
|
|
|
68853
68881
|
for (var _a = 0, properties_4 = properties_5; _a < properties_4.length; _a++) {
|
|
68854
68882
|
var prop = properties_4[_a];
|
|
68855
68883
|
var existing = seen.get(prop.escapedName);
|
|
68856
|
-
if (existing &&
|
|
68884
|
+
if (existing && prop.parent === existing.parent) {
|
|
68857
68885
|
seen.delete(prop.escapedName);
|
|
68858
68886
|
}
|
|
68859
68887
|
}
|
|
@@ -69138,7 +69166,7 @@ var ts;
|
|
|
69138
69166
|
if (memberSymbol) {
|
|
69139
69167
|
var declaration = memberSymbol.valueDeclaration;
|
|
69140
69168
|
if (declaration !== member) {
|
|
69141
|
-
if (declaration && isBlockScopedNameDeclaredBeforeUse(declaration, member)) {
|
|
69169
|
+
if (declaration && isBlockScopedNameDeclaredBeforeUse(declaration, member) && ts.isEnumDeclaration(declaration.parent)) {
|
|
69142
69170
|
return getEnumMemberValue(declaration);
|
|
69143
69171
|
}
|
|
69144
69172
|
error(expr, ts.Diagnostics.A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums);
|
|
@@ -72086,20 +72114,6 @@ var ts;
|
|
|
72086
72114
|
}
|
|
72087
72115
|
return false;
|
|
72088
72116
|
}
|
|
72089
|
-
function checkGrammarForOmittedArgument(args) {
|
|
72090
|
-
if (args) {
|
|
72091
|
-
for (var _i = 0, args_4 = args; _i < args_4.length; _i++) {
|
|
72092
|
-
var arg = args_4[_i];
|
|
72093
|
-
if (arg.kind === 226) {
|
|
72094
|
-
return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected);
|
|
72095
|
-
}
|
|
72096
|
-
}
|
|
72097
|
-
}
|
|
72098
|
-
return false;
|
|
72099
|
-
}
|
|
72100
|
-
function checkGrammarArguments(args) {
|
|
72101
|
-
return checkGrammarForOmittedArgument(args);
|
|
72102
|
-
}
|
|
72103
72117
|
function checkGrammarHeritageClause(node) {
|
|
72104
72118
|
var types = node.types;
|
|
72105
72119
|
if (checkGrammarForDisallowedTrailingComma(types)) {
|
|
@@ -72210,7 +72224,7 @@ var ts;
|
|
|
72210
72224
|
checkGrammarComputedPropertyName(name);
|
|
72211
72225
|
}
|
|
72212
72226
|
if (prop.kind === 295 && !inDestructuring && prop.objectAssignmentInitializer) {
|
|
72213
|
-
|
|
72227
|
+
grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern);
|
|
72214
72228
|
}
|
|
72215
72229
|
if (name.kind === 80) {
|
|
72216
72230
|
grammarErrorOnNode(name, ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
|
|
@@ -76714,7 +76728,7 @@ var ts;
|
|
|
76714
76728
|
var compilerOptions = context.getCompilerOptions();
|
|
76715
76729
|
var languageVersion = ts.getEmitScriptTarget(compilerOptions);
|
|
76716
76730
|
var useDefineForClassFields = ts.getUseDefineForClassFields(compilerOptions);
|
|
76717
|
-
var shouldTransformPrivateElementsOrClassStaticBlocks = languageVersion <
|
|
76731
|
+
var shouldTransformPrivateElementsOrClassStaticBlocks = languageVersion < 9;
|
|
76718
76732
|
var shouldTransformSuperInStaticInitializers = (languageVersion <= 8 || !useDefineForClassFields) && languageVersion >= 2;
|
|
76719
76733
|
var shouldTransformThisInStaticInitializers = languageVersion <= 8 || !useDefineForClassFields;
|
|
76720
76734
|
var previousOnSubstituteNode = context.onSubstituteNode;
|
|
@@ -76734,7 +76748,7 @@ var ts;
|
|
|
76734
76748
|
function transformSourceFile(node) {
|
|
76735
76749
|
var options = context.getCompilerOptions();
|
|
76736
76750
|
if (node.isDeclarationFile
|
|
76737
|
-
|| useDefineForClassFields && ts.getEmitScriptTarget(options)
|
|
76751
|
+
|| useDefineForClassFields && ts.getEmitScriptTarget(options) >= 9) {
|
|
76738
76752
|
return node;
|
|
76739
76753
|
}
|
|
76740
76754
|
var visited = ts.visitEachChild(node, visitor, context);
|
|
@@ -77404,7 +77418,7 @@ var ts;
|
|
|
77404
77418
|
return false;
|
|
77405
77419
|
}
|
|
77406
77420
|
if (useDefineForClassFields) {
|
|
77407
|
-
return languageVersion <
|
|
77421
|
+
return languageVersion < 9;
|
|
77408
77422
|
}
|
|
77409
77423
|
return ts.isInitializedProperty(member) || shouldTransformPrivateElementsOrClassStaticBlocks && ts.isPrivateIdentifierClassElementDeclaration(member);
|
|
77410
77424
|
}
|
|
@@ -84670,7 +84684,7 @@ var ts;
|
|
|
84670
84684
|
if (ts.isIdentifier(node.expression)) {
|
|
84671
84685
|
var expression = substituteExpressionIdentifier(node.expression);
|
|
84672
84686
|
noSubstitution[ts.getNodeId(expression)] = true;
|
|
84673
|
-
if (!ts.isIdentifier(expression)) {
|
|
84687
|
+
if (!ts.isIdentifier(expression) && !(ts.getEmitFlags(node.expression) & 4096)) {
|
|
84674
84688
|
return ts.addEmitFlags(factory.updateCallExpression(node, expression, undefined, node.arguments), 536870912);
|
|
84675
84689
|
}
|
|
84676
84690
|
}
|
|
@@ -84680,7 +84694,7 @@ var ts;
|
|
|
84680
84694
|
if (ts.isIdentifier(node.tag)) {
|
|
84681
84695
|
var tag = substituteExpressionIdentifier(node.tag);
|
|
84682
84696
|
noSubstitution[ts.getNodeId(tag)] = true;
|
|
84683
|
-
if (!ts.isIdentifier(tag)) {
|
|
84697
|
+
if (!ts.isIdentifier(tag) && !(ts.getEmitFlags(node.tag) & 4096)) {
|
|
84684
84698
|
return ts.addEmitFlags(factory.updateTaggedTemplateExpression(node, tag, undefined, node.template), 536870912);
|
|
84685
84699
|
}
|
|
84686
84700
|
}
|
|
@@ -89544,7 +89558,7 @@ var ts;
|
|
|
89544
89558
|
emitPlaceholder(hint, node, snippet);
|
|
89545
89559
|
break;
|
|
89546
89560
|
case 0:
|
|
89547
|
-
emitTabStop(snippet);
|
|
89561
|
+
emitTabStop(hint, node, snippet);
|
|
89548
89562
|
break;
|
|
89549
89563
|
}
|
|
89550
89564
|
}
|
|
@@ -89553,7 +89567,9 @@ var ts;
|
|
|
89553
89567
|
pipelineEmitWithHintWorker(hint, node, false);
|
|
89554
89568
|
nonEscapingWrite("}");
|
|
89555
89569
|
}
|
|
89556
|
-
function emitTabStop(snippet) {
|
|
89570
|
+
function emitTabStop(hint, node, snippet) {
|
|
89571
|
+
ts.Debug.assert(node.kind === 235, "A tab stop cannot be attached to a node of kind " + ts.Debug.formatSyntaxKind(node.kind) + ".");
|
|
89572
|
+
ts.Debug.assert(hint !== 5, "A tab stop cannot be attached to an embedded statement.");
|
|
89557
89573
|
nonEscapingWrite("$" + snippet.order);
|
|
89558
89574
|
}
|
|
89559
89575
|
function emitIdentifier(node) {
|
|
@@ -93424,8 +93440,8 @@ var ts;
|
|
|
93424
93440
|
var gutterSeparator = " ";
|
|
93425
93441
|
var resetEscapeSequence = "\u001b[0m";
|
|
93426
93442
|
var ellipsis = "...";
|
|
93443
|
+
var bullet = "● ";
|
|
93427
93444
|
var halfIndent = " ";
|
|
93428
|
-
var indent = " ";
|
|
93429
93445
|
function getCategoryFormat(category) {
|
|
93430
93446
|
switch (category) {
|
|
93431
93447
|
case ts.DiagnosticCategory.Error: return ForegroundColorEscapeSequences.Red;
|
|
@@ -93438,14 +93454,21 @@ var ts;
|
|
|
93438
93454
|
return formatStyle + text + resetEscapeSequence;
|
|
93439
93455
|
}
|
|
93440
93456
|
ts.formatColorAndReset = formatColorAndReset;
|
|
93441
|
-
function formatCodeSpan(file, start, length, indent,
|
|
93457
|
+
function formatCodeSpan(file, start, length, indent, underlineColor, host) {
|
|
93442
93458
|
var _a = ts.getLineAndCharacterOfPosition(file, start), firstLine = _a.line, firstLineChar = _a.character;
|
|
93443
93459
|
var _b = ts.getLineAndCharacterOfPosition(file, start + length), lastLine = _b.line, lastLineChar = _b.character;
|
|
93444
93460
|
var lastLineInFile = ts.getLineAndCharacterOfPosition(file, file.text.length).line;
|
|
93461
|
+
var gutterWidth = 1;
|
|
93445
93462
|
var hasMoreThanFiveLines = (lastLine - firstLine) >= 4;
|
|
93446
|
-
var
|
|
93447
|
-
|
|
93448
|
-
|
|
93463
|
+
var whitespaceToTrim = Number.MAX_VALUE;
|
|
93464
|
+
for (var i = firstLine; i <= lastLine; i++) {
|
|
93465
|
+
if (hasMoreThanFiveLines && firstLine + 1 < i && i < lastLine - 1) {
|
|
93466
|
+
i = lastLine - 1;
|
|
93467
|
+
}
|
|
93468
|
+
var lineStart = ts.getPositionOfLineAndCharacter(file, i, 0);
|
|
93469
|
+
var lineEnd = i < lastLineInFile ? ts.getPositionOfLineAndCharacter(file, i + 1, 0) : file.text.length;
|
|
93470
|
+
var lineContent = file.text.slice(lineStart, lineEnd);
|
|
93471
|
+
whitespaceToTrim = Math.min(whitespaceToTrim, ts.startWhitespaceCount(lineContent));
|
|
93449
93472
|
}
|
|
93450
93473
|
var context = "";
|
|
93451
93474
|
for (var i = firstLine; i <= lastLine; i++) {
|
|
@@ -93458,21 +93481,25 @@ var ts;
|
|
|
93458
93481
|
var lineEnd = i < lastLineInFile ? ts.getPositionOfLineAndCharacter(file, i + 1, 0) : file.text.length;
|
|
93459
93482
|
var lineContent = file.text.slice(lineStart, lineEnd);
|
|
93460
93483
|
lineContent = ts.trimStringEnd(lineContent);
|
|
93484
|
+
lineContent = lineContent.slice(whitespaceToTrim);
|
|
93461
93485
|
lineContent = lineContent.replace(/\t/g, " ");
|
|
93462
|
-
|
|
93486
|
+
var gutterLine = "|";
|
|
93487
|
+
console.log({ gutterWidth: gutterWidth, indent: indent, lastLine: lastLine });
|
|
93488
|
+
context += indent + ts.padLeft(gutterLine, gutterWidth) + gutterSeparator;
|
|
93463
93489
|
context += lineContent + host.getNewLine();
|
|
93464
|
-
context += indent +
|
|
93465
|
-
context +=
|
|
93490
|
+
context += indent + ts.padLeft("", gutterWidth) + gutterSeparator;
|
|
93491
|
+
context += underlineColor;
|
|
93466
93492
|
if (i === firstLine) {
|
|
93467
93493
|
var lastCharForLine = i === lastLine ? lastLineChar : undefined;
|
|
93468
|
-
context += lineContent.slice(0, firstLineChar).replace(/\S/g, " ");
|
|
93469
|
-
|
|
93494
|
+
context += lineContent.slice(0, firstLineChar - whitespaceToTrim).replace(/\S/g, " ");
|
|
93495
|
+
var amendedLastChar = lastCharForLine ? lastCharForLine - whitespaceToTrim : undefined;
|
|
93496
|
+
context += lineContent.slice(firstLineChar - whitespaceToTrim, amendedLastChar).replace(/./g, "▔");
|
|
93470
93497
|
}
|
|
93471
93498
|
else if (i === lastLine) {
|
|
93472
|
-
context += lineContent.slice(0, lastLineChar).replace(/./g, "
|
|
93499
|
+
context += lineContent.slice(0, lastLineChar).replace(/./g, "▔");
|
|
93473
93500
|
}
|
|
93474
93501
|
else {
|
|
93475
|
-
context += lineContent.replace(/./g, "
|
|
93502
|
+
context += lineContent.replace(/./g, "▔");
|
|
93476
93503
|
}
|
|
93477
93504
|
context += resetEscapeSequence;
|
|
93478
93505
|
}
|
|
@@ -93492,41 +93519,50 @@ var ts;
|
|
|
93492
93519
|
}
|
|
93493
93520
|
ts.formatLocation = formatLocation;
|
|
93494
93521
|
function formatDiagnosticsWithColorAndContext(diagnostics, host) {
|
|
93522
|
+
var _a, _b;
|
|
93523
|
+
var terminalWidth = (_b = (_a = ts.sys.getWidthOfTerminal) === null || _a === void 0 ? void 0 : _a.call(ts.sys)) !== null && _b !== void 0 ? _b : 0;
|
|
93524
|
+
var indent = terminalWidth < 60 ? "" : halfIndent;
|
|
93495
93525
|
var output = "";
|
|
93496
93526
|
for (var _i = 0, diagnostics_4 = diagnostics; _i < diagnostics_4.length; _i++) {
|
|
93497
93527
|
var diagnostic = diagnostics_4[_i];
|
|
93528
|
+
var diagnosticCode = "TS" + diagnostic.code;
|
|
93498
93529
|
if (diagnostic.file) {
|
|
93499
93530
|
var file = diagnostic.file, start = diagnostic.start;
|
|
93500
|
-
|
|
93501
|
-
|
|
93502
|
-
|
|
93503
|
-
|
|
93504
|
-
|
|
93505
|
-
|
|
93506
|
-
|
|
93531
|
+
var location = formatLocation(file, start, host);
|
|
93532
|
+
var locationLength = location.replace(/\u001b[[0-9]+m/g, "").length;
|
|
93533
|
+
var codeLength = diagnosticCode.length;
|
|
93534
|
+
output += bullet + location;
|
|
93535
|
+
var defaultPad = codeLength + 1;
|
|
93536
|
+
var padWidth = terminalWidth < 60 ? defaultPad : terminalWidth - (bullet.length + locationLength + codeLength);
|
|
93537
|
+
if (padWidth < diagnosticCode.length)
|
|
93538
|
+
padWidth = defaultPad;
|
|
93539
|
+
output += ts.padLeft(diagnosticCode, padWidth);
|
|
93540
|
+
output += formatCodeSpan(diagnostic.file, diagnostic.start, diagnostic.length, indent, getCategoryFormat(diagnostic.category), host);
|
|
93507
93541
|
output += host.getNewLine();
|
|
93508
|
-
output += formatCodeSpan(diagnostic.file, diagnostic.start, diagnostic.length, "", getCategoryFormat(diagnostic.category), host);
|
|
93509
93542
|
}
|
|
93543
|
+
var diagnosticText = flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine(), 0, true);
|
|
93544
|
+
diagnosticText = ts.map(diagnosticText.split(host.getNewLine()), function (text) { return indent + text; }).join(host.getNewLine());
|
|
93545
|
+
output += diagnosticText;
|
|
93546
|
+
output += host.getNewLine();
|
|
93510
93547
|
if (diagnostic.relatedInformation) {
|
|
93511
93548
|
output += host.getNewLine();
|
|
93512
|
-
for (var
|
|
93513
|
-
var
|
|
93549
|
+
for (var _c = 0, _d = diagnostic.relatedInformation; _c < _d.length; _c++) {
|
|
93550
|
+
var _e = _d[_c], file = _e.file, start = _e.start, length_9 = _e.length, messageText = _e.messageText;
|
|
93551
|
+
output += ts.trimStringStart(flattenDiagnosticMessageText(messageText, host.getNewLine(), 0, true));
|
|
93514
93552
|
if (file) {
|
|
93553
|
+
output += " " + formatLocation(file, start, host);
|
|
93515
93554
|
output += host.getNewLine();
|
|
93516
|
-
output +=
|
|
93517
|
-
output += formatCodeSpan(file, start, length_9, indent, ForegroundColorEscapeSequences.Cyan, host);
|
|
93555
|
+
output += formatCodeSpan(file, start, length_9, indent + " ", ForegroundColorEscapeSequences.Cyan, host);
|
|
93518
93556
|
}
|
|
93519
|
-
output += host.getNewLine();
|
|
93520
|
-
output += indent + flattenDiagnosticMessageText(messageText, host.getNewLine());
|
|
93521
93557
|
}
|
|
93522
93558
|
}
|
|
93523
|
-
output += host.getNewLine();
|
|
93524
93559
|
}
|
|
93525
93560
|
return output;
|
|
93526
93561
|
}
|
|
93527
93562
|
ts.formatDiagnosticsWithColorAndContext = formatDiagnosticsWithColorAndContext;
|
|
93528
|
-
function flattenDiagnosticMessageText(diag, newLine, indent) {
|
|
93563
|
+
function flattenDiagnosticMessageText(diag, newLine, indent, pretty) {
|
|
93529
93564
|
if (indent === void 0) { indent = 0; }
|
|
93565
|
+
if (pretty === void 0) { pretty = false; }
|
|
93530
93566
|
if (ts.isString(diag)) {
|
|
93531
93567
|
return diag;
|
|
93532
93568
|
}
|
|
@@ -93536,9 +93572,14 @@ var ts;
|
|
|
93536
93572
|
var result = "";
|
|
93537
93573
|
if (indent) {
|
|
93538
93574
|
result += newLine;
|
|
93539
|
-
|
|
93540
|
-
|
|
93575
|
+
var indentsToReplaceWithNewLines = pretty ? 1 : 0;
|
|
93576
|
+
if (indent > indentsToReplaceWithNewLines) {
|
|
93577
|
+
for (var i = indentsToReplaceWithNewLines; i < indent; i++) {
|
|
93578
|
+
result += " ";
|
|
93579
|
+
}
|
|
93541
93580
|
}
|
|
93581
|
+
else
|
|
93582
|
+
result += newLine;
|
|
93542
93583
|
}
|
|
93543
93584
|
result += diag.messageText;
|
|
93544
93585
|
indent++;
|
|
@@ -93775,6 +93816,80 @@ var ts;
|
|
|
93775
93816
|
ts.Diagnostics.A_label_is_not_allowed_here.code,
|
|
93776
93817
|
ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode.code,
|
|
93777
93818
|
ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode.code,
|
|
93819
|
+
ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement.code,
|
|
93820
|
+
ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement.code,
|
|
93821
|
+
ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name.code,
|
|
93822
|
+
ts.Diagnostics.A_class_member_cannot_have_the_0_keyword.code,
|
|
93823
|
+
ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name.code,
|
|
93824
|
+
ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement.code,
|
|
93825
|
+
ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,
|
|
93826
|
+
ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,
|
|
93827
|
+
ts.Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement.code,
|
|
93828
|
+
ts.Diagnostics.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration.code,
|
|
93829
|
+
ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context.code,
|
|
93830
|
+
ts.Diagnostics.A_destructuring_declaration_must_have_an_initializer.code,
|
|
93831
|
+
ts.Diagnostics.A_get_accessor_cannot_have_parameters.code,
|
|
93832
|
+
ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern.code,
|
|
93833
|
+
ts.Diagnostics.A_rest_element_cannot_have_a_property_name.code,
|
|
93834
|
+
ts.Diagnostics.A_rest_element_cannot_have_an_initializer.code,
|
|
93835
|
+
ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern.code,
|
|
93836
|
+
ts.Diagnostics.A_rest_parameter_cannot_have_an_initializer.code,
|
|
93837
|
+
ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list.code,
|
|
93838
|
+
ts.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma.code,
|
|
93839
|
+
ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body.code,
|
|
93840
|
+
ts.Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block.code,
|
|
93841
|
+
ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter.code,
|
|
93842
|
+
ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter.code,
|
|
93843
|
+
ts.Diagnostics.An_export_declaration_can_only_be_used_in_a_module.code,
|
|
93844
|
+
ts.Diagnostics.An_export_declaration_cannot_have_modifiers.code,
|
|
93845
|
+
ts.Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module.code,
|
|
93846
|
+
ts.Diagnostics.An_import_declaration_cannot_have_modifiers.code,
|
|
93847
|
+
ts.Diagnostics.An_object_member_cannot_be_declared_optional.code,
|
|
93848
|
+
ts.Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element.code,
|
|
93849
|
+
ts.Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable.code,
|
|
93850
|
+
ts.Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause.code,
|
|
93851
|
+
ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer.code,
|
|
93852
|
+
ts.Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator.code,
|
|
93853
|
+
ts.Diagnostics.Classes_can_only_extend_a_single_class.code,
|
|
93854
|
+
ts.Diagnostics.Classes_may_not_have_a_field_named_constructor.code,
|
|
93855
|
+
ts.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code,
|
|
93856
|
+
ts.Diagnostics.Duplicate_label_0.code,
|
|
93857
|
+
ts.Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments.code,
|
|
93858
|
+
ts.Diagnostics.For_await_loops_cannot_be_used_inside_a_class_static_block.code,
|
|
93859
|
+
ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code,
|
|
93860
|
+
ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code,
|
|
93861
|
+
ts.Diagnostics.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array.code,
|
|
93862
|
+
ts.Diagnostics.JSX_property_access_expressions_cannot_include_JSX_namespace_names.code,
|
|
93863
|
+
ts.Diagnostics.Jump_target_cannot_cross_function_boundary.code,
|
|
93864
|
+
ts.Diagnostics.Line_terminator_not_permitted_before_arrow.code,
|
|
93865
|
+
ts.Diagnostics.Modifiers_cannot_appear_here.code,
|
|
93866
|
+
ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement.code,
|
|
93867
|
+
ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement.code,
|
|
93868
|
+
ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies.code,
|
|
93869
|
+
ts.Diagnostics.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression.code,
|
|
93870
|
+
ts.Diagnostics.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier.code,
|
|
93871
|
+
ts.Diagnostics.Tagged_template_expressions_are_not_permitted_in_an_optional_chain.code,
|
|
93872
|
+
ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async.code,
|
|
93873
|
+
ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer.code,
|
|
93874
|
+
ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer.code,
|
|
93875
|
+
ts.Diagnostics.Trailing_comma_not_allowed.code,
|
|
93876
|
+
ts.Diagnostics.Variable_declaration_list_cannot_be_empty.code,
|
|
93877
|
+
ts.Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses.code,
|
|
93878
|
+
ts.Diagnostics._0_expected.code,
|
|
93879
|
+
ts.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2.code,
|
|
93880
|
+
ts.Diagnostics._0_list_cannot_be_empty.code,
|
|
93881
|
+
ts.Diagnostics._0_modifier_already_seen.code,
|
|
93882
|
+
ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration.code,
|
|
93883
|
+
ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element.code,
|
|
93884
|
+
ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter.code,
|
|
93885
|
+
ts.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind.code,
|
|
93886
|
+
ts.Diagnostics._0_modifier_cannot_be_used_here.code,
|
|
93887
|
+
ts.Diagnostics._0_modifier_must_precede_1_modifier.code,
|
|
93888
|
+
ts.Diagnostics.const_declarations_can_only_be_declared_inside_a_block.code,
|
|
93889
|
+
ts.Diagnostics.const_declarations_must_be_initialized.code,
|
|
93890
|
+
ts.Diagnostics.extends_clause_already_seen.code,
|
|
93891
|
+
ts.Diagnostics.let_declarations_can_only_be_declared_inside_a_block.code,
|
|
93892
|
+
ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations.code,
|
|
93778
93893
|
]);
|
|
93779
93894
|
function shouldProgramCreateNewSourceFiles(program, newOptions) {
|
|
93780
93895
|
if (!program)
|
|
@@ -94630,9 +94745,10 @@ var ts;
|
|
|
94630
94745
|
var includeBindAndCheckDiagnostics = !isTsNoCheck && (sourceFile.scriptKind === 3 || sourceFile.scriptKind === 4
|
|
94631
94746
|
|| sourceFile.scriptKind === 5 || isPlainJs || isCheckJs || sourceFile.scriptKind === 7);
|
|
94632
94747
|
var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray;
|
|
94633
|
-
var checkDiagnostics = includeBindAndCheckDiagnostics
|
|
94748
|
+
var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;
|
|
94634
94749
|
if (isPlainJs) {
|
|
94635
94750
|
bindDiagnostics = ts.filter(bindDiagnostics, function (d) { return ts.plainJSErrors.has(d.code); });
|
|
94751
|
+
checkDiagnostics = ts.filter(checkDiagnostics, function (d) { return ts.plainJSErrors.has(d.code); });
|
|
94636
94752
|
}
|
|
94637
94753
|
return getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics && !isPlainJs, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined);
|
|
94638
94754
|
});
|