@typescript-deploys/pr-build 4.7.0-pr-48168-8 → 4.7.0-pr-47657-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.es2022.object.d.ts +1 -1
- package/lib/tsc.js +150 -66
- package/lib/tsserver.js +322 -334
- package/lib/tsserverlibrary.d.ts +58 -15
- package/lib/tsserverlibrary.js +322 -334
- package/lib/typescript.d.ts +58 -15
- package/lib/typescript.js +318 -334
- package/lib/typescriptServices.d.ts +58 -15
- package/lib/typescriptServices.js +318 -334
- package/lib/typingsInstaller.js +186 -72
- package/package.json +1 -10
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.7";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-insiders.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-insiders.20220311";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -1733,13 +1733,15 @@ var ts;
|
|
|
1733
1733
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1734
1734
|
args[_i] = arguments[_i];
|
|
1735
1735
|
}
|
|
1736
|
+
var lastResult;
|
|
1736
1737
|
for (var _a = 0, fs_1 = fs; _a < fs_1.length; _a++) {
|
|
1737
1738
|
var f = fs_1[_a];
|
|
1738
|
-
|
|
1739
|
-
|
|
1739
|
+
lastResult = f.apply(void 0, args);
|
|
1740
|
+
if (lastResult) {
|
|
1741
|
+
return lastResult;
|
|
1740
1742
|
}
|
|
1741
1743
|
}
|
|
1742
|
-
return
|
|
1744
|
+
return lastResult;
|
|
1743
1745
|
};
|
|
1744
1746
|
}
|
|
1745
1747
|
ts.or = or;
|
|
@@ -3263,6 +3265,12 @@ var ts;
|
|
|
3263
3265
|
ModuleResolutionKind[ModuleResolutionKind["Node12"] = 3] = "Node12";
|
|
3264
3266
|
ModuleResolutionKind[ModuleResolutionKind["NodeNext"] = 99] = "NodeNext";
|
|
3265
3267
|
})(ModuleResolutionKind = ts.ModuleResolutionKind || (ts.ModuleResolutionKind = {}));
|
|
3268
|
+
var ModuleDetectionKind;
|
|
3269
|
+
(function (ModuleDetectionKind) {
|
|
3270
|
+
ModuleDetectionKind[ModuleDetectionKind["Legacy"] = 1] = "Legacy";
|
|
3271
|
+
ModuleDetectionKind[ModuleDetectionKind["Auto"] = 2] = "Auto";
|
|
3272
|
+
ModuleDetectionKind[ModuleDetectionKind["Force"] = 3] = "Force";
|
|
3273
|
+
})(ModuleDetectionKind = ts.ModuleDetectionKind || (ts.ModuleDetectionKind = {}));
|
|
3266
3274
|
var WatchFileKind;
|
|
3267
3275
|
(function (WatchFileKind) {
|
|
3268
3276
|
WatchFileKind[WatchFileKind["FixedPollingInterval"] = 0] = "FixedPollingInterval";
|
|
@@ -5428,6 +5436,8 @@ var ts;
|
|
|
5428
5436
|
catch_or_finally_expected: diag(1472, ts.DiagnosticCategory.Error, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
|
|
5429
5437
|
An_import_declaration_can_only_be_used_at_the_top_level_of_a_module: diag(1473, ts.DiagnosticCategory.Error, "An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473", "An import declaration can only be used at the top level of a module."),
|
|
5430
5438
|
An_export_declaration_can_only_be_used_at_the_top_level_of_a_module: diag(1474, ts.DiagnosticCategory.Error, "An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474", "An export declaration can only be used at the top level of a module."),
|
|
5439
|
+
Control_what_method_is_used_to_detect_module_format_JS_files: diag(1475, ts.DiagnosticCategory.Message, "Control_what_method_is_used_to_detect_module_format_JS_files_1475", "Control what method is used to detect module-format JS files."),
|
|
5440
|
+
auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node12_as_modules: diag(1476, ts.DiagnosticCategory.Message, "auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476", "\"auto\": Treat files with imports, exports, import.meta, jsx (with jsx: react-jsx), or esm format (with module: node12+) as modules."),
|
|
5431
5441
|
The_types_of_0_are_incompatible_between_these_types: diag(2200, ts.DiagnosticCategory.Error, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
|
|
5432
5442
|
The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, ts.DiagnosticCategory.Error, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
|
|
5433
5443
|
Call_signature_return_types_0_and_1_are_incompatible: diag(2202, ts.DiagnosticCategory.Error, "Call_signature_return_types_0_and_1_are_incompatible_2202", "Call signature return types '{0}' and '{1}' are incompatible.", undefined, true),
|
|
@@ -15604,6 +15614,42 @@ var ts;
|
|
|
15604
15614
|
return scriptKind === 4 || scriptKind === 2 || scriptKind === 1 || scriptKind === 6 ? 1 : 0;
|
|
15605
15615
|
}
|
|
15606
15616
|
ts.getLanguageVariant = getLanguageVariant;
|
|
15617
|
+
function walkTreeForJSXTags(node) {
|
|
15618
|
+
if (!(node.transformFlags & 2))
|
|
15619
|
+
return undefined;
|
|
15620
|
+
return ts.isJsxOpeningLikeElement(node) || ts.isJsxFragment(node) ? node : ts.forEachChild(node, walkTreeForJSXTags);
|
|
15621
|
+
}
|
|
15622
|
+
function isFileModuleFromUsingJSXTag(file) {
|
|
15623
|
+
return !file.isDeclarationFile ? walkTreeForJSXTags(file) : undefined;
|
|
15624
|
+
}
|
|
15625
|
+
function isFileForcedToBeModuleByFormat(file) {
|
|
15626
|
+
return file.impliedNodeFormat === ts.ModuleKind.ESNext && !file.isDeclarationFile ? true : undefined;
|
|
15627
|
+
}
|
|
15628
|
+
function getSetExternalModuleIndicator(options) {
|
|
15629
|
+
switch (getEmitModuleDetectionKind(options)) {
|
|
15630
|
+
case ts.ModuleDetectionKind.Force:
|
|
15631
|
+
return function (file) {
|
|
15632
|
+
file.externalModuleIndicator = !file.isDeclarationFile || ts.isFileProbablyExternalModule(file);
|
|
15633
|
+
};
|
|
15634
|
+
case ts.ModuleDetectionKind.Legacy:
|
|
15635
|
+
return function (file) {
|
|
15636
|
+
file.externalModuleIndicator = ts.isFileProbablyExternalModule(file);
|
|
15637
|
+
};
|
|
15638
|
+
case ts.ModuleDetectionKind.Auto:
|
|
15639
|
+
var checks = [ts.isFileProbablyExternalModule];
|
|
15640
|
+
if (options.jsx === 4 || options.jsx === 5) {
|
|
15641
|
+
checks.push(isFileModuleFromUsingJSXTag);
|
|
15642
|
+
}
|
|
15643
|
+
var moduleKind = getEmitModuleKind(options);
|
|
15644
|
+
if (moduleKind === ts.ModuleKind.Node12 || moduleKind === ts.ModuleKind.NodeNext) {
|
|
15645
|
+
checks.push(isFileForcedToBeModuleByFormat);
|
|
15646
|
+
}
|
|
15647
|
+
var combined_1 = ts.or.apply(void 0, checks);
|
|
15648
|
+
var callback = function (file) { return void (file.externalModuleIndicator = combined_1(file)); };
|
|
15649
|
+
return callback;
|
|
15650
|
+
}
|
|
15651
|
+
}
|
|
15652
|
+
ts.getSetExternalModuleIndicator = getSetExternalModuleIndicator;
|
|
15607
15653
|
function getEmitScriptTarget(compilerOptions) {
|
|
15608
15654
|
return compilerOptions.target ||
|
|
15609
15655
|
(compilerOptions.module === ts.ModuleKind.Node12 && 7) ||
|
|
@@ -15638,6 +15684,10 @@ var ts;
|
|
|
15638
15684
|
return moduleResolution;
|
|
15639
15685
|
}
|
|
15640
15686
|
ts.getEmitModuleResolutionKind = getEmitModuleResolutionKind;
|
|
15687
|
+
function getEmitModuleDetectionKind(options) {
|
|
15688
|
+
return options.moduleDetection || ts.ModuleDetectionKind.Auto;
|
|
15689
|
+
}
|
|
15690
|
+
ts.getEmitModuleDetectionKind = getEmitModuleDetectionKind;
|
|
15641
15691
|
function hasJsonModuleEmitEnabled(options) {
|
|
15642
15692
|
switch (getEmitModuleKind(options)) {
|
|
15643
15693
|
case ts.ModuleKind.CommonJS:
|
|
@@ -24073,6 +24123,32 @@ var ts;
|
|
|
24073
24123
|
text.charCodeAt(start + 3) !== 47;
|
|
24074
24124
|
}
|
|
24075
24125
|
ts.isJSDocLikeText = isJSDocLikeText;
|
|
24126
|
+
function isFileProbablyExternalModule(sourceFile) {
|
|
24127
|
+
return ts.forEach(sourceFile.statements, isAnExternalModuleIndicatorNode) ||
|
|
24128
|
+
getImportMetaIfNecessary(sourceFile);
|
|
24129
|
+
}
|
|
24130
|
+
ts.isFileProbablyExternalModule = isFileProbablyExternalModule;
|
|
24131
|
+
function isAnExternalModuleIndicatorNode(node) {
|
|
24132
|
+
return hasModifierOfKind(node, 93)
|
|
24133
|
+
|| ts.isImportEqualsDeclaration(node) && ts.isExternalModuleReference(node.moduleReference)
|
|
24134
|
+
|| ts.isImportDeclaration(node)
|
|
24135
|
+
|| ts.isExportAssignment(node)
|
|
24136
|
+
|| ts.isExportDeclaration(node) ? node : undefined;
|
|
24137
|
+
}
|
|
24138
|
+
function getImportMetaIfNecessary(sourceFile) {
|
|
24139
|
+
return sourceFile.flags & 2097152 ?
|
|
24140
|
+
walkTreeForImportMeta(sourceFile) :
|
|
24141
|
+
undefined;
|
|
24142
|
+
}
|
|
24143
|
+
function walkTreeForImportMeta(node) {
|
|
24144
|
+
return isImportMeta(node) ? node : forEachChild(node, walkTreeForImportMeta);
|
|
24145
|
+
}
|
|
24146
|
+
function hasModifierOfKind(node, kind) {
|
|
24147
|
+
return ts.some(node.modifiers, function (m) { return m.kind === kind; });
|
|
24148
|
+
}
|
|
24149
|
+
function isImportMeta(node) {
|
|
24150
|
+
return ts.isMetaProperty(node) && node.keywordToken === 100 && node.name.escapedText === "meta";
|
|
24151
|
+
}
|
|
24076
24152
|
function forEachChild(node, cbNode, cbNodes) {
|
|
24077
24153
|
if (!node || node.kind <= 159) {
|
|
24078
24154
|
return;
|
|
@@ -24626,17 +24702,25 @@ var ts;
|
|
|
24626
24702
|
children.unshift(n);
|
|
24627
24703
|
}
|
|
24628
24704
|
}
|
|
24629
|
-
function
|
|
24705
|
+
function setExternalModuleIndicator(sourceFile) {
|
|
24706
|
+
sourceFile.externalModuleIndicator = isFileProbablyExternalModule(sourceFile);
|
|
24707
|
+
}
|
|
24708
|
+
function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes, scriptKind) {
|
|
24630
24709
|
if (setParentNodes === void 0) { setParentNodes = false; }
|
|
24631
24710
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("parse", "createSourceFile", { path: fileName }, true);
|
|
24632
24711
|
ts.performance.mark("beforeParse");
|
|
24633
24712
|
var result;
|
|
24634
24713
|
ts.perfLogger.logStartParseSourceFile(fileName);
|
|
24714
|
+
var _a = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions : { languageVersion: languageVersionOrOptions }, languageVersion = _a.languageVersion, overrideSetExternalModuleIndicator = _a.setExternalModuleIndicator, format = _a.impliedNodeFormat;
|
|
24635
24715
|
if (languageVersion === 100) {
|
|
24636
|
-
result = Parser.parseSourceFile(fileName, sourceText, languageVersion, undefined, setParentNodes, 6);
|
|
24716
|
+
result = Parser.parseSourceFile(fileName, sourceText, languageVersion, undefined, setParentNodes, 6, ts.noop);
|
|
24637
24717
|
}
|
|
24638
24718
|
else {
|
|
24639
|
-
|
|
24719
|
+
var setIndicator = format === undefined ? overrideSetExternalModuleIndicator : function (file) {
|
|
24720
|
+
file.impliedNodeFormat = format;
|
|
24721
|
+
return (overrideSetExternalModuleIndicator || setExternalModuleIndicator)(file);
|
|
24722
|
+
};
|
|
24723
|
+
result = Parser.parseSourceFile(fileName, sourceText, languageVersion, undefined, setParentNodes, scriptKind, setIndicator);
|
|
24640
24724
|
}
|
|
24641
24725
|
ts.perfLogger.logStopParseSourceFile();
|
|
24642
24726
|
ts.performance.mark("afterParse");
|
|
@@ -24716,7 +24800,7 @@ var ts;
|
|
|
24716
24800
|
var contextFlags;
|
|
24717
24801
|
var topLevel = true;
|
|
24718
24802
|
var parseErrorBeforeNextFinishedNode = false;
|
|
24719
|
-
function parseSourceFile(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes, scriptKind) {
|
|
24803
|
+
function parseSourceFile(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes, scriptKind, setExternalModuleIndicatorOverride) {
|
|
24720
24804
|
var _a;
|
|
24721
24805
|
if (setParentNodes === void 0) { setParentNodes = false; }
|
|
24722
24806
|
scriptKind = ts.ensureScriptKind(fileName, scriptKind);
|
|
@@ -24732,7 +24816,7 @@ var ts;
|
|
|
24732
24816
|
return result_3;
|
|
24733
24817
|
}
|
|
24734
24818
|
initializeState(fileName, sourceText, languageVersion, syntaxCursor, scriptKind);
|
|
24735
|
-
var result = parseSourceFileWorker(languageVersion, setParentNodes, scriptKind);
|
|
24819
|
+
var result = parseSourceFileWorker(languageVersion, setParentNodes, scriptKind, setExternalModuleIndicatorOverride || setExternalModuleIndicator);
|
|
24736
24820
|
clearState();
|
|
24737
24821
|
return result;
|
|
24738
24822
|
}
|
|
@@ -24808,7 +24892,7 @@ var ts;
|
|
|
24808
24892
|
statements = createNodeArray([statement], pos);
|
|
24809
24893
|
endOfFileToken = parseExpectedToken(1, ts.Diagnostics.Unexpected_token);
|
|
24810
24894
|
}
|
|
24811
|
-
var sourceFile = createSourceFile(fileName, 2, 6, false, statements, endOfFileToken, sourceFlags);
|
|
24895
|
+
var sourceFile = createSourceFile(fileName, 2, 6, false, statements, endOfFileToken, sourceFlags, ts.noop);
|
|
24812
24896
|
if (setParentNodes) {
|
|
24813
24897
|
fixupParentReferences(sourceFile);
|
|
24814
24898
|
}
|
|
@@ -24879,7 +24963,7 @@ var ts;
|
|
|
24879
24963
|
notParenthesizedArrow = undefined;
|
|
24880
24964
|
topLevel = true;
|
|
24881
24965
|
}
|
|
24882
|
-
function parseSourceFileWorker(languageVersion, setParentNodes, scriptKind) {
|
|
24966
|
+
function parseSourceFileWorker(languageVersion, setParentNodes, scriptKind, setExternalModuleIndicator) {
|
|
24883
24967
|
var isDeclarationFile = isDeclarationFileName(fileName);
|
|
24884
24968
|
if (isDeclarationFile) {
|
|
24885
24969
|
contextFlags |= 8388608;
|
|
@@ -24889,7 +24973,7 @@ var ts;
|
|
|
24889
24973
|
var statements = parseList(0, parseStatement);
|
|
24890
24974
|
ts.Debug.assert(token() === 1);
|
|
24891
24975
|
var endOfFileToken = addJSDocComment(parseTokenNode());
|
|
24892
|
-
var sourceFile = createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile, statements, endOfFileToken, sourceFlags);
|
|
24976
|
+
var sourceFile = createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile, statements, endOfFileToken, sourceFlags, setExternalModuleIndicator);
|
|
24893
24977
|
processCommentPragmas(sourceFile, sourceText);
|
|
24894
24978
|
processPragmasIntoFields(sourceFile, reportPragmaDiagnostic);
|
|
24895
24979
|
sourceFile.commentDirectives = scanner.getCommentDirectives();
|
|
@@ -25013,22 +25097,27 @@ var ts;
|
|
|
25013
25097
|
ts.setParentRecursive(rootNode, true);
|
|
25014
25098
|
}
|
|
25015
25099
|
Parser.fixupParentReferences = fixupParentReferences;
|
|
25016
|
-
function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile, statements, endOfFileToken, flags) {
|
|
25100
|
+
function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile, statements, endOfFileToken, flags, setExternalModuleIndicator) {
|
|
25017
25101
|
var sourceFile = factory.createSourceFile(statements, endOfFileToken, flags);
|
|
25018
25102
|
ts.setTextRangePosWidth(sourceFile, 0, sourceText.length);
|
|
25019
|
-
|
|
25103
|
+
setFields(sourceFile);
|
|
25020
25104
|
if (!isDeclarationFile && isExternalModule(sourceFile) && sourceFile.transformFlags & 16777216) {
|
|
25021
25105
|
sourceFile = reparseTopLevelAwait(sourceFile);
|
|
25106
|
+
setFields(sourceFile);
|
|
25022
25107
|
}
|
|
25023
|
-
sourceFile.text = sourceText;
|
|
25024
|
-
sourceFile.bindDiagnostics = [];
|
|
25025
|
-
sourceFile.bindSuggestionDiagnostics = undefined;
|
|
25026
|
-
sourceFile.languageVersion = languageVersion;
|
|
25027
|
-
sourceFile.fileName = fileName;
|
|
25028
|
-
sourceFile.languageVariant = ts.getLanguageVariant(scriptKind);
|
|
25029
|
-
sourceFile.isDeclarationFile = isDeclarationFile;
|
|
25030
|
-
sourceFile.scriptKind = scriptKind;
|
|
25031
25108
|
return sourceFile;
|
|
25109
|
+
function setFields(sourceFile) {
|
|
25110
|
+
sourceFile.text = sourceText;
|
|
25111
|
+
sourceFile.bindDiagnostics = [];
|
|
25112
|
+
sourceFile.bindSuggestionDiagnostics = undefined;
|
|
25113
|
+
sourceFile.languageVersion = languageVersion;
|
|
25114
|
+
sourceFile.fileName = fileName;
|
|
25115
|
+
sourceFile.languageVariant = ts.getLanguageVariant(scriptKind);
|
|
25116
|
+
sourceFile.isDeclarationFile = isDeclarationFile;
|
|
25117
|
+
sourceFile.scriptKind = scriptKind;
|
|
25118
|
+
setExternalModuleIndicator(sourceFile);
|
|
25119
|
+
sourceFile.setExternalModuleIndicator = setExternalModuleIndicator;
|
|
25120
|
+
}
|
|
25032
25121
|
}
|
|
25033
25122
|
function setContextFlag(val, flag) {
|
|
25034
25123
|
if (val) {
|
|
@@ -29473,32 +29562,6 @@ var ts;
|
|
|
29473
29562
|
var node = factory.createExportAssignment(decorators, modifiers, isExportEquals, expression);
|
|
29474
29563
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
29475
29564
|
}
|
|
29476
|
-
function setExternalModuleIndicator(sourceFile) {
|
|
29477
|
-
sourceFile.externalModuleIndicator =
|
|
29478
|
-
ts.forEach(sourceFile.statements, isAnExternalModuleIndicatorNode) ||
|
|
29479
|
-
getImportMetaIfNecessary(sourceFile);
|
|
29480
|
-
}
|
|
29481
|
-
function isAnExternalModuleIndicatorNode(node) {
|
|
29482
|
-
return hasModifierOfKind(node, 93)
|
|
29483
|
-
|| ts.isImportEqualsDeclaration(node) && ts.isExternalModuleReference(node.moduleReference)
|
|
29484
|
-
|| ts.isImportDeclaration(node)
|
|
29485
|
-
|| ts.isExportAssignment(node)
|
|
29486
|
-
|| ts.isExportDeclaration(node) ? node : undefined;
|
|
29487
|
-
}
|
|
29488
|
-
function getImportMetaIfNecessary(sourceFile) {
|
|
29489
|
-
return sourceFile.flags & 2097152 ?
|
|
29490
|
-
walkTreeForExternalModuleIndicators(sourceFile) :
|
|
29491
|
-
undefined;
|
|
29492
|
-
}
|
|
29493
|
-
function walkTreeForExternalModuleIndicators(node) {
|
|
29494
|
-
return isImportMeta(node) ? node : forEachChild(node, walkTreeForExternalModuleIndicators);
|
|
29495
|
-
}
|
|
29496
|
-
function hasModifierOfKind(node, kind) {
|
|
29497
|
-
return ts.some(node.modifiers, function (m) { return m.kind === kind; });
|
|
29498
|
-
}
|
|
29499
|
-
function isImportMeta(node) {
|
|
29500
|
-
return ts.isMetaProperty(node) && node.keywordToken === 100 && node.name.escapedText === "meta";
|
|
29501
|
-
}
|
|
29502
29565
|
var JSDocParser;
|
|
29503
29566
|
(function (JSDocParser) {
|
|
29504
29567
|
function parseJSDocTypeExpressionForTests(content, start, length) {
|
|
@@ -29506,7 +29569,7 @@ var ts;
|
|
|
29506
29569
|
scanner.setText(content, start, length);
|
|
29507
29570
|
currentToken = scanner.scan();
|
|
29508
29571
|
var jsDocTypeExpression = parseJSDocTypeExpression();
|
|
29509
|
-
var sourceFile = createSourceFile("file.js", 99, 1, false, [], factory.createToken(1), 0);
|
|
29572
|
+
var sourceFile = createSourceFile("file.js", 99, 1, false, [], factory.createToken(1), 0, ts.noop);
|
|
29510
29573
|
var diagnostics = ts.attachFileToDiagnostics(parseDiagnostics, sourceFile);
|
|
29511
29574
|
if (jsDocDiagnostics) {
|
|
29512
29575
|
sourceFile.jsDocDiagnostics = ts.attachFileToDiagnostics(jsDocDiagnostics, sourceFile);
|
|
@@ -30402,7 +30465,7 @@ var ts;
|
|
|
30402
30465
|
return sourceFile;
|
|
30403
30466
|
}
|
|
30404
30467
|
if (sourceFile.statements.length === 0) {
|
|
30405
|
-
return Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, undefined, true, sourceFile.scriptKind);
|
|
30468
|
+
return Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, undefined, true, sourceFile.scriptKind, sourceFile.setExternalModuleIndicator);
|
|
30406
30469
|
}
|
|
30407
30470
|
var incrementalSourceFile = sourceFile;
|
|
30408
30471
|
ts.Debug.assert(!incrementalSourceFile.hasBeenIncrementallyParsed);
|
|
@@ -30417,7 +30480,7 @@ var ts;
|
|
|
30417
30480
|
ts.Debug.assert(ts.textSpanEnd(ts.textChangeRangeNewSpan(changeRange)) === ts.textSpanEnd(ts.textChangeRangeNewSpan(textChangeRange)));
|
|
30418
30481
|
var delta = ts.textChangeRangeNewSpan(changeRange).length - changeRange.span.length;
|
|
30419
30482
|
updateTokenPositionsAndMarkElements(incrementalSourceFile, changeRange.span.start, ts.textSpanEnd(changeRange.span), ts.textSpanEnd(ts.textChangeRangeNewSpan(changeRange)), delta, oldText, newText, aggressiveChecks);
|
|
30420
|
-
var result = Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, true, sourceFile.scriptKind);
|
|
30483
|
+
var result = Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, true, sourceFile.scriptKind, sourceFile.setExternalModuleIndicator);
|
|
30421
30484
|
result.commentDirectives = getNewCommentDirectives(sourceFile.commentDirectives, result.commentDirectives, changeRange.span.start, ts.textSpanEnd(changeRange.span), delta, oldText, newText, aggressiveChecks);
|
|
30422
30485
|
result.impliedNodeFormat = sourceFile.impliedNodeFormat;
|
|
30423
30486
|
return result;
|
|
@@ -32129,6 +32192,18 @@ var ts;
|
|
|
32129
32192
|
description: ts.Diagnostics.Specify_a_list_of_language_service_plugins_to_include,
|
|
32130
32193
|
category: ts.Diagnostics.Editor_Support,
|
|
32131
32194
|
},
|
|
32195
|
+
{
|
|
32196
|
+
name: "moduleDetection",
|
|
32197
|
+
type: new ts.Map(ts.getEntries({
|
|
32198
|
+
auto: ts.ModuleDetectionKind.Auto,
|
|
32199
|
+
legacy: ts.ModuleDetectionKind.Legacy,
|
|
32200
|
+
force: ts.ModuleDetectionKind.Force,
|
|
32201
|
+
})),
|
|
32202
|
+
affectsModuleResolution: true,
|
|
32203
|
+
description: ts.Diagnostics.Control_what_method_is_used_to_detect_module_format_JS_files,
|
|
32204
|
+
category: ts.Diagnostics.Language_and_Environment,
|
|
32205
|
+
defaultValueDescription: ts.Diagnostics.auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node12_as_modules,
|
|
32206
|
+
}
|
|
32132
32207
|
];
|
|
32133
32208
|
ts.optionDeclarations = __spreadArray(__spreadArray([], ts.commonOptionsWithBuild, true), commandOptionsWithoutBuild, true);
|
|
32134
32209
|
ts.semanticDiagnosticsOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsSemanticDiagnostics; });
|
|
@@ -52874,7 +52949,7 @@ var ts;
|
|
|
52874
52949
|
return true;
|
|
52875
52950
|
}
|
|
52876
52951
|
}
|
|
52877
|
-
else {
|
|
52952
|
+
else if (!((source.flags | target.flags) & (3145728 | 8388608 | 16777216 | 33554432))) {
|
|
52878
52953
|
if (source.flags !== target.flags)
|
|
52879
52954
|
return false;
|
|
52880
52955
|
if (source.flags & 67358815)
|
|
@@ -58120,7 +58195,7 @@ var ts;
|
|
|
58120
58195
|
return result;
|
|
58121
58196
|
}
|
|
58122
58197
|
function getCandidateDiscriminantPropertyAccess(expr) {
|
|
58123
|
-
if (ts.isBindingPattern(reference) || ts.isFunctionExpressionOrArrowFunction(reference)) {
|
|
58198
|
+
if (ts.isBindingPattern(reference) || ts.isFunctionExpressionOrArrowFunction(reference) || ts.isObjectLiteralMethod(reference)) {
|
|
58124
58199
|
if (ts.isIdentifier(expr)) {
|
|
58125
58200
|
var symbol = getResolvedSymbol(expr);
|
|
58126
58201
|
var declaration = symbol.valueDeclaration;
|
|
@@ -64044,6 +64119,9 @@ var ts;
|
|
|
64044
64119
|
assignBindingElementTypes(declaration.name, links.type);
|
|
64045
64120
|
}
|
|
64046
64121
|
}
|
|
64122
|
+
else if (type) {
|
|
64123
|
+
ts.Debug.assertEqual(links.type, type, "Parameter symbol already has a cached type which differs from newly assigned type");
|
|
64124
|
+
}
|
|
64047
64125
|
}
|
|
64048
64126
|
function assignBindingElementTypes(pattern, parentType) {
|
|
64049
64127
|
for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) {
|
|
@@ -94284,7 +94362,7 @@ var ts;
|
|
|
94284
94362
|
var existingDirectories = new ts.Map();
|
|
94285
94363
|
var getCanonicalFileName = ts.createGetCanonicalFileName(system.useCaseSensitiveFileNames);
|
|
94286
94364
|
var computeHash = ts.maybeBind(system, system.createHash) || ts.generateDjb2Hash;
|
|
94287
|
-
function getSourceFile(fileName,
|
|
94365
|
+
function getSourceFile(fileName, languageVersionOrOptions, onError) {
|
|
94288
94366
|
var text;
|
|
94289
94367
|
try {
|
|
94290
94368
|
ts.performance.mark("beforeIORead");
|
|
@@ -94298,7 +94376,7 @@ var ts;
|
|
|
94298
94376
|
}
|
|
94299
94377
|
text = "";
|
|
94300
94378
|
}
|
|
94301
|
-
return text !== undefined ? ts.createSourceFile(fileName, text,
|
|
94379
|
+
return text !== undefined ? ts.createSourceFile(fileName, text, languageVersionOrOptions, setParentNodes) : undefined;
|
|
94302
94380
|
}
|
|
94303
94381
|
function directoryExists(directoryPath) {
|
|
94304
94382
|
if (existingDirectories.has(directoryPath)) {
|
|
@@ -95519,8 +95597,8 @@ var ts;
|
|
|
95519
95597
|
for (var _i = 0, oldSourceFiles_2 = oldSourceFiles; _i < oldSourceFiles_2.length; _i++) {
|
|
95520
95598
|
var oldSourceFile = oldSourceFiles_2[_i];
|
|
95521
95599
|
var newSourceFile = host.getSourceFileByPath
|
|
95522
|
-
? host.getSourceFileByPath(oldSourceFile.fileName, oldSourceFile.resolvedPath,
|
|
95523
|
-
: host.getSourceFile(oldSourceFile.fileName,
|
|
95600
|
+
? host.getSourceFileByPath(oldSourceFile.fileName, oldSourceFile.resolvedPath, getCreateSourceFileOptions(oldSourceFile.fileName, moduleResolutionCache, host, options), undefined, shouldCreateNewSourceFile)
|
|
95601
|
+
: host.getSourceFile(oldSourceFile.fileName, getCreateSourceFileOptions(oldSourceFile.fileName, moduleResolutionCache, host, options), undefined, shouldCreateNewSourceFile);
|
|
95524
95602
|
if (!newSourceFile) {
|
|
95525
95603
|
return 0;
|
|
95526
95604
|
}
|
|
@@ -95546,7 +95624,6 @@ var ts;
|
|
|
95546
95624
|
newSourceFile.originalFileName = oldSourceFile.originalFileName;
|
|
95547
95625
|
newSourceFile.resolvedPath = oldSourceFile.resolvedPath;
|
|
95548
95626
|
newSourceFile.fileName = oldSourceFile.fileName;
|
|
95549
|
-
newSourceFile.impliedNodeFormat = oldSourceFile.impliedNodeFormat;
|
|
95550
95627
|
var packageName = oldProgram.sourceFileToPackageName.get(oldSourceFile.path);
|
|
95551
95628
|
if (packageName !== undefined) {
|
|
95552
95629
|
var prevKind = seenPackageNames.get(packageName);
|
|
@@ -96353,6 +96430,14 @@ var ts;
|
|
|
96353
96430
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
96354
96431
|
return result;
|
|
96355
96432
|
}
|
|
96433
|
+
function getCreateSourceFileOptions(fileName, moduleResolutionCache, host, options) {
|
|
96434
|
+
var impliedNodeFormat = getImpliedNodeFormatForFile(toPath(fileName), moduleResolutionCache === null || moduleResolutionCache === void 0 ? void 0 : moduleResolutionCache.getPackageJsonInfoCache(), host, options);
|
|
96435
|
+
return {
|
|
96436
|
+
languageVersion: ts.getEmitScriptTarget(options),
|
|
96437
|
+
impliedNodeFormat: impliedNodeFormat,
|
|
96438
|
+
setExternalModuleIndicator: ts.getSetExternalModuleIndicator(options)
|
|
96439
|
+
};
|
|
96440
|
+
}
|
|
96356
96441
|
function findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId) {
|
|
96357
96442
|
var path = toPath(fileName);
|
|
96358
96443
|
if (useSourceOfProjectReferenceRedirect) {
|
|
@@ -96423,7 +96508,7 @@ var ts;
|
|
|
96423
96508
|
redirectedPath = toPath(redirect);
|
|
96424
96509
|
}
|
|
96425
96510
|
}
|
|
96426
|
-
var file = host.getSourceFile(fileName,
|
|
96511
|
+
var file = host.getSourceFile(fileName, getCreateSourceFileOptions(fileName, moduleResolutionCache, host, options), function (hostErrorMessage) { return addFilePreprocessingFileExplainingDiagnostic(undefined, reason, ts.Diagnostics.Cannot_read_file_0_Colon_1, [fileName, hostErrorMessage]); }, shouldCreateNewSourceFile);
|
|
96427
96512
|
if (packageId) {
|
|
96428
96513
|
var packageIdKey = ts.packageIdToString(packageId);
|
|
96429
96514
|
var fileFromPackageId = packageIdToSourceFile.get(packageIdKey);
|
|
@@ -96448,7 +96533,6 @@ var ts;
|
|
|
96448
96533
|
file.path = path;
|
|
96449
96534
|
file.resolvedPath = toPath(fileName);
|
|
96450
96535
|
file.originalFileName = originalFileName;
|
|
96451
|
-
file.impliedNodeFormat = getImpliedNodeFormatForFile(file.resolvedPath, moduleResolutionCache === null || moduleResolutionCache === void 0 ? void 0 : moduleResolutionCache.getPackageJsonInfoCache(), host, options);
|
|
96452
96536
|
addFileIncludeReason(file, reason);
|
|
96453
96537
|
if (host.useCaseSensitiveFileNames()) {
|
|
96454
96538
|
var pathLowerCase = ts.toFileNameLowerCase(path);
|
|
@@ -96909,7 +96993,7 @@ var ts;
|
|
|
96909
96993
|
}
|
|
96910
96994
|
}
|
|
96911
96995
|
else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 && options.module === ts.ModuleKind.None) {
|
|
96912
|
-
var span = ts.getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, firstNonAmbientExternalModuleSourceFile.externalModuleIndicator);
|
|
96996
|
+
var span = ts.getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, typeof firstNonAmbientExternalModuleSourceFile.externalModuleIndicator === "boolean" ? firstNonAmbientExternalModuleSourceFile : firstNonAmbientExternalModuleSourceFile.externalModuleIndicator);
|
|
96913
96997
|
programDiagnostics.add(ts.createFileDiagnostic(firstNonAmbientExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_use_imports_exports_or_module_augmentations_when_module_is_none));
|
|
96914
96998
|
}
|
|
96915
96999
|
if (outputFile && !options.emitDeclarationOnly) {
|
|
@@ -96917,7 +97001,7 @@ var ts;
|
|
|
96917
97001
|
createDiagnosticForOptionName(ts.Diagnostics.Only_amd_and_system_modules_are_supported_alongside_0, options.out ? "out" : "outFile", "module");
|
|
96918
97002
|
}
|
|
96919
97003
|
else if (options.module === undefined && firstNonAmbientExternalModuleSourceFile) {
|
|
96920
|
-
var span = ts.getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, firstNonAmbientExternalModuleSourceFile.externalModuleIndicator);
|
|
97004
|
+
var span = ts.getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, typeof firstNonAmbientExternalModuleSourceFile.externalModuleIndicator === "boolean" ? firstNonAmbientExternalModuleSourceFile : firstNonAmbientExternalModuleSourceFile.externalModuleIndicator);
|
|
96921
97005
|
programDiagnostics.add(ts.createFileDiagnostic(firstNonAmbientExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system, options.out ? "out" : "outFile"));
|
|
96922
97006
|
}
|
|
96923
97007
|
}
|
|
@@ -100581,7 +100665,7 @@ var ts;
|
|
|
100581
100665
|
var useCaseSensitiveFileNames = host.useCaseSensitiveFileNames();
|
|
100582
100666
|
var hostGetNewLine = ts.memoize(function () { return host.getNewLine(); });
|
|
100583
100667
|
return {
|
|
100584
|
-
getSourceFile: function (fileName,
|
|
100668
|
+
getSourceFile: function (fileName, languageVersionOrOptions, onError) {
|
|
100585
100669
|
var text;
|
|
100586
100670
|
try {
|
|
100587
100671
|
ts.performance.mark("beforeIORead");
|
|
@@ -100595,7 +100679,7 @@ var ts;
|
|
|
100595
100679
|
}
|
|
100596
100680
|
text = "";
|
|
100597
100681
|
}
|
|
100598
|
-
return text !== undefined ? ts.createSourceFile(fileName, text,
|
|
100682
|
+
return text !== undefined ? ts.createSourceFile(fileName, text, languageVersionOrOptions) : undefined;
|
|
100599
100683
|
},
|
|
100600
100684
|
getDefaultLibLocation: ts.maybeBind(host, host.getDefaultLibLocation),
|
|
100601
100685
|
getDefaultLibFileName: function (options) { return host.getDefaultLibFileName(options); },
|
|
@@ -101026,13 +101110,13 @@ var ts;
|
|
|
101026
101110
|
}
|
|
101027
101111
|
return directoryStructureHost.fileExists(fileName);
|
|
101028
101112
|
}
|
|
101029
|
-
function getVersionedSourceFileByPath(fileName, path,
|
|
101113
|
+
function getVersionedSourceFileByPath(fileName, path, languageVersionOrOptions, onError, shouldCreateNewSourceFile) {
|
|
101030
101114
|
var hostSourceFile = sourceFilesCache.get(path);
|
|
101031
101115
|
if (isFileMissingOnHost(hostSourceFile)) {
|
|
101032
101116
|
return undefined;
|
|
101033
101117
|
}
|
|
101034
101118
|
if (hostSourceFile === undefined || shouldCreateNewSourceFile || isFilePresenceUnknownOnHost(hostSourceFile)) {
|
|
101035
|
-
var sourceFile = getNewSourceFile(fileName,
|
|
101119
|
+
var sourceFile = getNewSourceFile(fileName, languageVersionOrOptions, onError);
|
|
101036
101120
|
if (hostSourceFile) {
|
|
101037
101121
|
if (sourceFile) {
|
|
101038
101122
|
hostSourceFile.sourceFile = sourceFile;
|