typescript 4.5.0-dev.20211005 → 4.5.0-dev.20211006
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 +34 -15
- package/lib/tsserver.js +35 -16
- package/lib/tsserverlibrary.js +35 -16
- package/lib/typescript.js +35 -16
- package/lib/typescriptServices.js +35 -16
- package/lib/typingsInstaller.js +34 -16
- 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.5";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20211006";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
function tryGetNativeMap() {
|
|
@@ -5900,6 +5900,7 @@ var ts;
|
|
|
5900
5900
|
Type_0_is_not_assignable_to_type_1_Did_you_mean_2: diag(2820, ts.DiagnosticCategory.Error, "Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820", "Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"),
|
|
5901
5901
|
Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext: diag(2821, ts.DiagnosticCategory.Error, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_2821", "Import assertions are only supported when the '--module' option is set to 'esnext'."),
|
|
5902
5902
|
Import_assertions_cannot_be_used_with_type_only_imports_or_exports: diag(2822, ts.DiagnosticCategory.Error, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."),
|
|
5903
|
+
Cannot_find_namespace_0_Did_you_mean_1: diag(2833, ts.DiagnosticCategory.Error, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"),
|
|
5903
5904
|
Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
5904
5905
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
|
5905
5906
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
|
@@ -34699,11 +34700,15 @@ var ts;
|
|
|
34699
34700
|
if (!scope || !scope.packageJsonContent.exports) {
|
|
34700
34701
|
return undefined;
|
|
34701
34702
|
}
|
|
34703
|
+
if (typeof scope.packageJsonContent.name !== "string") {
|
|
34704
|
+
return undefined;
|
|
34705
|
+
}
|
|
34702
34706
|
var parts = ts.getPathComponents(moduleName);
|
|
34703
|
-
|
|
34707
|
+
var nameParts = ts.getPathComponents(scope.packageJsonContent.name);
|
|
34708
|
+
if (!ts.every(nameParts, function (p, i) { return parts[i] === p; })) {
|
|
34704
34709
|
return undefined;
|
|
34705
34710
|
}
|
|
34706
|
-
var trailingParts = parts.slice(
|
|
34711
|
+
var trailingParts = parts.slice(nameParts.length);
|
|
34707
34712
|
return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : "." + ts.directorySeparator + trailingParts.join(ts.directorySeparator), state, cache, redirectedReference);
|
|
34708
34713
|
}
|
|
34709
34714
|
function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
|
|
@@ -39343,11 +39348,11 @@ var ts;
|
|
|
39343
39348
|
}
|
|
39344
39349
|
}
|
|
39345
39350
|
}
|
|
39346
|
-
function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals
|
|
39351
|
+
function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals) {
|
|
39347
39352
|
if (excludeGlobals === void 0) { excludeGlobals = false; }
|
|
39348
|
-
return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSymbol
|
|
39353
|
+
return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSymbol);
|
|
39349
39354
|
}
|
|
39350
|
-
function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, lookup
|
|
39355
|
+
function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, lookup) {
|
|
39351
39356
|
var _a, _b, _c;
|
|
39352
39357
|
var originalLocation = location;
|
|
39353
39358
|
var result;
|
|
@@ -39592,7 +39597,7 @@ var ts;
|
|
|
39592
39597
|
!checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) &&
|
|
39593
39598
|
!checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning)) {
|
|
39594
39599
|
var suggestion = void 0;
|
|
39595
|
-
if (
|
|
39600
|
+
if (suggestionCount < maximumSuggestionCount) {
|
|
39596
39601
|
suggestion = getSuggestedSymbolForNonexistentSymbol(originalLocation, name, meaning);
|
|
39597
39602
|
var isGlobalScopeAugmentationDeclaration = (suggestion === null || suggestion === void 0 ? void 0 : suggestion.valueDeclaration) && ts.isAmbientModule(suggestion.valueDeclaration) && ts.isGlobalScopeAugmentation(suggestion.valueDeclaration);
|
|
39598
39603
|
if (isGlobalScopeAugmentationDeclaration) {
|
|
@@ -39601,7 +39606,9 @@ var ts;
|
|
|
39601
39606
|
if (suggestion) {
|
|
39602
39607
|
var suggestionName = symbolToString(suggestion);
|
|
39603
39608
|
var isUncheckedJS = isUncheckedJSSuggestion(originalLocation, suggestion, false);
|
|
39604
|
-
var message =
|
|
39609
|
+
var message = meaning === 1920 || nameArg && typeof nameArg !== "string" && ts.nodeIsSynthesized(nameArg) ? ts.Diagnostics.Cannot_find_namespace_0_Did_you_mean_1
|
|
39610
|
+
: isUncheckedJS ? ts.Diagnostics.Could_not_find_name_0_Did_you_mean_1
|
|
39611
|
+
: ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1;
|
|
39605
39612
|
var diagnostic = createError(errorLocation, message, diagnosticName(nameArg), suggestionName);
|
|
39606
39613
|
addErrorOrSuggestion(!isUncheckedJS, diagnostic);
|
|
39607
39614
|
if (suggestion.valueDeclaration) {
|
|
@@ -40463,7 +40470,7 @@ var ts;
|
|
|
40463
40470
|
if (name.kind === 79) {
|
|
40464
40471
|
var message = meaning === namespaceMeaning || ts.nodeIsSynthesized(name) ? ts.Diagnostics.Cannot_find_namespace_0 : getCannotFindNameDiagnosticForName(ts.getFirstIdentifier(name));
|
|
40465
40472
|
var symbolFromJSPrototype = ts.isInJSFile(name) && !ts.nodeIsSynthesized(name) ? resolveEntityNameFromAssignmentDeclaration(name, meaning) : undefined;
|
|
40466
|
-
symbol = getMergedSymbol(resolveName(location || name, name.escapedText, meaning, ignoreErrors || symbolFromJSPrototype ? undefined : message, name, true));
|
|
40473
|
+
symbol = getMergedSymbol(resolveName(location || name, name.escapedText, meaning, ignoreErrors || symbolFromJSPrototype ? undefined : message, name, true, false));
|
|
40467
40474
|
if (!symbol) {
|
|
40468
40475
|
return getMergedSymbol(symbolFromJSPrototype);
|
|
40469
40476
|
}
|
|
@@ -55958,7 +55965,7 @@ var ts;
|
|
|
55958
55965
|
var links = getNodeLinks(node);
|
|
55959
55966
|
if (!links.resolvedSymbol) {
|
|
55960
55967
|
links.resolvedSymbol = !ts.nodeIsMissing(node) &&
|
|
55961
|
-
resolveName(node, node.escapedText, 111551 | 1048576, getCannotFindNameDiagnosticForName(node), node, !ts.isWriteOnlyAccess(node), false
|
|
55968
|
+
resolveName(node, node.escapedText, 111551 | 1048576, getCannotFindNameDiagnosticForName(node), node, !ts.isWriteOnlyAccess(node), false) || unknownSymbol;
|
|
55962
55969
|
}
|
|
55963
55970
|
return links.resolvedSymbol;
|
|
55964
55971
|
}
|
|
@@ -60728,7 +60735,19 @@ var ts;
|
|
|
60728
60735
|
var result = resolveNameHelper(location, outerName, meaning, undefined, outerName, false, false, function (symbols, name, meaning) {
|
|
60729
60736
|
ts.Debug.assertEqual(outerName, name, "name should equal outerName");
|
|
60730
60737
|
var symbol = getSymbol(symbols, name, meaning);
|
|
60731
|
-
|
|
60738
|
+
if (symbol)
|
|
60739
|
+
return symbol;
|
|
60740
|
+
var candidates;
|
|
60741
|
+
if (symbols === globals) {
|
|
60742
|
+
var primitives = ts.mapDefined(["string", "number", "boolean", "object", "bigint", "symbol"], function (s) { return symbols.has((s.charAt(0).toUpperCase() + s.slice(1)))
|
|
60743
|
+
? createSymbol(524288, s)
|
|
60744
|
+
: undefined; });
|
|
60745
|
+
candidates = primitives.concat(ts.arrayFrom(symbols.values()));
|
|
60746
|
+
}
|
|
60747
|
+
else {
|
|
60748
|
+
candidates = ts.arrayFrom(symbols.values());
|
|
60749
|
+
}
|
|
60750
|
+
return getSpellingSuggestionForName(ts.unescapeLeadingUnderscores(name), candidates, meaning);
|
|
60732
60751
|
});
|
|
60733
60752
|
return result;
|
|
60734
60753
|
}
|
|
@@ -100194,11 +100213,11 @@ var ts;
|
|
|
100194
100213
|
(_a = state.moduleResolutionCache) === null || _a === void 0 ? void 0 : _a.update(config.options);
|
|
100195
100214
|
(_b = state.typeReferenceDirectiveResolutionCache) === null || _b === void 0 ? void 0 : _b.update(config.options);
|
|
100196
100215
|
program = host.createProgram(config.fileNames, config.options, compilerHost, getOldProgram(state, projectPath, config), ts.getConfigFileParsingDiagnostics(config), config.projectReferences);
|
|
100197
|
-
state.lastCachedPackageJsonLookups.set(projectPath, state.moduleResolutionCache && ts.map(state.moduleResolutionCache.getPackageJsonInfoCache().entries(), function (_a) {
|
|
100198
|
-
var path = _a[0], data = _a[1];
|
|
100199
|
-
return [state.host.realpath ? toPath(state, state.host.realpath(path)) : path, data];
|
|
100200
|
-
}));
|
|
100201
100216
|
if (state.watch) {
|
|
100217
|
+
state.lastCachedPackageJsonLookups.set(projectPath, state.moduleResolutionCache && ts.map(state.moduleResolutionCache.getPackageJsonInfoCache().entries(), function (_a) {
|
|
100218
|
+
var path = _a[0], data = _a[1];
|
|
100219
|
+
return [state.host.realpath && data ? toPath(state, state.host.realpath(path)) : path, data];
|
|
100220
|
+
}));
|
|
100202
100221
|
state.builderPrograms.set(projectPath, program);
|
|
100203
100222
|
}
|
|
100204
100223
|
step++;
|
package/lib/tsserver.js
CHANGED
|
@@ -100,7 +100,7 @@ var ts;
|
|
|
100
100
|
// The following is baselined as a literal template type without intervention
|
|
101
101
|
/** The version of the TypeScript compiler release */
|
|
102
102
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
103
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
103
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20211006";
|
|
104
104
|
/* @internal */
|
|
105
105
|
var Comparison;
|
|
106
106
|
(function (Comparison) {
|
|
@@ -8674,6 +8674,7 @@ var ts;
|
|
|
8674
8674
|
Type_0_is_not_assignable_to_type_1_Did_you_mean_2: diag(2820, ts.DiagnosticCategory.Error, "Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820", "Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"),
|
|
8675
8675
|
Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext: diag(2821, ts.DiagnosticCategory.Error, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_2821", "Import assertions are only supported when the '--module' option is set to 'esnext'."),
|
|
8676
8676
|
Import_assertions_cannot_be_used_with_type_only_imports_or_exports: diag(2822, ts.DiagnosticCategory.Error, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."),
|
|
8677
|
+
Cannot_find_namespace_0_Did_you_mean_1: diag(2833, ts.DiagnosticCategory.Error, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"),
|
|
8677
8678
|
Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
8678
8679
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
|
8679
8680
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
|
@@ -42493,11 +42494,15 @@ var ts;
|
|
|
42493
42494
|
if (!scope || !scope.packageJsonContent.exports) {
|
|
42494
42495
|
return undefined;
|
|
42495
42496
|
}
|
|
42497
|
+
if (typeof scope.packageJsonContent.name !== "string") {
|
|
42498
|
+
return undefined;
|
|
42499
|
+
}
|
|
42496
42500
|
var parts = ts.getPathComponents(moduleName); // unrooted paths should have `""` as their 0th entry
|
|
42497
|
-
|
|
42501
|
+
var nameParts = ts.getPathComponents(scope.packageJsonContent.name);
|
|
42502
|
+
if (!ts.every(nameParts, function (p, i) { return parts[i] === p; })) {
|
|
42498
42503
|
return undefined;
|
|
42499
42504
|
}
|
|
42500
|
-
var trailingParts = parts.slice(
|
|
42505
|
+
var trailingParts = parts.slice(nameParts.length);
|
|
42501
42506
|
return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : "." + ts.directorySeparator + trailingParts.join(ts.directorySeparator), state, cache, redirectedReference);
|
|
42502
42507
|
}
|
|
42503
42508
|
function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
|
|
@@ -47975,11 +47980,11 @@ var ts;
|
|
|
47975
47980
|
*
|
|
47976
47981
|
* @param isUse If true, this will count towards --noUnusedLocals / --noUnusedParameters.
|
|
47977
47982
|
*/
|
|
47978
|
-
function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals
|
|
47983
|
+
function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals) {
|
|
47979
47984
|
if (excludeGlobals === void 0) { excludeGlobals = false; }
|
|
47980
|
-
return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSymbol
|
|
47985
|
+
return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSymbol);
|
|
47981
47986
|
}
|
|
47982
|
-
function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, lookup
|
|
47987
|
+
function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, lookup) {
|
|
47983
47988
|
var _a, _b, _c;
|
|
47984
47989
|
var originalLocation = location; // needed for did-you-mean error reporting, which gathers candidates starting from the original location
|
|
47985
47990
|
var result;
|
|
@@ -48306,7 +48311,7 @@ var ts;
|
|
|
48306
48311
|
!checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) &&
|
|
48307
48312
|
!checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning)) {
|
|
48308
48313
|
var suggestion = void 0;
|
|
48309
|
-
if (
|
|
48314
|
+
if (suggestionCount < maximumSuggestionCount) {
|
|
48310
48315
|
suggestion = getSuggestedSymbolForNonexistentSymbol(originalLocation, name, meaning);
|
|
48311
48316
|
var isGlobalScopeAugmentationDeclaration = (suggestion === null || suggestion === void 0 ? void 0 : suggestion.valueDeclaration) && ts.isAmbientModule(suggestion.valueDeclaration) && ts.isGlobalScopeAugmentation(suggestion.valueDeclaration);
|
|
48312
48317
|
if (isGlobalScopeAugmentationDeclaration) {
|
|
@@ -48315,7 +48320,9 @@ var ts;
|
|
|
48315
48320
|
if (suggestion) {
|
|
48316
48321
|
var suggestionName = symbolToString(suggestion);
|
|
48317
48322
|
var isUncheckedJS = isUncheckedJSSuggestion(originalLocation, suggestion, /*excludeClasses*/ false);
|
|
48318
|
-
var message =
|
|
48323
|
+
var message = meaning === 1920 /* Namespace */ || nameArg && typeof nameArg !== "string" && ts.nodeIsSynthesized(nameArg) ? ts.Diagnostics.Cannot_find_namespace_0_Did_you_mean_1
|
|
48324
|
+
: isUncheckedJS ? ts.Diagnostics.Could_not_find_name_0_Did_you_mean_1
|
|
48325
|
+
: ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1;
|
|
48319
48326
|
var diagnostic = createError(errorLocation, message, diagnosticName(nameArg), suggestionName);
|
|
48320
48327
|
addErrorOrSuggestion(!isUncheckedJS, diagnostic);
|
|
48321
48328
|
if (suggestion.valueDeclaration) {
|
|
@@ -49309,7 +49316,7 @@ var ts;
|
|
|
49309
49316
|
if (name.kind === 79 /* Identifier */) {
|
|
49310
49317
|
var message = meaning === namespaceMeaning || ts.nodeIsSynthesized(name) ? ts.Diagnostics.Cannot_find_namespace_0 : getCannotFindNameDiagnosticForName(ts.getFirstIdentifier(name));
|
|
49311
49318
|
var symbolFromJSPrototype = ts.isInJSFile(name) && !ts.nodeIsSynthesized(name) ? resolveEntityNameFromAssignmentDeclaration(name, meaning) : undefined;
|
|
49312
|
-
symbol = getMergedSymbol(resolveName(location || name, name.escapedText, meaning, ignoreErrors || symbolFromJSPrototype ? undefined : message, name, /*isUse*/ true));
|
|
49319
|
+
symbol = getMergedSymbol(resolveName(location || name, name.escapedText, meaning, ignoreErrors || symbolFromJSPrototype ? undefined : message, name, /*isUse*/ true, false));
|
|
49313
49320
|
if (!symbol) {
|
|
49314
49321
|
return getMergedSymbol(symbolFromJSPrototype);
|
|
49315
49322
|
}
|
|
@@ -67087,8 +67094,7 @@ var ts;
|
|
|
67087
67094
|
if (!links.resolvedSymbol) {
|
|
67088
67095
|
links.resolvedSymbol = !ts.nodeIsMissing(node) &&
|
|
67089
67096
|
resolveName(node, node.escapedText, 111551 /* Value */ | 1048576 /* ExportValue */, getCannotFindNameDiagnosticForName(node), node, !ts.isWriteOnlyAccess(node),
|
|
67090
|
-
/*excludeGlobals*/ false
|
|
67091
|
-
/*issueSuggestions*/ true) || unknownSymbol;
|
|
67097
|
+
/*excludeGlobals*/ false) || unknownSymbol;
|
|
67092
67098
|
}
|
|
67093
67099
|
return links.resolvedSymbol;
|
|
67094
67100
|
}
|
|
@@ -72652,7 +72658,19 @@ var ts;
|
|
|
72652
72658
|
// Sometimes the symbol is found when location is a return type of a function: `typeof x` and `x` is declared in the body of the function
|
|
72653
72659
|
// So the table *contains* `x` but `x` isn't actually in scope.
|
|
72654
72660
|
// However, resolveNameHelper will continue and call this callback again, so we'll eventually get a correct suggestion.
|
|
72655
|
-
|
|
72661
|
+
if (symbol)
|
|
72662
|
+
return symbol;
|
|
72663
|
+
var candidates;
|
|
72664
|
+
if (symbols === globals) {
|
|
72665
|
+
var primitives = ts.mapDefined(["string", "number", "boolean", "object", "bigint", "symbol"], function (s) { return symbols.has((s.charAt(0).toUpperCase() + s.slice(1)))
|
|
72666
|
+
? createSymbol(524288 /* TypeAlias */, s)
|
|
72667
|
+
: undefined; });
|
|
72668
|
+
candidates = primitives.concat(ts.arrayFrom(symbols.values()));
|
|
72669
|
+
}
|
|
72670
|
+
else {
|
|
72671
|
+
candidates = ts.arrayFrom(symbols.values());
|
|
72672
|
+
}
|
|
72673
|
+
return getSpellingSuggestionForName(ts.unescapeLeadingUnderscores(name), candidates, meaning);
|
|
72656
72674
|
});
|
|
72657
72675
|
return result;
|
|
72658
72676
|
}
|
|
@@ -121094,11 +121112,11 @@ var ts;
|
|
|
121094
121112
|
(_b = state.typeReferenceDirectiveResolutionCache) === null || _b === void 0 ? void 0 : _b.update(config.options);
|
|
121095
121113
|
// Create program
|
|
121096
121114
|
program = host.createProgram(config.fileNames, config.options, compilerHost, getOldProgram(state, projectPath, config), ts.getConfigFileParsingDiagnostics(config), config.projectReferences);
|
|
121097
|
-
state.lastCachedPackageJsonLookups.set(projectPath, state.moduleResolutionCache && ts.map(state.moduleResolutionCache.getPackageJsonInfoCache().entries(), function (_a) {
|
|
121098
|
-
var path = _a[0], data = _a[1];
|
|
121099
|
-
return [state.host.realpath ? toPath(state, state.host.realpath(path)) : path, data];
|
|
121100
|
-
}));
|
|
121101
121115
|
if (state.watch) {
|
|
121116
|
+
state.lastCachedPackageJsonLookups.set(projectPath, state.moduleResolutionCache && ts.map(state.moduleResolutionCache.getPackageJsonInfoCache().entries(), function (_a) {
|
|
121117
|
+
var path = _a[0], data = _a[1];
|
|
121118
|
+
return [state.host.realpath && data ? toPath(state, state.host.realpath(path)) : path, data];
|
|
121119
|
+
}));
|
|
121102
121120
|
state.builderPrograms.set(projectPath, program);
|
|
121103
121121
|
}
|
|
121104
121122
|
step++;
|
|
@@ -148763,6 +148781,7 @@ var ts;
|
|
|
148763
148781
|
ts.Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2.code,
|
|
148764
148782
|
ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1.code,
|
|
148765
148783
|
ts.Diagnostics.Could_not_find_name_0_Did_you_mean_1.code,
|
|
148784
|
+
ts.Diagnostics.Cannot_find_namespace_0_Did_you_mean_1.code,
|
|
148766
148785
|
ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,
|
|
148767
148786
|
ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,
|
|
148768
148787
|
ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2.code,
|
package/lib/tsserverlibrary.js
CHANGED
|
@@ -294,7 +294,7 @@ var ts;
|
|
|
294
294
|
// The following is baselined as a literal template type without intervention
|
|
295
295
|
/** The version of the TypeScript compiler release */
|
|
296
296
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
297
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
297
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20211006";
|
|
298
298
|
/* @internal */
|
|
299
299
|
var Comparison;
|
|
300
300
|
(function (Comparison) {
|
|
@@ -8868,6 +8868,7 @@ var ts;
|
|
|
8868
8868
|
Type_0_is_not_assignable_to_type_1_Did_you_mean_2: diag(2820, ts.DiagnosticCategory.Error, "Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820", "Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"),
|
|
8869
8869
|
Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext: diag(2821, ts.DiagnosticCategory.Error, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_2821", "Import assertions are only supported when the '--module' option is set to 'esnext'."),
|
|
8870
8870
|
Import_assertions_cannot_be_used_with_type_only_imports_or_exports: diag(2822, ts.DiagnosticCategory.Error, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."),
|
|
8871
|
+
Cannot_find_namespace_0_Did_you_mean_1: diag(2833, ts.DiagnosticCategory.Error, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"),
|
|
8871
8872
|
Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
8872
8873
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
|
8873
8874
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
|
@@ -42687,11 +42688,15 @@ var ts;
|
|
|
42687
42688
|
if (!scope || !scope.packageJsonContent.exports) {
|
|
42688
42689
|
return undefined;
|
|
42689
42690
|
}
|
|
42691
|
+
if (typeof scope.packageJsonContent.name !== "string") {
|
|
42692
|
+
return undefined;
|
|
42693
|
+
}
|
|
42690
42694
|
var parts = ts.getPathComponents(moduleName); // unrooted paths should have `""` as their 0th entry
|
|
42691
|
-
|
|
42695
|
+
var nameParts = ts.getPathComponents(scope.packageJsonContent.name);
|
|
42696
|
+
if (!ts.every(nameParts, function (p, i) { return parts[i] === p; })) {
|
|
42692
42697
|
return undefined;
|
|
42693
42698
|
}
|
|
42694
|
-
var trailingParts = parts.slice(
|
|
42699
|
+
var trailingParts = parts.slice(nameParts.length);
|
|
42695
42700
|
return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : "." + ts.directorySeparator + trailingParts.join(ts.directorySeparator), state, cache, redirectedReference);
|
|
42696
42701
|
}
|
|
42697
42702
|
function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
|
|
@@ -48169,11 +48174,11 @@ var ts;
|
|
|
48169
48174
|
*
|
|
48170
48175
|
* @param isUse If true, this will count towards --noUnusedLocals / --noUnusedParameters.
|
|
48171
48176
|
*/
|
|
48172
|
-
function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals
|
|
48177
|
+
function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals) {
|
|
48173
48178
|
if (excludeGlobals === void 0) { excludeGlobals = false; }
|
|
48174
|
-
return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSymbol
|
|
48179
|
+
return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSymbol);
|
|
48175
48180
|
}
|
|
48176
|
-
function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, lookup
|
|
48181
|
+
function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, lookup) {
|
|
48177
48182
|
var _a, _b, _c;
|
|
48178
48183
|
var originalLocation = location; // needed for did-you-mean error reporting, which gathers candidates starting from the original location
|
|
48179
48184
|
var result;
|
|
@@ -48500,7 +48505,7 @@ var ts;
|
|
|
48500
48505
|
!checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) &&
|
|
48501
48506
|
!checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning)) {
|
|
48502
48507
|
var suggestion = void 0;
|
|
48503
|
-
if (
|
|
48508
|
+
if (suggestionCount < maximumSuggestionCount) {
|
|
48504
48509
|
suggestion = getSuggestedSymbolForNonexistentSymbol(originalLocation, name, meaning);
|
|
48505
48510
|
var isGlobalScopeAugmentationDeclaration = (suggestion === null || suggestion === void 0 ? void 0 : suggestion.valueDeclaration) && ts.isAmbientModule(suggestion.valueDeclaration) && ts.isGlobalScopeAugmentation(suggestion.valueDeclaration);
|
|
48506
48511
|
if (isGlobalScopeAugmentationDeclaration) {
|
|
@@ -48509,7 +48514,9 @@ var ts;
|
|
|
48509
48514
|
if (suggestion) {
|
|
48510
48515
|
var suggestionName = symbolToString(suggestion);
|
|
48511
48516
|
var isUncheckedJS = isUncheckedJSSuggestion(originalLocation, suggestion, /*excludeClasses*/ false);
|
|
48512
|
-
var message =
|
|
48517
|
+
var message = meaning === 1920 /* Namespace */ || nameArg && typeof nameArg !== "string" && ts.nodeIsSynthesized(nameArg) ? ts.Diagnostics.Cannot_find_namespace_0_Did_you_mean_1
|
|
48518
|
+
: isUncheckedJS ? ts.Diagnostics.Could_not_find_name_0_Did_you_mean_1
|
|
48519
|
+
: ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1;
|
|
48513
48520
|
var diagnostic = createError(errorLocation, message, diagnosticName(nameArg), suggestionName);
|
|
48514
48521
|
addErrorOrSuggestion(!isUncheckedJS, diagnostic);
|
|
48515
48522
|
if (suggestion.valueDeclaration) {
|
|
@@ -49503,7 +49510,7 @@ var ts;
|
|
|
49503
49510
|
if (name.kind === 79 /* Identifier */) {
|
|
49504
49511
|
var message = meaning === namespaceMeaning || ts.nodeIsSynthesized(name) ? ts.Diagnostics.Cannot_find_namespace_0 : getCannotFindNameDiagnosticForName(ts.getFirstIdentifier(name));
|
|
49505
49512
|
var symbolFromJSPrototype = ts.isInJSFile(name) && !ts.nodeIsSynthesized(name) ? resolveEntityNameFromAssignmentDeclaration(name, meaning) : undefined;
|
|
49506
|
-
symbol = getMergedSymbol(resolveName(location || name, name.escapedText, meaning, ignoreErrors || symbolFromJSPrototype ? undefined : message, name, /*isUse*/ true));
|
|
49513
|
+
symbol = getMergedSymbol(resolveName(location || name, name.escapedText, meaning, ignoreErrors || symbolFromJSPrototype ? undefined : message, name, /*isUse*/ true, false));
|
|
49507
49514
|
if (!symbol) {
|
|
49508
49515
|
return getMergedSymbol(symbolFromJSPrototype);
|
|
49509
49516
|
}
|
|
@@ -67281,8 +67288,7 @@ var ts;
|
|
|
67281
67288
|
if (!links.resolvedSymbol) {
|
|
67282
67289
|
links.resolvedSymbol = !ts.nodeIsMissing(node) &&
|
|
67283
67290
|
resolveName(node, node.escapedText, 111551 /* Value */ | 1048576 /* ExportValue */, getCannotFindNameDiagnosticForName(node), node, !ts.isWriteOnlyAccess(node),
|
|
67284
|
-
/*excludeGlobals*/ false
|
|
67285
|
-
/*issueSuggestions*/ true) || unknownSymbol;
|
|
67291
|
+
/*excludeGlobals*/ false) || unknownSymbol;
|
|
67286
67292
|
}
|
|
67287
67293
|
return links.resolvedSymbol;
|
|
67288
67294
|
}
|
|
@@ -72846,7 +72852,19 @@ var ts;
|
|
|
72846
72852
|
// Sometimes the symbol is found when location is a return type of a function: `typeof x` and `x` is declared in the body of the function
|
|
72847
72853
|
// So the table *contains* `x` but `x` isn't actually in scope.
|
|
72848
72854
|
// However, resolveNameHelper will continue and call this callback again, so we'll eventually get a correct suggestion.
|
|
72849
|
-
|
|
72855
|
+
if (symbol)
|
|
72856
|
+
return symbol;
|
|
72857
|
+
var candidates;
|
|
72858
|
+
if (symbols === globals) {
|
|
72859
|
+
var primitives = ts.mapDefined(["string", "number", "boolean", "object", "bigint", "symbol"], function (s) { return symbols.has((s.charAt(0).toUpperCase() + s.slice(1)))
|
|
72860
|
+
? createSymbol(524288 /* TypeAlias */, s)
|
|
72861
|
+
: undefined; });
|
|
72862
|
+
candidates = primitives.concat(ts.arrayFrom(symbols.values()));
|
|
72863
|
+
}
|
|
72864
|
+
else {
|
|
72865
|
+
candidates = ts.arrayFrom(symbols.values());
|
|
72866
|
+
}
|
|
72867
|
+
return getSpellingSuggestionForName(ts.unescapeLeadingUnderscores(name), candidates, meaning);
|
|
72850
72868
|
});
|
|
72851
72869
|
return result;
|
|
72852
72870
|
}
|
|
@@ -121288,11 +121306,11 @@ var ts;
|
|
|
121288
121306
|
(_b = state.typeReferenceDirectiveResolutionCache) === null || _b === void 0 ? void 0 : _b.update(config.options);
|
|
121289
121307
|
// Create program
|
|
121290
121308
|
program = host.createProgram(config.fileNames, config.options, compilerHost, getOldProgram(state, projectPath, config), ts.getConfigFileParsingDiagnostics(config), config.projectReferences);
|
|
121291
|
-
state.lastCachedPackageJsonLookups.set(projectPath, state.moduleResolutionCache && ts.map(state.moduleResolutionCache.getPackageJsonInfoCache().entries(), function (_a) {
|
|
121292
|
-
var path = _a[0], data = _a[1];
|
|
121293
|
-
return [state.host.realpath ? toPath(state, state.host.realpath(path)) : path, data];
|
|
121294
|
-
}));
|
|
121295
121309
|
if (state.watch) {
|
|
121310
|
+
state.lastCachedPackageJsonLookups.set(projectPath, state.moduleResolutionCache && ts.map(state.moduleResolutionCache.getPackageJsonInfoCache().entries(), function (_a) {
|
|
121311
|
+
var path = _a[0], data = _a[1];
|
|
121312
|
+
return [state.host.realpath && data ? toPath(state, state.host.realpath(path)) : path, data];
|
|
121313
|
+
}));
|
|
121296
121314
|
state.builderPrograms.set(projectPath, program);
|
|
121297
121315
|
}
|
|
121298
121316
|
step++;
|
|
@@ -149345,6 +149363,7 @@ var ts;
|
|
|
149345
149363
|
ts.Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2.code,
|
|
149346
149364
|
ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1.code,
|
|
149347
149365
|
ts.Diagnostics.Could_not_find_name_0_Did_you_mean_1.code,
|
|
149366
|
+
ts.Diagnostics.Cannot_find_namespace_0_Did_you_mean_1.code,
|
|
149348
149367
|
ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,
|
|
149349
149368
|
ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,
|
|
149350
149369
|
ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2.code,
|
package/lib/typescript.js
CHANGED
|
@@ -294,7 +294,7 @@ var ts;
|
|
|
294
294
|
// The following is baselined as a literal template type without intervention
|
|
295
295
|
/** The version of the TypeScript compiler release */
|
|
296
296
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
297
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
297
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20211006";
|
|
298
298
|
/* @internal */
|
|
299
299
|
var Comparison;
|
|
300
300
|
(function (Comparison) {
|
|
@@ -8868,6 +8868,7 @@ var ts;
|
|
|
8868
8868
|
Type_0_is_not_assignable_to_type_1_Did_you_mean_2: diag(2820, ts.DiagnosticCategory.Error, "Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820", "Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"),
|
|
8869
8869
|
Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext: diag(2821, ts.DiagnosticCategory.Error, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_2821", "Import assertions are only supported when the '--module' option is set to 'esnext'."),
|
|
8870
8870
|
Import_assertions_cannot_be_used_with_type_only_imports_or_exports: diag(2822, ts.DiagnosticCategory.Error, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."),
|
|
8871
|
+
Cannot_find_namespace_0_Did_you_mean_1: diag(2833, ts.DiagnosticCategory.Error, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"),
|
|
8871
8872
|
Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
8872
8873
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
|
8873
8874
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
|
@@ -42687,11 +42688,15 @@ var ts;
|
|
|
42687
42688
|
if (!scope || !scope.packageJsonContent.exports) {
|
|
42688
42689
|
return undefined;
|
|
42689
42690
|
}
|
|
42691
|
+
if (typeof scope.packageJsonContent.name !== "string") {
|
|
42692
|
+
return undefined;
|
|
42693
|
+
}
|
|
42690
42694
|
var parts = ts.getPathComponents(moduleName); // unrooted paths should have `""` as their 0th entry
|
|
42691
|
-
|
|
42695
|
+
var nameParts = ts.getPathComponents(scope.packageJsonContent.name);
|
|
42696
|
+
if (!ts.every(nameParts, function (p, i) { return parts[i] === p; })) {
|
|
42692
42697
|
return undefined;
|
|
42693
42698
|
}
|
|
42694
|
-
var trailingParts = parts.slice(
|
|
42699
|
+
var trailingParts = parts.slice(nameParts.length);
|
|
42695
42700
|
return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : "." + ts.directorySeparator + trailingParts.join(ts.directorySeparator), state, cache, redirectedReference);
|
|
42696
42701
|
}
|
|
42697
42702
|
function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
|
|
@@ -48169,11 +48174,11 @@ var ts;
|
|
|
48169
48174
|
*
|
|
48170
48175
|
* @param isUse If true, this will count towards --noUnusedLocals / --noUnusedParameters.
|
|
48171
48176
|
*/
|
|
48172
|
-
function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals
|
|
48177
|
+
function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals) {
|
|
48173
48178
|
if (excludeGlobals === void 0) { excludeGlobals = false; }
|
|
48174
|
-
return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSymbol
|
|
48179
|
+
return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSymbol);
|
|
48175
48180
|
}
|
|
48176
|
-
function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, lookup
|
|
48181
|
+
function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, lookup) {
|
|
48177
48182
|
var _a, _b, _c;
|
|
48178
48183
|
var originalLocation = location; // needed for did-you-mean error reporting, which gathers candidates starting from the original location
|
|
48179
48184
|
var result;
|
|
@@ -48500,7 +48505,7 @@ var ts;
|
|
|
48500
48505
|
!checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) &&
|
|
48501
48506
|
!checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning)) {
|
|
48502
48507
|
var suggestion = void 0;
|
|
48503
|
-
if (
|
|
48508
|
+
if (suggestionCount < maximumSuggestionCount) {
|
|
48504
48509
|
suggestion = getSuggestedSymbolForNonexistentSymbol(originalLocation, name, meaning);
|
|
48505
48510
|
var isGlobalScopeAugmentationDeclaration = (suggestion === null || suggestion === void 0 ? void 0 : suggestion.valueDeclaration) && ts.isAmbientModule(suggestion.valueDeclaration) && ts.isGlobalScopeAugmentation(suggestion.valueDeclaration);
|
|
48506
48511
|
if (isGlobalScopeAugmentationDeclaration) {
|
|
@@ -48509,7 +48514,9 @@ var ts;
|
|
|
48509
48514
|
if (suggestion) {
|
|
48510
48515
|
var suggestionName = symbolToString(suggestion);
|
|
48511
48516
|
var isUncheckedJS = isUncheckedJSSuggestion(originalLocation, suggestion, /*excludeClasses*/ false);
|
|
48512
|
-
var message =
|
|
48517
|
+
var message = meaning === 1920 /* Namespace */ || nameArg && typeof nameArg !== "string" && ts.nodeIsSynthesized(nameArg) ? ts.Diagnostics.Cannot_find_namespace_0_Did_you_mean_1
|
|
48518
|
+
: isUncheckedJS ? ts.Diagnostics.Could_not_find_name_0_Did_you_mean_1
|
|
48519
|
+
: ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1;
|
|
48513
48520
|
var diagnostic = createError(errorLocation, message, diagnosticName(nameArg), suggestionName);
|
|
48514
48521
|
addErrorOrSuggestion(!isUncheckedJS, diagnostic);
|
|
48515
48522
|
if (suggestion.valueDeclaration) {
|
|
@@ -49503,7 +49510,7 @@ var ts;
|
|
|
49503
49510
|
if (name.kind === 79 /* Identifier */) {
|
|
49504
49511
|
var message = meaning === namespaceMeaning || ts.nodeIsSynthesized(name) ? ts.Diagnostics.Cannot_find_namespace_0 : getCannotFindNameDiagnosticForName(ts.getFirstIdentifier(name));
|
|
49505
49512
|
var symbolFromJSPrototype = ts.isInJSFile(name) && !ts.nodeIsSynthesized(name) ? resolveEntityNameFromAssignmentDeclaration(name, meaning) : undefined;
|
|
49506
|
-
symbol = getMergedSymbol(resolveName(location || name, name.escapedText, meaning, ignoreErrors || symbolFromJSPrototype ? undefined : message, name, /*isUse*/ true));
|
|
49513
|
+
symbol = getMergedSymbol(resolveName(location || name, name.escapedText, meaning, ignoreErrors || symbolFromJSPrototype ? undefined : message, name, /*isUse*/ true, false));
|
|
49507
49514
|
if (!symbol) {
|
|
49508
49515
|
return getMergedSymbol(symbolFromJSPrototype);
|
|
49509
49516
|
}
|
|
@@ -67281,8 +67288,7 @@ var ts;
|
|
|
67281
67288
|
if (!links.resolvedSymbol) {
|
|
67282
67289
|
links.resolvedSymbol = !ts.nodeIsMissing(node) &&
|
|
67283
67290
|
resolveName(node, node.escapedText, 111551 /* Value */ | 1048576 /* ExportValue */, getCannotFindNameDiagnosticForName(node), node, !ts.isWriteOnlyAccess(node),
|
|
67284
|
-
/*excludeGlobals*/ false
|
|
67285
|
-
/*issueSuggestions*/ true) || unknownSymbol;
|
|
67291
|
+
/*excludeGlobals*/ false) || unknownSymbol;
|
|
67286
67292
|
}
|
|
67287
67293
|
return links.resolvedSymbol;
|
|
67288
67294
|
}
|
|
@@ -72846,7 +72852,19 @@ var ts;
|
|
|
72846
72852
|
// Sometimes the symbol is found when location is a return type of a function: `typeof x` and `x` is declared in the body of the function
|
|
72847
72853
|
// So the table *contains* `x` but `x` isn't actually in scope.
|
|
72848
72854
|
// However, resolveNameHelper will continue and call this callback again, so we'll eventually get a correct suggestion.
|
|
72849
|
-
|
|
72855
|
+
if (symbol)
|
|
72856
|
+
return symbol;
|
|
72857
|
+
var candidates;
|
|
72858
|
+
if (symbols === globals) {
|
|
72859
|
+
var primitives = ts.mapDefined(["string", "number", "boolean", "object", "bigint", "symbol"], function (s) { return symbols.has((s.charAt(0).toUpperCase() + s.slice(1)))
|
|
72860
|
+
? createSymbol(524288 /* TypeAlias */, s)
|
|
72861
|
+
: undefined; });
|
|
72862
|
+
candidates = primitives.concat(ts.arrayFrom(symbols.values()));
|
|
72863
|
+
}
|
|
72864
|
+
else {
|
|
72865
|
+
candidates = ts.arrayFrom(symbols.values());
|
|
72866
|
+
}
|
|
72867
|
+
return getSpellingSuggestionForName(ts.unescapeLeadingUnderscores(name), candidates, meaning);
|
|
72850
72868
|
});
|
|
72851
72869
|
return result;
|
|
72852
72870
|
}
|
|
@@ -121288,11 +121306,11 @@ var ts;
|
|
|
121288
121306
|
(_b = state.typeReferenceDirectiveResolutionCache) === null || _b === void 0 ? void 0 : _b.update(config.options);
|
|
121289
121307
|
// Create program
|
|
121290
121308
|
program = host.createProgram(config.fileNames, config.options, compilerHost, getOldProgram(state, projectPath, config), ts.getConfigFileParsingDiagnostics(config), config.projectReferences);
|
|
121291
|
-
state.lastCachedPackageJsonLookups.set(projectPath, state.moduleResolutionCache && ts.map(state.moduleResolutionCache.getPackageJsonInfoCache().entries(), function (_a) {
|
|
121292
|
-
var path = _a[0], data = _a[1];
|
|
121293
|
-
return [state.host.realpath ? toPath(state, state.host.realpath(path)) : path, data];
|
|
121294
|
-
}));
|
|
121295
121309
|
if (state.watch) {
|
|
121310
|
+
state.lastCachedPackageJsonLookups.set(projectPath, state.moduleResolutionCache && ts.map(state.moduleResolutionCache.getPackageJsonInfoCache().entries(), function (_a) {
|
|
121311
|
+
var path = _a[0], data = _a[1];
|
|
121312
|
+
return [state.host.realpath && data ? toPath(state, state.host.realpath(path)) : path, data];
|
|
121313
|
+
}));
|
|
121296
121314
|
state.builderPrograms.set(projectPath, program);
|
|
121297
121315
|
}
|
|
121298
121316
|
step++;
|
|
@@ -149345,6 +149363,7 @@ var ts;
|
|
|
149345
149363
|
ts.Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2.code,
|
|
149346
149364
|
ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1.code,
|
|
149347
149365
|
ts.Diagnostics.Could_not_find_name_0_Did_you_mean_1.code,
|
|
149366
|
+
ts.Diagnostics.Cannot_find_namespace_0_Did_you_mean_1.code,
|
|
149348
149367
|
ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,
|
|
149349
149368
|
ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,
|
|
149350
149369
|
ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2.code,
|
|
@@ -294,7 +294,7 @@ var ts;
|
|
|
294
294
|
// The following is baselined as a literal template type without intervention
|
|
295
295
|
/** The version of the TypeScript compiler release */
|
|
296
296
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
297
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
297
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20211006";
|
|
298
298
|
/* @internal */
|
|
299
299
|
var Comparison;
|
|
300
300
|
(function (Comparison) {
|
|
@@ -8868,6 +8868,7 @@ var ts;
|
|
|
8868
8868
|
Type_0_is_not_assignable_to_type_1_Did_you_mean_2: diag(2820, ts.DiagnosticCategory.Error, "Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820", "Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"),
|
|
8869
8869
|
Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext: diag(2821, ts.DiagnosticCategory.Error, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_2821", "Import assertions are only supported when the '--module' option is set to 'esnext'."),
|
|
8870
8870
|
Import_assertions_cannot_be_used_with_type_only_imports_or_exports: diag(2822, ts.DiagnosticCategory.Error, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."),
|
|
8871
|
+
Cannot_find_namespace_0_Did_you_mean_1: diag(2833, ts.DiagnosticCategory.Error, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"),
|
|
8871
8872
|
Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
8872
8873
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
|
8873
8874
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
|
@@ -42687,11 +42688,15 @@ var ts;
|
|
|
42687
42688
|
if (!scope || !scope.packageJsonContent.exports) {
|
|
42688
42689
|
return undefined;
|
|
42689
42690
|
}
|
|
42691
|
+
if (typeof scope.packageJsonContent.name !== "string") {
|
|
42692
|
+
return undefined;
|
|
42693
|
+
}
|
|
42690
42694
|
var parts = ts.getPathComponents(moduleName); // unrooted paths should have `""` as their 0th entry
|
|
42691
|
-
|
|
42695
|
+
var nameParts = ts.getPathComponents(scope.packageJsonContent.name);
|
|
42696
|
+
if (!ts.every(nameParts, function (p, i) { return parts[i] === p; })) {
|
|
42692
42697
|
return undefined;
|
|
42693
42698
|
}
|
|
42694
|
-
var trailingParts = parts.slice(
|
|
42699
|
+
var trailingParts = parts.slice(nameParts.length);
|
|
42695
42700
|
return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : "." + ts.directorySeparator + trailingParts.join(ts.directorySeparator), state, cache, redirectedReference);
|
|
42696
42701
|
}
|
|
42697
42702
|
function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
|
|
@@ -48169,11 +48174,11 @@ var ts;
|
|
|
48169
48174
|
*
|
|
48170
48175
|
* @param isUse If true, this will count towards --noUnusedLocals / --noUnusedParameters.
|
|
48171
48176
|
*/
|
|
48172
|
-
function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals
|
|
48177
|
+
function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals) {
|
|
48173
48178
|
if (excludeGlobals === void 0) { excludeGlobals = false; }
|
|
48174
|
-
return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSymbol
|
|
48179
|
+
return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSymbol);
|
|
48175
48180
|
}
|
|
48176
|
-
function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, lookup
|
|
48181
|
+
function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, lookup) {
|
|
48177
48182
|
var _a, _b, _c;
|
|
48178
48183
|
var originalLocation = location; // needed for did-you-mean error reporting, which gathers candidates starting from the original location
|
|
48179
48184
|
var result;
|
|
@@ -48500,7 +48505,7 @@ var ts;
|
|
|
48500
48505
|
!checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) &&
|
|
48501
48506
|
!checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning)) {
|
|
48502
48507
|
var suggestion = void 0;
|
|
48503
|
-
if (
|
|
48508
|
+
if (suggestionCount < maximumSuggestionCount) {
|
|
48504
48509
|
suggestion = getSuggestedSymbolForNonexistentSymbol(originalLocation, name, meaning);
|
|
48505
48510
|
var isGlobalScopeAugmentationDeclaration = (suggestion === null || suggestion === void 0 ? void 0 : suggestion.valueDeclaration) && ts.isAmbientModule(suggestion.valueDeclaration) && ts.isGlobalScopeAugmentation(suggestion.valueDeclaration);
|
|
48506
48511
|
if (isGlobalScopeAugmentationDeclaration) {
|
|
@@ -48509,7 +48514,9 @@ var ts;
|
|
|
48509
48514
|
if (suggestion) {
|
|
48510
48515
|
var suggestionName = symbolToString(suggestion);
|
|
48511
48516
|
var isUncheckedJS = isUncheckedJSSuggestion(originalLocation, suggestion, /*excludeClasses*/ false);
|
|
48512
|
-
var message =
|
|
48517
|
+
var message = meaning === 1920 /* Namespace */ || nameArg && typeof nameArg !== "string" && ts.nodeIsSynthesized(nameArg) ? ts.Diagnostics.Cannot_find_namespace_0_Did_you_mean_1
|
|
48518
|
+
: isUncheckedJS ? ts.Diagnostics.Could_not_find_name_0_Did_you_mean_1
|
|
48519
|
+
: ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1;
|
|
48513
48520
|
var diagnostic = createError(errorLocation, message, diagnosticName(nameArg), suggestionName);
|
|
48514
48521
|
addErrorOrSuggestion(!isUncheckedJS, diagnostic);
|
|
48515
48522
|
if (suggestion.valueDeclaration) {
|
|
@@ -49503,7 +49510,7 @@ var ts;
|
|
|
49503
49510
|
if (name.kind === 79 /* Identifier */) {
|
|
49504
49511
|
var message = meaning === namespaceMeaning || ts.nodeIsSynthesized(name) ? ts.Diagnostics.Cannot_find_namespace_0 : getCannotFindNameDiagnosticForName(ts.getFirstIdentifier(name));
|
|
49505
49512
|
var symbolFromJSPrototype = ts.isInJSFile(name) && !ts.nodeIsSynthesized(name) ? resolveEntityNameFromAssignmentDeclaration(name, meaning) : undefined;
|
|
49506
|
-
symbol = getMergedSymbol(resolveName(location || name, name.escapedText, meaning, ignoreErrors || symbolFromJSPrototype ? undefined : message, name, /*isUse*/ true));
|
|
49513
|
+
symbol = getMergedSymbol(resolveName(location || name, name.escapedText, meaning, ignoreErrors || symbolFromJSPrototype ? undefined : message, name, /*isUse*/ true, false));
|
|
49507
49514
|
if (!symbol) {
|
|
49508
49515
|
return getMergedSymbol(symbolFromJSPrototype);
|
|
49509
49516
|
}
|
|
@@ -67281,8 +67288,7 @@ var ts;
|
|
|
67281
67288
|
if (!links.resolvedSymbol) {
|
|
67282
67289
|
links.resolvedSymbol = !ts.nodeIsMissing(node) &&
|
|
67283
67290
|
resolveName(node, node.escapedText, 111551 /* Value */ | 1048576 /* ExportValue */, getCannotFindNameDiagnosticForName(node), node, !ts.isWriteOnlyAccess(node),
|
|
67284
|
-
/*excludeGlobals*/ false
|
|
67285
|
-
/*issueSuggestions*/ true) || unknownSymbol;
|
|
67291
|
+
/*excludeGlobals*/ false) || unknownSymbol;
|
|
67286
67292
|
}
|
|
67287
67293
|
return links.resolvedSymbol;
|
|
67288
67294
|
}
|
|
@@ -72846,7 +72852,19 @@ var ts;
|
|
|
72846
72852
|
// Sometimes the symbol is found when location is a return type of a function: `typeof x` and `x` is declared in the body of the function
|
|
72847
72853
|
// So the table *contains* `x` but `x` isn't actually in scope.
|
|
72848
72854
|
// However, resolveNameHelper will continue and call this callback again, so we'll eventually get a correct suggestion.
|
|
72849
|
-
|
|
72855
|
+
if (symbol)
|
|
72856
|
+
return symbol;
|
|
72857
|
+
var candidates;
|
|
72858
|
+
if (symbols === globals) {
|
|
72859
|
+
var primitives = ts.mapDefined(["string", "number", "boolean", "object", "bigint", "symbol"], function (s) { return symbols.has((s.charAt(0).toUpperCase() + s.slice(1)))
|
|
72860
|
+
? createSymbol(524288 /* TypeAlias */, s)
|
|
72861
|
+
: undefined; });
|
|
72862
|
+
candidates = primitives.concat(ts.arrayFrom(symbols.values()));
|
|
72863
|
+
}
|
|
72864
|
+
else {
|
|
72865
|
+
candidates = ts.arrayFrom(symbols.values());
|
|
72866
|
+
}
|
|
72867
|
+
return getSpellingSuggestionForName(ts.unescapeLeadingUnderscores(name), candidates, meaning);
|
|
72850
72868
|
});
|
|
72851
72869
|
return result;
|
|
72852
72870
|
}
|
|
@@ -121288,11 +121306,11 @@ var ts;
|
|
|
121288
121306
|
(_b = state.typeReferenceDirectiveResolutionCache) === null || _b === void 0 ? void 0 : _b.update(config.options);
|
|
121289
121307
|
// Create program
|
|
121290
121308
|
program = host.createProgram(config.fileNames, config.options, compilerHost, getOldProgram(state, projectPath, config), ts.getConfigFileParsingDiagnostics(config), config.projectReferences);
|
|
121291
|
-
state.lastCachedPackageJsonLookups.set(projectPath, state.moduleResolutionCache && ts.map(state.moduleResolutionCache.getPackageJsonInfoCache().entries(), function (_a) {
|
|
121292
|
-
var path = _a[0], data = _a[1];
|
|
121293
|
-
return [state.host.realpath ? toPath(state, state.host.realpath(path)) : path, data];
|
|
121294
|
-
}));
|
|
121295
121309
|
if (state.watch) {
|
|
121310
|
+
state.lastCachedPackageJsonLookups.set(projectPath, state.moduleResolutionCache && ts.map(state.moduleResolutionCache.getPackageJsonInfoCache().entries(), function (_a) {
|
|
121311
|
+
var path = _a[0], data = _a[1];
|
|
121312
|
+
return [state.host.realpath && data ? toPath(state, state.host.realpath(path)) : path, data];
|
|
121313
|
+
}));
|
|
121296
121314
|
state.builderPrograms.set(projectPath, program);
|
|
121297
121315
|
}
|
|
121298
121316
|
step++;
|
|
@@ -149345,6 +149363,7 @@ var ts;
|
|
|
149345
149363
|
ts.Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2.code,
|
|
149346
149364
|
ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1.code,
|
|
149347
149365
|
ts.Diagnostics.Could_not_find_name_0_Did_you_mean_1.code,
|
|
149366
|
+
ts.Diagnostics.Cannot_find_namespace_0_Did_you_mean_1.code,
|
|
149348
149367
|
ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,
|
|
149349
149368
|
ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,
|
|
149350
149369
|
ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2.code,
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -89,7 +89,7 @@ var ts;
|
|
|
89
89
|
// The following is baselined as a literal template type without intervention
|
|
90
90
|
/** The version of the TypeScript compiler release */
|
|
91
91
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
92
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
92
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20211006";
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -8663,6 +8663,7 @@ var ts;
|
|
|
8663
8663
|
Type_0_is_not_assignable_to_type_1_Did_you_mean_2: diag(2820, ts.DiagnosticCategory.Error, "Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820", "Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"),
|
|
8664
8664
|
Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext: diag(2821, ts.DiagnosticCategory.Error, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_2821", "Import assertions are only supported when the '--module' option is set to 'esnext'."),
|
|
8665
8665
|
Import_assertions_cannot_be_used_with_type_only_imports_or_exports: diag(2822, ts.DiagnosticCategory.Error, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."),
|
|
8666
|
+
Cannot_find_namespace_0_Did_you_mean_1: diag(2833, ts.DiagnosticCategory.Error, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"),
|
|
8666
8667
|
Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
8667
8668
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
|
8668
8669
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
|
@@ -42482,11 +42483,15 @@ var ts;
|
|
|
42482
42483
|
if (!scope || !scope.packageJsonContent.exports) {
|
|
42483
42484
|
return undefined;
|
|
42484
42485
|
}
|
|
42486
|
+
if (typeof scope.packageJsonContent.name !== "string") {
|
|
42487
|
+
return undefined;
|
|
42488
|
+
}
|
|
42485
42489
|
var parts = ts.getPathComponents(moduleName); // unrooted paths should have `""` as their 0th entry
|
|
42486
|
-
|
|
42490
|
+
var nameParts = ts.getPathComponents(scope.packageJsonContent.name);
|
|
42491
|
+
if (!ts.every(nameParts, function (p, i) { return parts[i] === p; })) {
|
|
42487
42492
|
return undefined;
|
|
42488
42493
|
}
|
|
42489
|
-
var trailingParts = parts.slice(
|
|
42494
|
+
var trailingParts = parts.slice(nameParts.length);
|
|
42490
42495
|
return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : "." + ts.directorySeparator + trailingParts.join(ts.directorySeparator), state, cache, redirectedReference);
|
|
42491
42496
|
}
|
|
42492
42497
|
function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
|
|
@@ -47964,11 +47969,11 @@ var ts;
|
|
|
47964
47969
|
*
|
|
47965
47970
|
* @param isUse If true, this will count towards --noUnusedLocals / --noUnusedParameters.
|
|
47966
47971
|
*/
|
|
47967
|
-
function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals
|
|
47972
|
+
function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals) {
|
|
47968
47973
|
if (excludeGlobals === void 0) { excludeGlobals = false; }
|
|
47969
|
-
return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSymbol
|
|
47974
|
+
return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSymbol);
|
|
47970
47975
|
}
|
|
47971
|
-
function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, lookup
|
|
47976
|
+
function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, lookup) {
|
|
47972
47977
|
var _a, _b, _c;
|
|
47973
47978
|
var originalLocation = location; // needed for did-you-mean error reporting, which gathers candidates starting from the original location
|
|
47974
47979
|
var result;
|
|
@@ -48295,7 +48300,7 @@ var ts;
|
|
|
48295
48300
|
!checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) &&
|
|
48296
48301
|
!checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning)) {
|
|
48297
48302
|
var suggestion = void 0;
|
|
48298
|
-
if (
|
|
48303
|
+
if (suggestionCount < maximumSuggestionCount) {
|
|
48299
48304
|
suggestion = getSuggestedSymbolForNonexistentSymbol(originalLocation, name, meaning);
|
|
48300
48305
|
var isGlobalScopeAugmentationDeclaration = (suggestion === null || suggestion === void 0 ? void 0 : suggestion.valueDeclaration) && ts.isAmbientModule(suggestion.valueDeclaration) && ts.isGlobalScopeAugmentation(suggestion.valueDeclaration);
|
|
48301
48306
|
if (isGlobalScopeAugmentationDeclaration) {
|
|
@@ -48304,7 +48309,9 @@ var ts;
|
|
|
48304
48309
|
if (suggestion) {
|
|
48305
48310
|
var suggestionName = symbolToString(suggestion);
|
|
48306
48311
|
var isUncheckedJS = isUncheckedJSSuggestion(originalLocation, suggestion, /*excludeClasses*/ false);
|
|
48307
|
-
var message =
|
|
48312
|
+
var message = meaning === 1920 /* Namespace */ || nameArg && typeof nameArg !== "string" && ts.nodeIsSynthesized(nameArg) ? ts.Diagnostics.Cannot_find_namespace_0_Did_you_mean_1
|
|
48313
|
+
: isUncheckedJS ? ts.Diagnostics.Could_not_find_name_0_Did_you_mean_1
|
|
48314
|
+
: ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1;
|
|
48308
48315
|
var diagnostic = createError(errorLocation, message, diagnosticName(nameArg), suggestionName);
|
|
48309
48316
|
addErrorOrSuggestion(!isUncheckedJS, diagnostic);
|
|
48310
48317
|
if (suggestion.valueDeclaration) {
|
|
@@ -49298,7 +49305,7 @@ var ts;
|
|
|
49298
49305
|
if (name.kind === 79 /* Identifier */) {
|
|
49299
49306
|
var message = meaning === namespaceMeaning || ts.nodeIsSynthesized(name) ? ts.Diagnostics.Cannot_find_namespace_0 : getCannotFindNameDiagnosticForName(ts.getFirstIdentifier(name));
|
|
49300
49307
|
var symbolFromJSPrototype = ts.isInJSFile(name) && !ts.nodeIsSynthesized(name) ? resolveEntityNameFromAssignmentDeclaration(name, meaning) : undefined;
|
|
49301
|
-
symbol = getMergedSymbol(resolveName(location || name, name.escapedText, meaning, ignoreErrors || symbolFromJSPrototype ? undefined : message, name, /*isUse*/ true));
|
|
49308
|
+
symbol = getMergedSymbol(resolveName(location || name, name.escapedText, meaning, ignoreErrors || symbolFromJSPrototype ? undefined : message, name, /*isUse*/ true, false));
|
|
49302
49309
|
if (!symbol) {
|
|
49303
49310
|
return getMergedSymbol(symbolFromJSPrototype);
|
|
49304
49311
|
}
|
|
@@ -67076,8 +67083,7 @@ var ts;
|
|
|
67076
67083
|
if (!links.resolvedSymbol) {
|
|
67077
67084
|
links.resolvedSymbol = !ts.nodeIsMissing(node) &&
|
|
67078
67085
|
resolveName(node, node.escapedText, 111551 /* Value */ | 1048576 /* ExportValue */, getCannotFindNameDiagnosticForName(node), node, !ts.isWriteOnlyAccess(node),
|
|
67079
|
-
/*excludeGlobals*/ false
|
|
67080
|
-
/*issueSuggestions*/ true) || unknownSymbol;
|
|
67086
|
+
/*excludeGlobals*/ false) || unknownSymbol;
|
|
67081
67087
|
}
|
|
67082
67088
|
return links.resolvedSymbol;
|
|
67083
67089
|
}
|
|
@@ -72641,7 +72647,19 @@ var ts;
|
|
|
72641
72647
|
// Sometimes the symbol is found when location is a return type of a function: `typeof x` and `x` is declared in the body of the function
|
|
72642
72648
|
// So the table *contains* `x` but `x` isn't actually in scope.
|
|
72643
72649
|
// However, resolveNameHelper will continue and call this callback again, so we'll eventually get a correct suggestion.
|
|
72644
|
-
|
|
72650
|
+
if (symbol)
|
|
72651
|
+
return symbol;
|
|
72652
|
+
var candidates;
|
|
72653
|
+
if (symbols === globals) {
|
|
72654
|
+
var primitives = ts.mapDefined(["string", "number", "boolean", "object", "bigint", "symbol"], function (s) { return symbols.has((s.charAt(0).toUpperCase() + s.slice(1)))
|
|
72655
|
+
? createSymbol(524288 /* TypeAlias */, s)
|
|
72656
|
+
: undefined; });
|
|
72657
|
+
candidates = primitives.concat(ts.arrayFrom(symbols.values()));
|
|
72658
|
+
}
|
|
72659
|
+
else {
|
|
72660
|
+
candidates = ts.arrayFrom(symbols.values());
|
|
72661
|
+
}
|
|
72662
|
+
return getSpellingSuggestionForName(ts.unescapeLeadingUnderscores(name), candidates, meaning);
|
|
72645
72663
|
});
|
|
72646
72664
|
return result;
|
|
72647
72665
|
}
|
|
@@ -121083,11 +121101,11 @@ var ts;
|
|
|
121083
121101
|
(_b = state.typeReferenceDirectiveResolutionCache) === null || _b === void 0 ? void 0 : _b.update(config.options);
|
|
121084
121102
|
// Create program
|
|
121085
121103
|
program = host.createProgram(config.fileNames, config.options, compilerHost, getOldProgram(state, projectPath, config), ts.getConfigFileParsingDiagnostics(config), config.projectReferences);
|
|
121086
|
-
state.lastCachedPackageJsonLookups.set(projectPath, state.moduleResolutionCache && ts.map(state.moduleResolutionCache.getPackageJsonInfoCache().entries(), function (_a) {
|
|
121087
|
-
var path = _a[0], data = _a[1];
|
|
121088
|
-
return [state.host.realpath ? toPath(state, state.host.realpath(path)) : path, data];
|
|
121089
|
-
}));
|
|
121090
121104
|
if (state.watch) {
|
|
121105
|
+
state.lastCachedPackageJsonLookups.set(projectPath, state.moduleResolutionCache && ts.map(state.moduleResolutionCache.getPackageJsonInfoCache().entries(), function (_a) {
|
|
121106
|
+
var path = _a[0], data = _a[1];
|
|
121107
|
+
return [state.host.realpath && data ? toPath(state, state.host.realpath(path)) : path, data];
|
|
121108
|
+
}));
|
|
121091
121109
|
state.builderPrograms.set(projectPath, program);
|
|
121092
121110
|
}
|
|
121093
121111
|
step++;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "typescript",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "4.5.0-dev.
|
|
5
|
+
"version": "4.5.0-dev.20211006",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|