@typescript-deploys/pr-build 5.6.0-pr-58760-2 → 5.6.0-pr-58668-2
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 +433 -284
- package/lib/typescript.d.ts +12 -10
- package/lib/typescript.js +555 -334
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.6";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20240607`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -7873,7 +7873,8 @@ var Diagnostics = {
|
|
|
7873
7873
|
Its_type_0_is_not_a_valid_JSX_element_type: diag(18053, 1 /* Error */, "Its_type_0_is_not_a_valid_JSX_element_type_18053", "Its type '{0}' is not a valid JSX element type."),
|
|
7874
7874
|
await_using_statements_cannot_be_used_inside_a_class_static_block: diag(18054, 1 /* Error */, "await_using_statements_cannot_be_used_inside_a_class_static_block_18054", "'await using' statements cannot be used inside a class static block."),
|
|
7875
7875
|
_0_has_a_string_type_but_must_have_syntactically_recognizable_string_syntax_when_isolatedModules_is_enabled: diag(18055, 1 /* Error */, "_0_has_a_string_type_but_must_have_syntactically_recognizable_string_syntax_when_isolatedModules_is__18055", "'{0}' has a string type, but must have syntactically recognizable string syntax when 'isolatedModules' is enabled."),
|
|
7876
|
-
Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is_enabled: diag(18056, 1 /* Error */, "Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is__18056", "Enum member following a non-literal numeric member must have an initializer when 'isolatedModules' is enabled.")
|
|
7876
|
+
Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is_enabled: diag(18056, 1 /* Error */, "Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is__18056", "Enum member following a non-literal numeric member must have an initializer when 'isolatedModules' is enabled."),
|
|
7877
|
+
String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es2020: diag(18057, 1 /* Error */, "String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es_18057", "String literal import and export names are not supported when the '--module' flag is set to 'es2015' or 'es2020'.")
|
|
7877
7878
|
};
|
|
7878
7879
|
|
|
7879
7880
|
// src/compiler/scanner.ts
|
|
@@ -8033,16 +8034,16 @@ var textToToken = new Map(Object.entries({
|
|
|
8033
8034
|
"#": 63 /* HashToken */,
|
|
8034
8035
|
"`": 62 /* BacktickToken */
|
|
8035
8036
|
}));
|
|
8036
|
-
var
|
|
8037
|
-
d
|
|
8038
|
-
g
|
|
8039
|
-
i
|
|
8040
|
-
m
|
|
8041
|
-
s
|
|
8042
|
-
u
|
|
8043
|
-
v
|
|
8044
|
-
y
|
|
8045
|
-
|
|
8037
|
+
var charCodeToRegExpFlag = /* @__PURE__ */ new Map([
|
|
8038
|
+
[100 /* d */, 1 /* HasIndices */],
|
|
8039
|
+
[103 /* g */, 2 /* Global */],
|
|
8040
|
+
[105 /* i */, 4 /* IgnoreCase */],
|
|
8041
|
+
[109 /* m */, 8 /* Multiline */],
|
|
8042
|
+
[115 /* s */, 16 /* DotAll */],
|
|
8043
|
+
[117 /* u */, 32 /* Unicode */],
|
|
8044
|
+
[118 /* v */, 64 /* UnicodeSets */],
|
|
8045
|
+
[121 /* y */, 128 /* Sticky */]
|
|
8046
|
+
]);
|
|
8046
8047
|
var regExpFlagToFirstAvailableLanguageVersion = /* @__PURE__ */ new Map([
|
|
8047
8048
|
[1 /* HasIndices */, 9 /* RegularExpressionFlagsHasIndices */],
|
|
8048
8049
|
[16 /* DotAll */, 5 /* RegularExpressionFlagsDotAll */],
|
|
@@ -8098,9 +8099,9 @@ function tokenToString(t) {
|
|
|
8098
8099
|
function stringToToken(s) {
|
|
8099
8100
|
return textToToken.get(s);
|
|
8100
8101
|
}
|
|
8101
|
-
var
|
|
8102
|
-
function
|
|
8103
|
-
return
|
|
8102
|
+
var regExpFlagCharCodes = makeReverseMap(charCodeToRegExpFlag);
|
|
8103
|
+
function characterCodeToRegularExpressionFlag(ch) {
|
|
8104
|
+
return charCodeToRegExpFlag.get(ch);
|
|
8104
8105
|
}
|
|
8105
8106
|
function computeLineStarts(text) {
|
|
8106
8107
|
const result = [];
|
|
@@ -9795,24 +9796,25 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9795
9796
|
pos++;
|
|
9796
9797
|
let regExpFlags = 0 /* None */;
|
|
9797
9798
|
while (true) {
|
|
9798
|
-
const ch =
|
|
9799
|
+
const ch = codePointChecked(pos);
|
|
9799
9800
|
if (ch === -1 /* EOF */ || !isIdentifierPart(ch, languageVersion)) {
|
|
9800
9801
|
break;
|
|
9801
9802
|
}
|
|
9803
|
+
const size = charSize(ch);
|
|
9802
9804
|
if (reportErrors2) {
|
|
9803
|
-
const flag =
|
|
9805
|
+
const flag = characterCodeToRegularExpressionFlag(ch);
|
|
9804
9806
|
if (flag === void 0) {
|
|
9805
|
-
error(Diagnostics.Unknown_regular_expression_flag, pos,
|
|
9807
|
+
error(Diagnostics.Unknown_regular_expression_flag, pos, size);
|
|
9806
9808
|
} else if (regExpFlags & flag) {
|
|
9807
|
-
error(Diagnostics.Duplicate_regular_expression_flag, pos,
|
|
9809
|
+
error(Diagnostics.Duplicate_regular_expression_flag, pos, size);
|
|
9808
9810
|
} else if (((regExpFlags | flag) & 96 /* AnyUnicodeMode */) === 96 /* AnyUnicodeMode */) {
|
|
9809
|
-
error(Diagnostics.The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously, pos,
|
|
9811
|
+
error(Diagnostics.The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously, pos, size);
|
|
9810
9812
|
} else {
|
|
9811
9813
|
regExpFlags |= flag;
|
|
9812
|
-
|
|
9814
|
+
checkRegularExpressionFlagAvailability(flag, size);
|
|
9813
9815
|
}
|
|
9814
9816
|
}
|
|
9815
|
-
pos
|
|
9817
|
+
pos += size;
|
|
9816
9818
|
}
|
|
9817
9819
|
if (reportErrors2) {
|
|
9818
9820
|
scanRange(startOfRegExpBody, endOfRegExpBody - startOfRegExpBody, () => {
|
|
@@ -10027,22 +10029,23 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
10027
10029
|
}
|
|
10028
10030
|
function scanPatternModifiers(currFlags) {
|
|
10029
10031
|
while (true) {
|
|
10030
|
-
const ch =
|
|
10032
|
+
const ch = codePointChecked(pos);
|
|
10031
10033
|
if (ch === -1 /* EOF */ || !isIdentifierPart(ch, languageVersion)) {
|
|
10032
10034
|
break;
|
|
10033
10035
|
}
|
|
10034
|
-
const
|
|
10036
|
+
const size = charSize(ch);
|
|
10037
|
+
const flag = characterCodeToRegularExpressionFlag(ch);
|
|
10035
10038
|
if (flag === void 0) {
|
|
10036
|
-
error(Diagnostics.Unknown_regular_expression_flag, pos,
|
|
10039
|
+
error(Diagnostics.Unknown_regular_expression_flag, pos, size);
|
|
10037
10040
|
} else if (currFlags & flag) {
|
|
10038
|
-
error(Diagnostics.Duplicate_regular_expression_flag, pos,
|
|
10041
|
+
error(Diagnostics.Duplicate_regular_expression_flag, pos, size);
|
|
10039
10042
|
} else if (!(flag & 28 /* Modifiers */)) {
|
|
10040
|
-
error(Diagnostics.This_regular_expression_flag_cannot_be_toggled_within_a_subpattern, pos,
|
|
10043
|
+
error(Diagnostics.This_regular_expression_flag_cannot_be_toggled_within_a_subpattern, pos, size);
|
|
10041
10044
|
} else {
|
|
10042
10045
|
currFlags |= flag;
|
|
10043
|
-
|
|
10046
|
+
checkRegularExpressionFlagAvailability(flag, size);
|
|
10044
10047
|
}
|
|
10045
|
-
pos
|
|
10048
|
+
pos += size;
|
|
10046
10049
|
}
|
|
10047
10050
|
return currFlags;
|
|
10048
10051
|
}
|
|
@@ -10646,6 +10649,12 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
10646
10649
|
forEach(groupNameReferences, (reference) => {
|
|
10647
10650
|
if (!(groupSpecifiers == null ? void 0 : groupSpecifiers.has(reference.name))) {
|
|
10648
10651
|
error(Diagnostics.There_is_no_capturing_group_named_0_in_this_regular_expression, reference.pos, reference.end - reference.pos, reference.name);
|
|
10652
|
+
if (groupSpecifiers) {
|
|
10653
|
+
const suggestion = getSpellingSuggestion(reference.name, groupSpecifiers, identity);
|
|
10654
|
+
if (suggestion) {
|
|
10655
|
+
error(Diagnostics.Did_you_mean_0, reference.pos, reference.end - reference.pos, suggestion);
|
|
10656
|
+
}
|
|
10657
|
+
}
|
|
10649
10658
|
}
|
|
10650
10659
|
});
|
|
10651
10660
|
forEach(decimalEscapes, (escape) => {
|
|
@@ -10658,10 +10667,10 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
10658
10667
|
}
|
|
10659
10668
|
});
|
|
10660
10669
|
}
|
|
10661
|
-
function
|
|
10670
|
+
function checkRegularExpressionFlagAvailability(flag, size) {
|
|
10662
10671
|
const availableFrom = regExpFlagToFirstAvailableLanguageVersion.get(flag);
|
|
10663
10672
|
if (availableFrom && languageVersion < availableFrom) {
|
|
10664
|
-
error(Diagnostics.This_regular_expression_flag_is_only_available_when_targeting_0_or_later,
|
|
10673
|
+
error(Diagnostics.This_regular_expression_flag_is_only_available_when_targeting_0_or_later, pos, size, getNameOfScriptTarget(availableFrom));
|
|
10665
10674
|
}
|
|
10666
10675
|
}
|
|
10667
10676
|
function appendIfCommentDirective(commentDirectives2, text2, commentDirectiveRegEx, lineStart) {
|
|
@@ -12777,7 +12786,16 @@ function isJSDocTypeExpressionOrChild(node) {
|
|
|
12777
12786
|
return !!findAncestor(node, isJSDocTypeExpression);
|
|
12778
12787
|
}
|
|
12779
12788
|
function isExportNamespaceAsDefaultDeclaration(node) {
|
|
12780
|
-
return !!(isExportDeclaration(node) && node.exportClause && isNamespaceExport(node.exportClause) && node.exportClause.name
|
|
12789
|
+
return !!(isExportDeclaration(node) && node.exportClause && isNamespaceExport(node.exportClause) && moduleExportNameIsDefault(node.exportClause.name));
|
|
12790
|
+
}
|
|
12791
|
+
function moduleExportNameTextUnescaped(node) {
|
|
12792
|
+
return node.kind === 11 /* StringLiteral */ ? node.text : unescapeLeadingUnderscores(node.escapedText);
|
|
12793
|
+
}
|
|
12794
|
+
function moduleExportNameTextEscaped(node) {
|
|
12795
|
+
return node.kind === 11 /* StringLiteral */ ? escapeLeadingUnderscores(node.text) : node.escapedText;
|
|
12796
|
+
}
|
|
12797
|
+
function moduleExportNameIsDefault(node) {
|
|
12798
|
+
return (node.kind === 11 /* StringLiteral */ ? node.text : node.escapedText) === "default" /* Default */;
|
|
12781
12799
|
}
|
|
12782
12800
|
function getTextOfNodeFromSourceText(sourceText, node, includeTrivia = false) {
|
|
12783
12801
|
if (nodeIsMissing(node)) {
|
|
@@ -19329,12 +19347,6 @@ function unwrapParenthesizedExpression(o) {
|
|
|
19329
19347
|
}
|
|
19330
19348
|
return o;
|
|
19331
19349
|
}
|
|
19332
|
-
function unwrapParenthesizedType(o) {
|
|
19333
|
-
while (o.kind === 196 /* ParenthesizedType */) {
|
|
19334
|
-
o = o.type;
|
|
19335
|
-
}
|
|
19336
|
-
return o;
|
|
19337
|
-
}
|
|
19338
19350
|
function hasInferredType(node) {
|
|
19339
19351
|
Debug.type(node);
|
|
19340
19352
|
switch (node.kind) {
|
|
@@ -26051,6 +26063,9 @@ function isNamedExports(node) {
|
|
|
26051
26063
|
function isExportSpecifier(node) {
|
|
26052
26064
|
return node.kind === 281 /* ExportSpecifier */;
|
|
26053
26065
|
}
|
|
26066
|
+
function isModuleExportName(node) {
|
|
26067
|
+
return node.kind === 80 /* Identifier */ || node.kind === 11 /* StringLiteral */;
|
|
26068
|
+
}
|
|
26054
26069
|
function isNotEmittedStatement(node) {
|
|
26055
26070
|
return node.kind === 353 /* NotEmittedStatement */;
|
|
26056
26071
|
}
|
|
@@ -26749,6 +26764,9 @@ function getLocalNameForExternalImport(factory2, node, sourceFile) {
|
|
|
26749
26764
|
const namespaceDeclaration = getNamespaceDeclarationNode(node);
|
|
26750
26765
|
if (namespaceDeclaration && !isDefaultImport(node) && !isExportNamespaceAsDefaultDeclaration(node)) {
|
|
26751
26766
|
const name = namespaceDeclaration.name;
|
|
26767
|
+
if (name.kind === 11 /* StringLiteral */) {
|
|
26768
|
+
return factory2.getGeneratedNameForNode(node);
|
|
26769
|
+
}
|
|
26752
26770
|
return isGeneratedIdentifier(name) ? name : factory2.createIdentifier(getSourceTextOfNodeFromSourceFile(sourceFile, name) || idText(name));
|
|
26753
26771
|
}
|
|
26754
26772
|
if (node.kind === 272 /* ImportDeclaration */ && node.importClause) {
|
|
@@ -29084,6 +29102,9 @@ var Parser;
|
|
|
29084
29102
|
if (token() === 161 /* FromKeyword */ && lookAhead(nextTokenIsStringLiteral)) {
|
|
29085
29103
|
return false;
|
|
29086
29104
|
}
|
|
29105
|
+
if (token() === 11 /* StringLiteral */) {
|
|
29106
|
+
return true;
|
|
29107
|
+
}
|
|
29087
29108
|
return tokenIsIdentifierOrKeyword(token());
|
|
29088
29109
|
case 13 /* JsxAttributes */:
|
|
29089
29110
|
return tokenIsIdentifierOrKeyword(token()) || token() === 19 /* OpenBraceToken */;
|
|
@@ -33532,6 +33553,12 @@ var Parser;
|
|
|
33532
33553
|
const name = parseIdentifier();
|
|
33533
33554
|
return finishNode(factory2.createNamespaceImport(name), pos);
|
|
33534
33555
|
}
|
|
33556
|
+
function canParseModuleExportName() {
|
|
33557
|
+
return tokenIsIdentifierOrKeyword(token()) || token() === 11 /* StringLiteral */;
|
|
33558
|
+
}
|
|
33559
|
+
function parseModuleExportName(parseName) {
|
|
33560
|
+
return token() === 11 /* StringLiteral */ ? parseLiteralNode() : parseName();
|
|
33561
|
+
}
|
|
33535
33562
|
function parseNamedImportsOrExports(kind) {
|
|
33536
33563
|
const pos = getNodePos();
|
|
33537
33564
|
const node = kind === 275 /* NamedImports */ ? factory2.createNamedImports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseImportSpecifier, 19 /* OpenBraceToken */, 20 /* CloseBraceToken */)) : factory2.createNamedExports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseExportSpecifier, 19 /* OpenBraceToken */, 20 /* CloseBraceToken */));
|
|
@@ -33552,42 +33579,51 @@ var Parser;
|
|
|
33552
33579
|
let isTypeOnly = false;
|
|
33553
33580
|
let propertyName;
|
|
33554
33581
|
let canParseAsKeyword = true;
|
|
33555
|
-
let name = parseIdentifierName
|
|
33556
|
-
if (name.escapedText === "type") {
|
|
33582
|
+
let name = parseModuleExportName(parseIdentifierName);
|
|
33583
|
+
if (name.kind === 80 /* Identifier */ && name.escapedText === "type") {
|
|
33557
33584
|
if (token() === 130 /* AsKeyword */) {
|
|
33558
33585
|
const firstAs = parseIdentifierName();
|
|
33559
33586
|
if (token() === 130 /* AsKeyword */) {
|
|
33560
33587
|
const secondAs = parseIdentifierName();
|
|
33561
|
-
if (
|
|
33588
|
+
if (canParseModuleExportName()) {
|
|
33562
33589
|
isTypeOnly = true;
|
|
33563
33590
|
propertyName = firstAs;
|
|
33564
|
-
name = parseNameWithKeywordCheck
|
|
33591
|
+
name = parseModuleExportName(parseNameWithKeywordCheck);
|
|
33565
33592
|
canParseAsKeyword = false;
|
|
33566
33593
|
} else {
|
|
33567
33594
|
propertyName = name;
|
|
33568
33595
|
name = secondAs;
|
|
33569
33596
|
canParseAsKeyword = false;
|
|
33570
33597
|
}
|
|
33571
|
-
} else if (
|
|
33598
|
+
} else if (canParseModuleExportName()) {
|
|
33572
33599
|
propertyName = name;
|
|
33573
33600
|
canParseAsKeyword = false;
|
|
33574
|
-
name = parseNameWithKeywordCheck
|
|
33601
|
+
name = parseModuleExportName(parseNameWithKeywordCheck);
|
|
33575
33602
|
} else {
|
|
33576
33603
|
isTypeOnly = true;
|
|
33577
33604
|
name = firstAs;
|
|
33578
33605
|
}
|
|
33579
|
-
} else if (
|
|
33606
|
+
} else if (canParseModuleExportName()) {
|
|
33580
33607
|
isTypeOnly = true;
|
|
33581
|
-
name = parseNameWithKeywordCheck
|
|
33608
|
+
name = parseModuleExportName(parseNameWithKeywordCheck);
|
|
33582
33609
|
}
|
|
33583
33610
|
}
|
|
33584
33611
|
if (canParseAsKeyword && token() === 130 /* AsKeyword */) {
|
|
33585
33612
|
propertyName = name;
|
|
33586
33613
|
parseExpected(130 /* AsKeyword */);
|
|
33587
|
-
name = parseNameWithKeywordCheck
|
|
33614
|
+
name = parseModuleExportName(parseNameWithKeywordCheck);
|
|
33588
33615
|
}
|
|
33589
|
-
if (kind === 276 /* ImportSpecifier */
|
|
33590
|
-
|
|
33616
|
+
if (kind === 276 /* ImportSpecifier */) {
|
|
33617
|
+
if (name.kind !== 80 /* Identifier */) {
|
|
33618
|
+
parseErrorAt(skipTrivia(sourceText, name.pos), name.end, Diagnostics.Identifier_expected);
|
|
33619
|
+
name = setTextRangePosEnd(createMissingNode(
|
|
33620
|
+
80 /* Identifier */,
|
|
33621
|
+
/*reportAtCurrentPosition*/
|
|
33622
|
+
false
|
|
33623
|
+
), name.pos, name.pos);
|
|
33624
|
+
} else if (checkIdentifierIsKeyword) {
|
|
33625
|
+
parseErrorAt(checkIdentifierStart, checkIdentifierEnd, Diagnostics.Identifier_expected);
|
|
33626
|
+
}
|
|
33591
33627
|
}
|
|
33592
33628
|
const node = kind === 276 /* ImportSpecifier */ ? factory2.createImportSpecifier(isTypeOnly, propertyName, name) : factory2.createExportSpecifier(isTypeOnly, propertyName, name);
|
|
33593
33629
|
return finishNode(node, pos);
|
|
@@ -33599,7 +33635,7 @@ var Parser;
|
|
|
33599
33635
|
}
|
|
33600
33636
|
}
|
|
33601
33637
|
function parseNamespaceExport(pos) {
|
|
33602
|
-
return finishNode(factory2.createNamespaceExport(parseIdentifierName
|
|
33638
|
+
return finishNode(factory2.createNamespaceExport(parseModuleExportName(parseIdentifierName)), pos);
|
|
33603
33639
|
}
|
|
33604
33640
|
function parseExportDeclaration(pos, hasJSDoc, modifiers) {
|
|
33605
33641
|
const savedAwaitContext = inAwaitContext();
|
|
@@ -41123,6 +41159,9 @@ function getModuleInstanceStateWorker(node, visited) {
|
|
|
41123
41159
|
}
|
|
41124
41160
|
function getModuleInstanceStateForAliasTarget(specifier, visited) {
|
|
41125
41161
|
const name = specifier.propertyName || specifier.name;
|
|
41162
|
+
if (name.kind !== 80 /* Identifier */) {
|
|
41163
|
+
return 1 /* Instantiated */;
|
|
41164
|
+
}
|
|
41126
41165
|
let p = specifier.parent;
|
|
41127
41166
|
while (p) {
|
|
41128
41167
|
if (isBlock(p) || isModuleBlock(p) || isSourceFile(p)) {
|
|
@@ -41367,7 +41406,7 @@ function createBinder() {
|
|
|
41367
41406
|
}
|
|
41368
41407
|
function declareSymbol(symbolTable, parent2, node, includes, excludes, isReplaceableByMethod, isComputedName) {
|
|
41369
41408
|
Debug.assert(isComputedName || !hasDynamicName(node));
|
|
41370
|
-
const isDefaultExport = hasSyntacticModifier(node, 2048 /* Default */) || isExportSpecifier(node) && node.name
|
|
41409
|
+
const isDefaultExport = hasSyntacticModifier(node, 2048 /* Default */) || isExportSpecifier(node) && moduleExportNameIsDefault(node.name);
|
|
41371
41410
|
const name = isComputedName ? "__computed" /* Computed */ : isDefaultExport && parent2 ? "default" /* Default */ : getDeclarationName(node);
|
|
41372
41411
|
let symbol;
|
|
41373
41412
|
if (name === void 0) {
|
|
@@ -45155,7 +45194,8 @@ function createTypeChecker(host) {
|
|
|
45155
45194
|
isUndefinedIdentifierExpression(node) {
|
|
45156
45195
|
Debug.assert(isExpressionNode(node));
|
|
45157
45196
|
return getSymbolAtLocation(node) === undefinedSymbol;
|
|
45158
|
-
}
|
|
45197
|
+
},
|
|
45198
|
+
isDefinitelyReferenceToGlobalSymbolObject
|
|
45159
45199
|
});
|
|
45160
45200
|
var evaluate = createEvaluator({
|
|
45161
45201
|
evaluateElementAccessExpression,
|
|
@@ -46112,6 +46152,21 @@ function createTypeChecker(host) {
|
|
|
46112
46152
|
];
|
|
46113
46153
|
initializeTypeChecker();
|
|
46114
46154
|
return checker;
|
|
46155
|
+
function isDefinitelyReferenceToGlobalSymbolObject(node) {
|
|
46156
|
+
if (!isPropertyAccessExpression(node)) return false;
|
|
46157
|
+
if (!isIdentifier(node.name)) return false;
|
|
46158
|
+
if (!isPropertyAccessExpression(node.expression) && !isIdentifier(node.expression)) return false;
|
|
46159
|
+
if (isIdentifier(node.expression)) {
|
|
46160
|
+
return idText(node.expression) === "Symbol" && getResolvedSymbol(node.expression) === (getGlobalSymbol(
|
|
46161
|
+
"Symbol",
|
|
46162
|
+
111551 /* Value */ | 1048576 /* ExportValue */,
|
|
46163
|
+
/*diagnostic*/
|
|
46164
|
+
void 0
|
|
46165
|
+
) || unknownSymbol);
|
|
46166
|
+
}
|
|
46167
|
+
if (!isIdentifier(node.expression.expression)) return false;
|
|
46168
|
+
return idText(node.expression.name) === "Symbol" && idText(node.expression.expression) === "globalThis" && getResolvedSymbol(node.expression.expression) === globalThisSymbol;
|
|
46169
|
+
}
|
|
46115
46170
|
function getCachedType(key) {
|
|
46116
46171
|
return key ? cachedTypes.get(key) : void 0;
|
|
46117
46172
|
}
|
|
@@ -46458,6 +46513,8 @@ function createTypeChecker(host) {
|
|
|
46458
46513
|
moduleName,
|
|
46459
46514
|
moduleName,
|
|
46460
46515
|
moduleNotFoundError,
|
|
46516
|
+
/*ignoreErrors*/
|
|
46517
|
+
false,
|
|
46461
46518
|
/*isForAugmentation*/
|
|
46462
46519
|
true
|
|
46463
46520
|
);
|
|
@@ -47140,7 +47197,7 @@ function createTypeChecker(host) {
|
|
|
47140
47197
|
const isExport = typeOnlyDeclaration.kind === 281 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 278 /* ExportDeclaration */;
|
|
47141
47198
|
const message = isExport ? Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type : Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type;
|
|
47142
47199
|
const relatedMessage = isExport ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here;
|
|
47143
|
-
const name = typeOnlyDeclaration.kind === 278 /* ExportDeclaration */ ? "*" :
|
|
47200
|
+
const name = typeOnlyDeclaration.kind === 278 /* ExportDeclaration */ ? "*" : moduleExportNameTextUnescaped(typeOnlyDeclaration.name);
|
|
47144
47201
|
addRelatedInfo(error(node.moduleReference, message), createDiagnosticForNode(typeOnlyDeclaration, relatedMessage, name));
|
|
47145
47202
|
}
|
|
47146
47203
|
}
|
|
@@ -47384,12 +47441,12 @@ function createTypeChecker(host) {
|
|
|
47384
47441
|
if (valueSymbol.exports) result.exports = new Map(valueSymbol.exports);
|
|
47385
47442
|
return result;
|
|
47386
47443
|
}
|
|
47387
|
-
function getExportOfModule(symbol,
|
|
47444
|
+
function getExportOfModule(symbol, nameText, specifier, dontResolveAlias) {
|
|
47388
47445
|
var _a;
|
|
47389
47446
|
if (symbol.flags & 1536 /* Module */) {
|
|
47390
|
-
const exportSymbol = getExportsOfSymbol(symbol).get(
|
|
47447
|
+
const exportSymbol = getExportsOfSymbol(symbol).get(nameText);
|
|
47391
47448
|
const resolved = resolveSymbol(exportSymbol, dontResolveAlias);
|
|
47392
|
-
const exportStarDeclaration = (_a = getSymbolLinks(symbol).typeOnlyExportStarMap) == null ? void 0 : _a.get(
|
|
47449
|
+
const exportStarDeclaration = (_a = getSymbolLinks(symbol).typeOnlyExportStarMap) == null ? void 0 : _a.get(nameText);
|
|
47393
47450
|
markSymbolOfAliasDeclarationIfTypeOnly(
|
|
47394
47451
|
specifier,
|
|
47395
47452
|
exportSymbol,
|
|
@@ -47397,7 +47454,7 @@ function createTypeChecker(host) {
|
|
|
47397
47454
|
/*overwriteEmpty*/
|
|
47398
47455
|
false,
|
|
47399
47456
|
exportStarDeclaration,
|
|
47400
|
-
|
|
47457
|
+
nameText
|
|
47401
47458
|
);
|
|
47402
47459
|
return resolved;
|
|
47403
47460
|
}
|
|
@@ -47415,10 +47472,11 @@ function createTypeChecker(host) {
|
|
|
47415
47472
|
const moduleSpecifier = getExternalModuleRequireArgument(node) || node.moduleSpecifier;
|
|
47416
47473
|
const moduleSymbol = resolveExternalModuleName(node, moduleSpecifier);
|
|
47417
47474
|
const name = !isPropertyAccessExpression(specifier) && specifier.propertyName || specifier.name;
|
|
47418
|
-
if (!isIdentifier(name)) {
|
|
47475
|
+
if (!isIdentifier(name) && name.kind !== 11 /* StringLiteral */) {
|
|
47419
47476
|
return void 0;
|
|
47420
47477
|
}
|
|
47421
|
-
const
|
|
47478
|
+
const nameText = moduleExportNameTextEscaped(name);
|
|
47479
|
+
const suppressInteropError = nameText === "default" /* Default */ && allowSyntheticDefaultImports;
|
|
47422
47480
|
const targetSymbol = resolveESModuleSymbol(
|
|
47423
47481
|
moduleSymbol,
|
|
47424
47482
|
moduleSpecifier,
|
|
@@ -47427,7 +47485,7 @@ function createTypeChecker(host) {
|
|
|
47427
47485
|
suppressInteropError
|
|
47428
47486
|
);
|
|
47429
47487
|
if (targetSymbol) {
|
|
47430
|
-
if (name.
|
|
47488
|
+
if (nameText || name.kind === 11 /* StringLiteral */) {
|
|
47431
47489
|
if (isShorthandAmbientModuleSymbol(moduleSymbol)) {
|
|
47432
47490
|
return moduleSymbol;
|
|
47433
47491
|
}
|
|
@@ -47435,16 +47493,16 @@ function createTypeChecker(host) {
|
|
|
47435
47493
|
if (moduleSymbol && moduleSymbol.exports && moduleSymbol.exports.get("export=" /* ExportEquals */)) {
|
|
47436
47494
|
symbolFromVariable = getPropertyOfType(
|
|
47437
47495
|
getTypeOfSymbol(targetSymbol),
|
|
47438
|
-
|
|
47496
|
+
nameText,
|
|
47439
47497
|
/*skipObjectFunctionPropertyAugment*/
|
|
47440
47498
|
true
|
|
47441
47499
|
);
|
|
47442
47500
|
} else {
|
|
47443
|
-
symbolFromVariable = getPropertyOfVariable(targetSymbol,
|
|
47501
|
+
symbolFromVariable = getPropertyOfVariable(targetSymbol, nameText);
|
|
47444
47502
|
}
|
|
47445
47503
|
symbolFromVariable = resolveSymbol(symbolFromVariable, dontResolveAlias);
|
|
47446
|
-
let symbolFromModule = getExportOfModule(targetSymbol,
|
|
47447
|
-
if (symbolFromModule === void 0 &&
|
|
47504
|
+
let symbolFromModule = getExportOfModule(targetSymbol, nameText, specifier, dontResolveAlias);
|
|
47505
|
+
if (symbolFromModule === void 0 && nameText === "default" /* Default */) {
|
|
47448
47506
|
const file = (_a = moduleSymbol.declarations) == null ? void 0 : _a.find(isSourceFile);
|
|
47449
47507
|
if (isOnlyImportableAsDefault(moduleSpecifier) || canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, moduleSpecifier)) {
|
|
47450
47508
|
symbolFromModule = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);
|
|
@@ -47462,7 +47520,7 @@ function createTypeChecker(host) {
|
|
|
47462
47520
|
var _a;
|
|
47463
47521
|
const moduleName = getFullyQualifiedName(moduleSymbol, node);
|
|
47464
47522
|
const declarationName = declarationNameToString(name);
|
|
47465
|
-
const suggestion = getSuggestedSymbolForNonexistentModule(name, targetSymbol);
|
|
47523
|
+
const suggestion = isIdentifier(name) ? getSuggestedSymbolForNonexistentModule(name, targetSymbol) : void 0;
|
|
47466
47524
|
if (suggestion !== void 0) {
|
|
47467
47525
|
const suggestionName = symbolToString(suggestion);
|
|
47468
47526
|
const diagnostic = error(name, Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, moduleName, declarationName, suggestionName);
|
|
@@ -47484,7 +47542,7 @@ function createTypeChecker(host) {
|
|
|
47484
47542
|
}
|
|
47485
47543
|
function reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName) {
|
|
47486
47544
|
var _a, _b;
|
|
47487
|
-
const localSymbol = (_b = (_a = tryCast(moduleSymbol.valueDeclaration, canHaveLocals)) == null ? void 0 : _a.locals) == null ? void 0 : _b.get(name
|
|
47545
|
+
const localSymbol = (_b = (_a = tryCast(moduleSymbol.valueDeclaration, canHaveLocals)) == null ? void 0 : _a.locals) == null ? void 0 : _b.get(moduleExportNameTextEscaped(name));
|
|
47488
47546
|
const exports2 = moduleSymbol.exports;
|
|
47489
47547
|
if (localSymbol) {
|
|
47490
47548
|
const exportedEqualsSymbol = exports2 == null ? void 0 : exports2.get("export=" /* ExportEquals */);
|
|
@@ -47516,7 +47574,7 @@ function createTypeChecker(host) {
|
|
|
47516
47574
|
}
|
|
47517
47575
|
}
|
|
47518
47576
|
function getTargetOfImportSpecifier(node, dontResolveAlias) {
|
|
47519
|
-
if (isImportSpecifier(node) &&
|
|
47577
|
+
if (isImportSpecifier(node) && moduleExportNameIsDefault(node.propertyName || node.name)) {
|
|
47520
47578
|
const specifier = getModuleSpecifierForImportOrExport(node);
|
|
47521
47579
|
const moduleSymbol = specifier && resolveExternalModuleName(node, specifier);
|
|
47522
47580
|
if (moduleSymbol) {
|
|
@@ -47560,19 +47618,23 @@ function createTypeChecker(host) {
|
|
|
47560
47618
|
}
|
|
47561
47619
|
}
|
|
47562
47620
|
function getTargetOfExportSpecifier(node, meaning, dontResolveAlias) {
|
|
47563
|
-
|
|
47621
|
+
const name = node.propertyName || node.name;
|
|
47622
|
+
if (moduleExportNameIsDefault(name)) {
|
|
47564
47623
|
const specifier = getModuleSpecifierForImportOrExport(node);
|
|
47565
47624
|
const moduleSymbol = specifier && resolveExternalModuleName(node, specifier);
|
|
47566
47625
|
if (moduleSymbol) {
|
|
47567
47626
|
return getTargetofModuleDefault(moduleSymbol, node, !!dontResolveAlias);
|
|
47568
47627
|
}
|
|
47569
47628
|
}
|
|
47570
|
-
const resolved = node.parent.parent.moduleSpecifier ? getExternalModuleMember(node.parent.parent, node, dontResolveAlias) :
|
|
47571
|
-
|
|
47572
|
-
|
|
47573
|
-
|
|
47574
|
-
|
|
47575
|
-
|
|
47629
|
+
const resolved = node.parent.parent.moduleSpecifier ? getExternalModuleMember(node.parent.parent, node, dontResolveAlias) : name.kind === 11 /* StringLiteral */ ? void 0 : (
|
|
47630
|
+
// Skip for invalid syntax like this: export { "x" }
|
|
47631
|
+
resolveEntityName(
|
|
47632
|
+
name,
|
|
47633
|
+
meaning,
|
|
47634
|
+
/*ignoreErrors*/
|
|
47635
|
+
false,
|
|
47636
|
+
dontResolveAlias
|
|
47637
|
+
)
|
|
47576
47638
|
);
|
|
47577
47639
|
markSymbolOfAliasDeclarationIfTypeOnly(
|
|
47578
47640
|
node,
|
|
@@ -48020,14 +48082,14 @@ function createTypeChecker(host) {
|
|
|
48020
48082
|
function resolveExternalModuleName(location, moduleReferenceExpression, ignoreErrors) {
|
|
48021
48083
|
const isClassic = getEmitModuleResolutionKind(compilerOptions) === 1 /* Classic */;
|
|
48022
48084
|
const errorMessage = isClassic ? Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option : Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations;
|
|
48023
|
-
return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? void 0 : errorMessage);
|
|
48085
|
+
return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? void 0 : errorMessage, ignoreErrors);
|
|
48024
48086
|
}
|
|
48025
|
-
function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation = false) {
|
|
48026
|
-
return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) : void 0;
|
|
48087
|
+
function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, ignoreErrors = false, isForAugmentation = false) {
|
|
48088
|
+
return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, !ignoreErrors ? moduleReferenceExpression : void 0, isForAugmentation) : void 0;
|
|
48027
48089
|
}
|
|
48028
48090
|
function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) {
|
|
48029
48091
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
48030
|
-
if (startsWith(moduleReference, "@types/")) {
|
|
48092
|
+
if (errorNode && startsWith(moduleReference, "@types/")) {
|
|
48031
48093
|
const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
|
|
48032
48094
|
const withoutAtTypePrefix = removePrefix(moduleReference, "@types/");
|
|
48033
48095
|
error(errorNode, diag2, withoutAtTypePrefix, moduleReference);
|
|
@@ -48049,7 +48111,7 @@ function createTypeChecker(host) {
|
|
|
48049
48111
|
const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? host.getModeForUsageLocation(currentSourceFile, contextSpecifier) : host.getDefaultResolutionModeForFile(currentSourceFile);
|
|
48050
48112
|
const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
|
|
48051
48113
|
const resolvedModule = (_g = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _g.resolvedModule;
|
|
48052
|
-
const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule, currentSourceFile);
|
|
48114
|
+
const resolutionDiagnostic = errorNode && resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule, currentSourceFile);
|
|
48053
48115
|
const sourceFile = resolvedModule && (!resolutionDiagnostic || resolutionDiagnostic === Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set) && host.getSourceFile(resolvedModule.resolvedFileName);
|
|
48054
48116
|
if (sourceFile) {
|
|
48055
48117
|
if (resolutionDiagnostic) {
|
|
@@ -48057,7 +48119,7 @@ function createTypeChecker(host) {
|
|
|
48057
48119
|
}
|
|
48058
48120
|
if (resolvedModule.resolvedUsingTsExtension && isDeclarationFileName(moduleReference)) {
|
|
48059
48121
|
const importOrExport = ((_h = findAncestor(location, isImportDeclaration)) == null ? void 0 : _h.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
|
|
48060
|
-
if (importOrExport && !importOrExport.isTypeOnly || findAncestor(location, isImportCall)) {
|
|
48122
|
+
if (errorNode && importOrExport && !importOrExport.isTypeOnly || findAncestor(location, isImportCall)) {
|
|
48061
48123
|
error(
|
|
48062
48124
|
errorNode,
|
|
48063
48125
|
Diagnostics.A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_file_0_instead,
|
|
@@ -48066,13 +48128,13 @@ function createTypeChecker(host) {
|
|
|
48066
48128
|
}
|
|
48067
48129
|
} else if (resolvedModule.resolvedUsingTsExtension && !shouldAllowImportingTsExtension(compilerOptions, currentSourceFile.fileName)) {
|
|
48068
48130
|
const importOrExport = ((_i = findAncestor(location, isImportDeclaration)) == null ? void 0 : _i.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
|
|
48069
|
-
if (!((importOrExport == null ? void 0 : importOrExport.isTypeOnly) || findAncestor(location, isImportTypeNode))) {
|
|
48131
|
+
if (errorNode && !((importOrExport == null ? void 0 : importOrExport.isTypeOnly) || findAncestor(location, isImportTypeNode))) {
|
|
48070
48132
|
const tsExtension = Debug.checkDefined(tryExtractTSExtension(moduleReference));
|
|
48071
48133
|
error(errorNode, Diagnostics.An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled, tsExtension);
|
|
48072
48134
|
}
|
|
48073
48135
|
}
|
|
48074
48136
|
if (sourceFile.symbol) {
|
|
48075
|
-
if (resolvedModule.isExternalLibraryImport && !resolutionExtensionIsTSOrJson(resolvedModule.extension)) {
|
|
48137
|
+
if (errorNode && resolvedModule.isExternalLibraryImport && !resolutionExtensionIsTSOrJson(resolvedModule.extension)) {
|
|
48076
48138
|
errorOnImplicitAnyModule(
|
|
48077
48139
|
/*isError*/
|
|
48078
48140
|
false,
|
|
@@ -48083,7 +48145,7 @@ function createTypeChecker(host) {
|
|
|
48083
48145
|
moduleReference
|
|
48084
48146
|
);
|
|
48085
48147
|
}
|
|
48086
|
-
if (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */) {
|
|
48148
|
+
if (errorNode && (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */)) {
|
|
48087
48149
|
const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
|
|
48088
48150
|
const overrideHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l));
|
|
48089
48151
|
if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !hasResolutionModeOverride(overrideHost)) {
|
|
@@ -48143,7 +48205,7 @@ function createTypeChecker(host) {
|
|
|
48143
48205
|
}
|
|
48144
48206
|
return getMergedSymbol(sourceFile.symbol);
|
|
48145
48207
|
}
|
|
48146
|
-
if (moduleNotFoundError) {
|
|
48208
|
+
if (errorNode && moduleNotFoundError) {
|
|
48147
48209
|
error(errorNode, Diagnostics.File_0_is_not_a_module, sourceFile.fileName);
|
|
48148
48210
|
}
|
|
48149
48211
|
return void 0;
|
|
@@ -48158,6 +48220,9 @@ function createTypeChecker(host) {
|
|
|
48158
48220
|
return getMergedSymbol(pattern.symbol);
|
|
48159
48221
|
}
|
|
48160
48222
|
}
|
|
48223
|
+
if (!errorNode) {
|
|
48224
|
+
return void 0;
|
|
48225
|
+
}
|
|
48161
48226
|
if (resolvedModule && !resolutionExtensionIsTSOrJson(resolvedModule.extension) && resolutionDiagnostic === void 0 || resolutionDiagnostic === Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type) {
|
|
48162
48227
|
if (isForAugmentation) {
|
|
48163
48228
|
const diag2 = Diagnostics.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented;
|
|
@@ -51622,7 +51687,7 @@ function createTypeChecker(host) {
|
|
|
51622
51687
|
return enterNewScope(context, node, getParametersInScope(node), getTypeParametersInScope(node));
|
|
51623
51688
|
}
|
|
51624
51689
|
function tryVisitSimpleTypeNode(node) {
|
|
51625
|
-
const innerNode =
|
|
51690
|
+
const innerNode = skipTypeParentheses(node);
|
|
51626
51691
|
switch (innerNode.kind) {
|
|
51627
51692
|
case 183 /* TypeReference */:
|
|
51628
51693
|
return tryVisitTypeReference(innerNode);
|
|
@@ -52169,9 +52234,10 @@ function createTypeChecker(host) {
|
|
|
52169
52234
|
if (index >= 0) {
|
|
52170
52235
|
const exportDecl = statements[index];
|
|
52171
52236
|
const replacements = mapDefined(exportDecl.exportClause.elements, (e) => {
|
|
52172
|
-
if (!e.propertyName) {
|
|
52237
|
+
if (!e.propertyName && e.name.kind !== 11 /* StringLiteral */) {
|
|
52238
|
+
const name = e.name;
|
|
52173
52239
|
const indices = indicesOf(statements);
|
|
52174
|
-
const associatedIndices = filter(indices, (i) => nodeHasName(statements[i],
|
|
52240
|
+
const associatedIndices = filter(indices, (i) => nodeHasName(statements[i], name));
|
|
52175
52241
|
if (length(associatedIndices) && every(associatedIndices, (i) => canHaveExportModifier(statements[i]))) {
|
|
52176
52242
|
for (const index2 of associatedIndices) {
|
|
52177
52243
|
statements[index2] = addExportModifier(statements[index2]);
|
|
@@ -52805,7 +52871,7 @@ function createTypeChecker(host) {
|
|
|
52805
52871
|
function getSomeTargetNameFromDeclarations(declarations) {
|
|
52806
52872
|
return firstDefined(declarations, (d) => {
|
|
52807
52873
|
if (isImportSpecifier(d) || isExportSpecifier(d)) {
|
|
52808
|
-
return
|
|
52874
|
+
return moduleExportNameTextUnescaped(d.propertyName || d.name);
|
|
52809
52875
|
}
|
|
52810
52876
|
if (isBinaryExpression(d) || isExportAssignment(d)) {
|
|
52811
52877
|
const expression = isExportAssignment(d) ? d.expression : d.right;
|
|
@@ -52823,7 +52889,7 @@ function createTypeChecker(host) {
|
|
|
52823
52889
|
});
|
|
52824
52890
|
}
|
|
52825
52891
|
function serializeAsAlias(symbol, localName, modifierFlags) {
|
|
52826
|
-
var _a2, _b, _c, _d, _e
|
|
52892
|
+
var _a2, _b, _c, _d, _e;
|
|
52827
52893
|
const node = getDeclarationOfAliasSymbol(symbol);
|
|
52828
52894
|
if (!node) return Debug.fail();
|
|
52829
52895
|
const target = getMergedSymbol(getTargetOfAliasDeclaration(
|
|
@@ -53021,8 +53087,11 @@ function createTypeChecker(host) {
|
|
|
53021
53087
|
}
|
|
53022
53088
|
case 281 /* ExportSpecifier */:
|
|
53023
53089
|
const specifier = node.parent.parent.moduleSpecifier;
|
|
53024
|
-
if (specifier
|
|
53025
|
-
|
|
53090
|
+
if (specifier) {
|
|
53091
|
+
const propertyName = node.propertyName;
|
|
53092
|
+
if (propertyName && moduleExportNameIsDefault(propertyName)) {
|
|
53093
|
+
verbatimTargetName = "default" /* Default */;
|
|
53094
|
+
}
|
|
53026
53095
|
}
|
|
53027
53096
|
serializeExportSpecifier(
|
|
53028
53097
|
unescapeLeadingUnderscores(symbol.escapedName),
|
|
@@ -53735,7 +53804,7 @@ function createTypeChecker(host) {
|
|
|
53735
53804
|
}
|
|
53736
53805
|
function collectLinkedAliases(node, setVisibility) {
|
|
53737
53806
|
let exportSymbol;
|
|
53738
|
-
if (node.parent && node.parent.kind === 277 /* ExportAssignment */) {
|
|
53807
|
+
if (node.kind !== 11 /* StringLiteral */ && node.parent && node.parent.kind === 277 /* ExportAssignment */) {
|
|
53739
53808
|
exportSymbol = resolveName(
|
|
53740
53809
|
node,
|
|
53741
53810
|
node,
|
|
@@ -69308,9 +69377,10 @@ function createTypeChecker(host) {
|
|
|
69308
69377
|
return;
|
|
69309
69378
|
case 281 /* ExportSpecifier */:
|
|
69310
69379
|
const exportDeclaration = node.parent.parent;
|
|
69311
|
-
|
|
69380
|
+
const name = node.propertyName || node.name;
|
|
69381
|
+
if (!node.isTypeOnly && !exportDeclaration.isTypeOnly && !exportDeclaration.moduleSpecifier && name.kind !== 11 /* StringLiteral */) {
|
|
69312
69382
|
const symbol = resolveEntityName(
|
|
69313
|
-
|
|
69383
|
+
name,
|
|
69314
69384
|
111551 /* Value */,
|
|
69315
69385
|
/*ignoreErrors*/
|
|
69316
69386
|
true,
|
|
@@ -69604,6 +69674,9 @@ function createTypeChecker(host) {
|
|
|
69604
69674
|
function markExportSpecifierAliasReferenced(location) {
|
|
69605
69675
|
if (!location.parent.parent.moduleSpecifier && !location.isTypeOnly && !location.parent.parent.isTypeOnly) {
|
|
69606
69676
|
const exportedName = location.propertyName || location.name;
|
|
69677
|
+
if (exportedName.kind === 11 /* StringLiteral */) {
|
|
69678
|
+
return;
|
|
69679
|
+
}
|
|
69607
69680
|
const symbol = resolveName(
|
|
69608
69681
|
exportedName,
|
|
69609
69682
|
exportedName.escapedText,
|
|
@@ -69618,7 +69691,7 @@ function createTypeChecker(host) {
|
|
|
69618
69691
|
const target = symbol && (symbol.flags & 2097152 /* Alias */ ? resolveAlias(symbol) : symbol);
|
|
69619
69692
|
if (!target || getSymbolFlags(target) & 111551 /* Value */) {
|
|
69620
69693
|
markExportAsReferenced(location);
|
|
69621
|
-
markIdentifierAliasReferenced(
|
|
69694
|
+
markIdentifierAliasReferenced(exportedName);
|
|
69622
69695
|
}
|
|
69623
69696
|
}
|
|
69624
69697
|
return;
|
|
@@ -83214,6 +83287,16 @@ function createTypeChecker(host) {
|
|
|
83214
83287
|
}
|
|
83215
83288
|
return true;
|
|
83216
83289
|
}
|
|
83290
|
+
function checkModuleExportName(name, allowStringLiteral = true) {
|
|
83291
|
+
if (name === void 0 || name.kind !== 11 /* StringLiteral */) {
|
|
83292
|
+
return;
|
|
83293
|
+
}
|
|
83294
|
+
if (!allowStringLiteral) {
|
|
83295
|
+
grammarErrorOnNode(name, Diagnostics.Identifier_expected);
|
|
83296
|
+
} else if (moduleKind === 5 /* ES2015 */ || moduleKind === 6 /* ES2020 */) {
|
|
83297
|
+
grammarErrorOnNode(name, Diagnostics.String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es2020);
|
|
83298
|
+
}
|
|
83299
|
+
}
|
|
83217
83300
|
function checkAliasSymbol(node) {
|
|
83218
83301
|
var _a, _b, _c, _d;
|
|
83219
83302
|
let symbol = getSymbolOfDeclaration(node);
|
|
@@ -83225,7 +83308,7 @@ function createTypeChecker(host) {
|
|
|
83225
83308
|
Debug.assert(node.kind !== 280 /* NamespaceExport */);
|
|
83226
83309
|
if (node.kind === 281 /* ExportSpecifier */) {
|
|
83227
83310
|
const diag2 = error(errorNode, Diagnostics.Types_cannot_appear_in_export_declarations_in_JavaScript_files);
|
|
83228
|
-
const alreadyExportedSymbol = (_b = (_a = getSourceFileOfNode(node).symbol) == null ? void 0 : _a.exports) == null ? void 0 : _b.get((node.propertyName || node.name)
|
|
83311
|
+
const alreadyExportedSymbol = (_b = (_a = getSourceFileOfNode(node).symbol) == null ? void 0 : _a.exports) == null ? void 0 : _b.get(moduleExportNameTextEscaped(node.propertyName || node.name));
|
|
83229
83312
|
if (alreadyExportedSymbol === target) {
|
|
83230
83313
|
const exportingDeclaration = (_c = alreadyExportedSymbol.declarations) == null ? void 0 : _c.find(isJSDocNode);
|
|
83231
83314
|
if (exportingDeclaration) {
|
|
@@ -83280,7 +83363,7 @@ function createTypeChecker(host) {
|
|
|
83280
83363
|
if (compilerOptions.verbatimModuleSyntax) {
|
|
83281
83364
|
Debug.assertIsDefined(node.name, "An ImportClause with a symbol should have a name");
|
|
83282
83365
|
const message = compilerOptions.verbatimModuleSyntax && isInternalModuleImportEqualsDeclaration(node) ? Diagnostics.An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled : isType ? Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled;
|
|
83283
|
-
const name =
|
|
83366
|
+
const name = moduleExportNameTextUnescaped(node.kind === 276 /* ImportSpecifier */ ? node.propertyName || node.name : node.name);
|
|
83284
83367
|
addTypeOnlyDeclarationRelatedInfo(
|
|
83285
83368
|
error(node, message, name),
|
|
83286
83369
|
isType ? void 0 : typeOnlyAlias,
|
|
@@ -83294,7 +83377,7 @@ function createTypeChecker(host) {
|
|
|
83294
83377
|
}
|
|
83295
83378
|
case 281 /* ExportSpecifier */: {
|
|
83296
83379
|
if (compilerOptions.verbatimModuleSyntax || getSourceFileOfNode(typeOnlyAlias) !== getSourceFileOfNode(node)) {
|
|
83297
|
-
const name =
|
|
83380
|
+
const name = moduleExportNameTextUnescaped(node.propertyName || node.name);
|
|
83298
83381
|
const diagnostic = isType ? error(node, Diagnostics.Re_exporting_a_type_when_0_is_enabled_requires_using_export_type, isolatedModulesLikeFlagName) : error(node, Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled, name, isolatedModulesLikeFlagName);
|
|
83299
83382
|
addTypeOnlyDeclarationRelatedInfo(diagnostic, isType ? void 0 : typeOnlyAlias, name);
|
|
83300
83383
|
break;
|
|
@@ -83344,8 +83427,11 @@ function createTypeChecker(host) {
|
|
|
83344
83427
|
function checkImportBinding(node) {
|
|
83345
83428
|
checkCollisionsForDeclarationName(node, node.name);
|
|
83346
83429
|
checkAliasSymbol(node);
|
|
83347
|
-
if (node.kind === 276 /* ImportSpecifier */
|
|
83348
|
-
|
|
83430
|
+
if (node.kind === 276 /* ImportSpecifier */) {
|
|
83431
|
+
checkModuleExportName(node.propertyName);
|
|
83432
|
+
if (moduleExportNameIsDefault(node.propertyName || node.name) && getESModuleInterop(compilerOptions) && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) < 4 /* System */) {
|
|
83433
|
+
checkExternalEmitHelpers(node, 131072 /* ImportDefault */);
|
|
83434
|
+
}
|
|
83349
83435
|
}
|
|
83350
83436
|
}
|
|
83351
83437
|
function checkImportAttributes(declaration) {
|
|
@@ -83466,6 +83552,7 @@ function createTypeChecker(host) {
|
|
|
83466
83552
|
error(node.moduleSpecifier, Diagnostics.Module_0_uses_export_and_cannot_be_used_with_export_Asterisk, symbolToString(moduleSymbol));
|
|
83467
83553
|
} else if (node.exportClause) {
|
|
83468
83554
|
checkAliasSymbol(node.exportClause);
|
|
83555
|
+
checkModuleExportName(node.exportClause.name);
|
|
83469
83556
|
}
|
|
83470
83557
|
if (host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) < 4 /* System */) {
|
|
83471
83558
|
if (node.exportClause) {
|
|
@@ -83496,6 +83583,9 @@ function createTypeChecker(host) {
|
|
|
83496
83583
|
}
|
|
83497
83584
|
function checkExportSpecifier(node) {
|
|
83498
83585
|
checkAliasSymbol(node);
|
|
83586
|
+
const hasModuleSpecifier = node.parent.parent.moduleSpecifier !== void 0;
|
|
83587
|
+
checkModuleExportName(node.propertyName, hasModuleSpecifier);
|
|
83588
|
+
checkModuleExportName(node.name);
|
|
83499
83589
|
if (getEmitDeclarations(compilerOptions)) {
|
|
83500
83590
|
collectLinkedAliases(
|
|
83501
83591
|
node.propertyName || node.name,
|
|
@@ -83503,8 +83593,11 @@ function createTypeChecker(host) {
|
|
|
83503
83593
|
true
|
|
83504
83594
|
);
|
|
83505
83595
|
}
|
|
83506
|
-
if (!
|
|
83596
|
+
if (!hasModuleSpecifier) {
|
|
83507
83597
|
const exportedName = node.propertyName || node.name;
|
|
83598
|
+
if (exportedName.kind === 11 /* StringLiteral */) {
|
|
83599
|
+
return;
|
|
83600
|
+
}
|
|
83508
83601
|
const symbol = resolveName(
|
|
83509
83602
|
exportedName,
|
|
83510
83603
|
exportedName.escapedText,
|
|
@@ -83520,7 +83613,7 @@ function createTypeChecker(host) {
|
|
|
83520
83613
|
markLinkedReferences(node, 7 /* ExportSpecifier */);
|
|
83521
83614
|
}
|
|
83522
83615
|
} else {
|
|
83523
|
-
if (getESModuleInterop(compilerOptions) && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) < 4 /* System */ &&
|
|
83616
|
+
if (getESModuleInterop(compilerOptions) && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) < 4 /* System */ && moduleExportNameIsDefault(node.propertyName || node.name)) {
|
|
83524
83617
|
checkExternalEmitHelpers(node, 131072 /* ImportDefault */);
|
|
83525
83618
|
}
|
|
83526
83619
|
}
|
|
@@ -84675,7 +84768,11 @@ function createTypeChecker(host) {
|
|
|
84675
84768
|
}
|
|
84676
84769
|
function getExportSpecifierLocalTargetSymbol(node) {
|
|
84677
84770
|
if (isExportSpecifier(node)) {
|
|
84678
|
-
|
|
84771
|
+
const name = node.propertyName || node.name;
|
|
84772
|
+
return node.parent.parent.moduleSpecifier ? getExternalModuleMember(node.parent.parent, node) : name.kind === 11 /* StringLiteral */ ? void 0 : (
|
|
84773
|
+
// Skip for invalid syntax like this: export { "x" }
|
|
84774
|
+
resolveEntityName(name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)
|
|
84775
|
+
);
|
|
84679
84776
|
} else {
|
|
84680
84777
|
return resolveEntityName(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */);
|
|
84681
84778
|
}
|
|
@@ -85646,7 +85743,8 @@ function createTypeChecker(host) {
|
|
|
85646
85743
|
resolveExternalModuleSymbol(sym);
|
|
85647
85744
|
return !sym.exports ? [] : nodeBuilder.symbolTableToDeclarationStatements(sym.exports, node, flags, tracker);
|
|
85648
85745
|
},
|
|
85649
|
-
isImportRequiredByAugmentation
|
|
85746
|
+
isImportRequiredByAugmentation,
|
|
85747
|
+
isDefinitelyReferenceToGlobalSymbolObject
|
|
85650
85748
|
};
|
|
85651
85749
|
function isImportRequiredByAugmentation(node) {
|
|
85652
85750
|
const file = getSourceFileOfNode(node);
|
|
@@ -87485,7 +87583,7 @@ function isDeclarationNameOrImportPropertyName(name) {
|
|
|
87485
87583
|
switch (name.parent.kind) {
|
|
87486
87584
|
case 276 /* ImportSpecifier */:
|
|
87487
87585
|
case 281 /* ExportSpecifier */:
|
|
87488
|
-
return isIdentifier(name)
|
|
87586
|
+
return isIdentifier(name) || name.kind === 11 /* StringLiteral */;
|
|
87489
87587
|
default:
|
|
87490
87588
|
return isDeclarationName(name);
|
|
87491
87589
|
}
|
|
@@ -88730,7 +88828,7 @@ var visitEachChildTable = {
|
|
|
88730
88828
|
return context.factory.updateImportSpecifier(
|
|
88731
88829
|
node,
|
|
88732
88830
|
node.isTypeOnly,
|
|
88733
|
-
nodeVisitor(node.propertyName, visitor,
|
|
88831
|
+
nodeVisitor(node.propertyName, visitor, isModuleExportName),
|
|
88734
88832
|
Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier))
|
|
88735
88833
|
);
|
|
88736
88834
|
},
|
|
@@ -88761,8 +88859,8 @@ var visitEachChildTable = {
|
|
|
88761
88859
|
return context.factory.updateExportSpecifier(
|
|
88762
88860
|
node,
|
|
88763
88861
|
node.isTypeOnly,
|
|
88764
|
-
nodeVisitor(node.propertyName, visitor,
|
|
88765
|
-
Debug.checkDefined(nodeVisitor(node.name, visitor,
|
|
88862
|
+
nodeVisitor(node.propertyName, visitor, isModuleExportName),
|
|
88863
|
+
Debug.checkDefined(nodeVisitor(node.name, visitor, isModuleExportName))
|
|
88766
88864
|
);
|
|
88767
88865
|
},
|
|
88768
88866
|
// Module references
|
|
@@ -89306,7 +89404,7 @@ function containsDefaultReference(node) {
|
|
|
89306
89404
|
return some(node.elements, isNamedDefaultReference);
|
|
89307
89405
|
}
|
|
89308
89406
|
function isNamedDefaultReference(e) {
|
|
89309
|
-
return e.propertyName
|
|
89407
|
+
return moduleExportNameIsDefault(e.propertyName || e.name);
|
|
89310
89408
|
}
|
|
89311
89409
|
function chainBundle(context, transformSourceFile) {
|
|
89312
89410
|
return transformSourceFileOrBundle;
|
|
@@ -89382,9 +89480,10 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
89382
89480
|
hasImportDefault || (hasImportDefault = containsDefaultReference(node.exportClause));
|
|
89383
89481
|
} else {
|
|
89384
89482
|
const name = node.exportClause.name;
|
|
89385
|
-
|
|
89483
|
+
const nameText = moduleExportNameTextUnescaped(name);
|
|
89484
|
+
if (!uniqueExports.get(nameText)) {
|
|
89386
89485
|
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name);
|
|
89387
|
-
uniqueExports.set(
|
|
89486
|
+
uniqueExports.set(nameText, true);
|
|
89388
89487
|
exportedNames = append(exportedNames, name);
|
|
89389
89488
|
}
|
|
89390
89489
|
hasImportStar = true;
|
|
@@ -89442,20 +89541,23 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
89442
89541
|
return { externalImports, exportSpecifiers, exportEquals, hasExportStarsToExportValues, exportedBindings, exportedNames, exportedFunctions, externalHelpersImportDeclaration };
|
|
89443
89542
|
function addExportedNamesForExportDeclaration(node) {
|
|
89444
89543
|
for (const specifier of cast(node.exportClause, isNamedExports).elements) {
|
|
89445
|
-
|
|
89544
|
+
const specifierNameText = moduleExportNameTextUnescaped(specifier.name);
|
|
89545
|
+
if (!uniqueExports.get(specifierNameText)) {
|
|
89446
89546
|
const name = specifier.propertyName || specifier.name;
|
|
89447
|
-
if (
|
|
89448
|
-
|
|
89449
|
-
|
|
89450
|
-
|
|
89451
|
-
|
|
89452
|
-
if (decl
|
|
89453
|
-
|
|
89454
|
-
|
|
89547
|
+
if (name.kind !== 11 /* StringLiteral */) {
|
|
89548
|
+
if (!node.moduleSpecifier) {
|
|
89549
|
+
exportSpecifiers.add(name, specifier);
|
|
89550
|
+
}
|
|
89551
|
+
const decl = resolver.getReferencedImportDeclaration(name) || resolver.getReferencedValueDeclaration(name);
|
|
89552
|
+
if (decl) {
|
|
89553
|
+
if (decl.kind === 262 /* FunctionDeclaration */) {
|
|
89554
|
+
addExportedFunctionDeclaration(decl, specifier.name, moduleExportNameIsDefault(specifier.name));
|
|
89555
|
+
continue;
|
|
89556
|
+
}
|
|
89557
|
+
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(decl), specifier.name);
|
|
89455
89558
|
}
|
|
89456
|
-
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(decl), specifier.name);
|
|
89457
89559
|
}
|
|
89458
|
-
uniqueExports.set(
|
|
89560
|
+
uniqueExports.set(specifierNameText, true);
|
|
89459
89561
|
exportedNames = append(exportedNames, specifier.name);
|
|
89460
89562
|
}
|
|
89461
89563
|
}
|
|
@@ -89469,9 +89571,10 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
89469
89571
|
}
|
|
89470
89572
|
} else {
|
|
89471
89573
|
name ?? (name = node.name);
|
|
89472
|
-
|
|
89574
|
+
const nameText = moduleExportNameTextUnescaped(name);
|
|
89575
|
+
if (!uniqueExports.get(nameText)) {
|
|
89473
89576
|
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name);
|
|
89474
|
-
uniqueExports.set(
|
|
89577
|
+
uniqueExports.set(nameText, true);
|
|
89475
89578
|
}
|
|
89476
89579
|
}
|
|
89477
89580
|
}
|
|
@@ -106748,7 +106851,7 @@ function transformModule(context) {
|
|
|
106748
106851
|
factory2.createExpressionStatement(
|
|
106749
106852
|
reduceLeft(
|
|
106750
106853
|
currentModuleInfo.exportedNames.slice(i, i + chunkSize),
|
|
106751
|
-
(prev, nextId) => factory2.createAssignment(factory2.createPropertyAccessExpression(factory2.createIdentifier("exports"), factory2.createIdentifier(idText(nextId))), prev),
|
|
106854
|
+
(prev, nextId) => nextId.kind === 11 /* StringLiteral */ ? factory2.createAssignment(factory2.createElementAccessExpression(factory2.createIdentifier("exports"), factory2.createStringLiteral(nextId.text)), prev) : factory2.createAssignment(factory2.createPropertyAccessExpression(factory2.createIdentifier("exports"), factory2.createIdentifier(idText(nextId))), prev),
|
|
106752
106855
|
factory2.createVoidZero()
|
|
106753
106856
|
)
|
|
106754
106857
|
)
|
|
@@ -107071,7 +107174,10 @@ function transformModule(context) {
|
|
|
107071
107174
|
append(statements, createUnderscoreUnderscoreESModule());
|
|
107072
107175
|
}
|
|
107073
107176
|
if (some(currentModuleInfo.exportedNames)) {
|
|
107074
|
-
append(
|
|
107177
|
+
append(
|
|
107178
|
+
statements,
|
|
107179
|
+
factory2.createExpressionStatement(reduceLeft(currentModuleInfo.exportedNames, (prev, nextId) => nextId.kind === 11 /* StringLiteral */ ? factory2.createAssignment(factory2.createElementAccessExpression(factory2.createIdentifier("exports"), factory2.createStringLiteral(nextId.text)), prev) : factory2.createAssignment(factory2.createPropertyAccessExpression(factory2.createIdentifier("exports"), factory2.createIdentifier(idText(nextId))), prev), factory2.createVoidZero()))
|
|
107180
|
+
);
|
|
107075
107181
|
}
|
|
107076
107182
|
for (const f of currentModuleInfo.exportedFunctions) {
|
|
107077
107183
|
appendExportsOfHoistedDeclaration(statements, f);
|
|
@@ -107942,17 +108048,16 @@ function transformModule(context) {
|
|
|
107942
108048
|
);
|
|
107943
108049
|
}
|
|
107944
108050
|
for (const specifier of node.exportClause.elements) {
|
|
107945
|
-
const
|
|
107946
|
-
const
|
|
107947
|
-
|
|
107948
|
-
|
|
107949
|
-
);
|
|
108051
|
+
const specifierName = specifier.propertyName || specifier.name;
|
|
108052
|
+
const exportNeedsImportDefault = !!getESModuleInterop(compilerOptions) && !(getInternalEmitFlags(node) & 2 /* NeverApplyImportHelper */) && moduleExportNameIsDefault(specifierName);
|
|
108053
|
+
const target = exportNeedsImportDefault ? emitHelpers().createImportDefaultHelper(generatedName) : generatedName;
|
|
108054
|
+
const exportedValue = specifierName.kind === 11 /* StringLiteral */ ? factory2.createElementAccessExpression(target, specifierName) : factory2.createPropertyAccessExpression(target, specifierName);
|
|
107950
108055
|
statements.push(
|
|
107951
108056
|
setOriginalNode(
|
|
107952
108057
|
setTextRange(
|
|
107953
108058
|
factory2.createExpressionStatement(
|
|
107954
108059
|
createExportExpression(
|
|
107955
|
-
factory2.getExportName(specifier),
|
|
108060
|
+
specifier.name.kind === 11 /* StringLiteral */ ? factory2.cloneNode(specifier.name) : factory2.getExportName(specifier),
|
|
107956
108061
|
exportedValue,
|
|
107957
108062
|
/*location*/
|
|
107958
108063
|
void 0,
|
|
@@ -107977,7 +108082,7 @@ function transformModule(context) {
|
|
|
107977
108082
|
factory2.cloneNode(node.exportClause.name),
|
|
107978
108083
|
getHelperExpressionForExport(
|
|
107979
108084
|
node,
|
|
107980
|
-
moduleKind !== 2 /* AMD */ ? createRequireCall(node) : isExportNamespaceAsDefaultDeclaration(node) ? generatedName : factory2.createIdentifier(idText(node.exportClause.name))
|
|
108085
|
+
moduleKind !== 2 /* AMD */ ? createRequireCall(node) : isExportNamespaceAsDefaultDeclaration(node) ? generatedName : node.exportClause.name.kind === 11 /* StringLiteral */ ? generatedName : factory2.createIdentifier(idText(node.exportClause.name))
|
|
107981
108086
|
)
|
|
107982
108087
|
)
|
|
107983
108088
|
),
|
|
@@ -108307,10 +108412,13 @@ function transformModule(context) {
|
|
|
108307
108412
|
return statements;
|
|
108308
108413
|
}
|
|
108309
108414
|
function appendExportStatement(statements, seen, exportName, expression, location, allowComments, liveBinding) {
|
|
108310
|
-
if (
|
|
108415
|
+
if (exportName.kind !== 11 /* StringLiteral */) {
|
|
108416
|
+
if (seen.has(exportName)) {
|
|
108417
|
+
return statements;
|
|
108418
|
+
}
|
|
108311
108419
|
seen.set(exportName, true);
|
|
108312
|
-
statements = append(statements, createExportStatement(exportName, expression, location, allowComments, liveBinding));
|
|
108313
108420
|
}
|
|
108421
|
+
statements = append(statements, createExportStatement(exportName, expression, location, allowComments, liveBinding));
|
|
108314
108422
|
return statements;
|
|
108315
108423
|
}
|
|
108316
108424
|
function createUnderscoreUnderscoreESModule() {
|
|
@@ -108380,7 +108488,10 @@ function transformModule(context) {
|
|
|
108380
108488
|
])
|
|
108381
108489
|
]
|
|
108382
108490
|
) : factory2.createAssignment(
|
|
108383
|
-
factory2.
|
|
108491
|
+
name.kind === 11 /* StringLiteral */ ? factory2.createElementAccessExpression(
|
|
108492
|
+
factory2.createIdentifier("exports"),
|
|
108493
|
+
factory2.cloneNode(name)
|
|
108494
|
+
) : factory2.createPropertyAccessExpression(
|
|
108384
108495
|
factory2.createIdentifier("exports"),
|
|
108385
108496
|
factory2.cloneNode(name)
|
|
108386
108497
|
),
|
|
@@ -108516,11 +108627,9 @@ function transformModule(context) {
|
|
|
108516
108627
|
);
|
|
108517
108628
|
} else if (isImportSpecifier(importDeclaration)) {
|
|
108518
108629
|
const name = importDeclaration.propertyName || importDeclaration.name;
|
|
108630
|
+
const target = factory2.getGeneratedNameForNode(((_b = (_a = importDeclaration.parent) == null ? void 0 : _a.parent) == null ? void 0 : _b.parent) || importDeclaration);
|
|
108519
108631
|
return setTextRange(
|
|
108520
|
-
factory2.createPropertyAccessExpression(
|
|
108521
|
-
factory2.getGeneratedNameForNode(((_b = (_a = importDeclaration.parent) == null ? void 0 : _a.parent) == null ? void 0 : _b.parent) || importDeclaration),
|
|
108522
|
-
factory2.cloneNode(name)
|
|
108523
|
-
),
|
|
108632
|
+
name.kind === 11 /* StringLiteral */ ? factory2.createElementAccessExpression(target, factory2.cloneNode(name)) : factory2.createPropertyAccessExpression(target, factory2.cloneNode(name)),
|
|
108524
108633
|
/*location*/
|
|
108525
108634
|
node
|
|
108526
108635
|
);
|
|
@@ -108808,7 +108917,7 @@ function transformSystemModule(context) {
|
|
|
108808
108917
|
const exportedNames = [];
|
|
108809
108918
|
if (moduleInfo.exportedNames) {
|
|
108810
108919
|
for (const exportedLocalName of moduleInfo.exportedNames) {
|
|
108811
|
-
if (exportedLocalName
|
|
108920
|
+
if (moduleExportNameIsDefault(exportedLocalName)) {
|
|
108812
108921
|
continue;
|
|
108813
108922
|
}
|
|
108814
108923
|
exportedNames.push(
|
|
@@ -108986,10 +109095,10 @@ function transformSystemModule(context) {
|
|
|
108986
109095
|
for (const e of entry.exportClause.elements) {
|
|
108987
109096
|
properties.push(
|
|
108988
109097
|
factory2.createPropertyAssignment(
|
|
108989
|
-
factory2.createStringLiteral(
|
|
109098
|
+
factory2.createStringLiteral(moduleExportNameTextUnescaped(e.name)),
|
|
108990
109099
|
factory2.createElementAccessExpression(
|
|
108991
109100
|
parameterName,
|
|
108992
|
-
factory2.createStringLiteral(
|
|
109101
|
+
factory2.createStringLiteral(moduleExportNameTextUnescaped(e.propertyName || e.name))
|
|
108993
109102
|
)
|
|
108994
109103
|
)
|
|
108995
109104
|
);
|
|
@@ -109016,7 +109125,7 @@ function transformSystemModule(context) {
|
|
|
109016
109125
|
/*typeArguments*/
|
|
109017
109126
|
void 0,
|
|
109018
109127
|
[
|
|
109019
|
-
factory2.createStringLiteral(
|
|
109128
|
+
factory2.createStringLiteral(moduleExportNameTextUnescaped(entry.exportClause.name)),
|
|
109020
109129
|
parameterName
|
|
109021
109130
|
]
|
|
109022
109131
|
)
|
|
@@ -109356,7 +109465,7 @@ function transformSystemModule(context) {
|
|
|
109356
109465
|
const exportSpecifiers = moduleInfo.exportSpecifiers.get(name);
|
|
109357
109466
|
if (exportSpecifiers) {
|
|
109358
109467
|
for (const exportSpecifier of exportSpecifiers) {
|
|
109359
|
-
if (exportSpecifier.name
|
|
109468
|
+
if (moduleExportNameTextUnescaped(exportSpecifier.name) !== excludeName) {
|
|
109360
109469
|
statements = appendExportStatement(statements, exportSpecifier.name, name);
|
|
109361
109470
|
}
|
|
109362
109471
|
}
|
|
@@ -109777,13 +109886,12 @@ function transformSystemModule(context) {
|
|
|
109777
109886
|
node
|
|
109778
109887
|
);
|
|
109779
109888
|
} else if (isImportSpecifier(importDeclaration)) {
|
|
109889
|
+
const importedName = importDeclaration.propertyName || importDeclaration.name;
|
|
109890
|
+
const target = factory2.getGeneratedNameForNode(((_b = (_a = importDeclaration.parent) == null ? void 0 : _a.parent) == null ? void 0 : _b.parent) || importDeclaration);
|
|
109780
109891
|
return setTextRange(
|
|
109781
109892
|
factory2.createPropertyAssignment(
|
|
109782
109893
|
factory2.cloneNode(name),
|
|
109783
|
-
factory2.createPropertyAccessExpression(
|
|
109784
|
-
factory2.getGeneratedNameForNode(((_b = (_a = importDeclaration.parent) == null ? void 0 : _a.parent) == null ? void 0 : _b.parent) || importDeclaration),
|
|
109785
|
-
factory2.cloneNode(importDeclaration.propertyName || importDeclaration.name)
|
|
109786
|
-
)
|
|
109894
|
+
importedName.kind === 11 /* StringLiteral */ ? factory2.createElementAccessExpression(target, factory2.cloneNode(importedName)) : factory2.createPropertyAccessExpression(target, factory2.cloneNode(importedName))
|
|
109787
109895
|
),
|
|
109788
109896
|
/*location*/
|
|
109789
109897
|
node
|
|
@@ -109826,11 +109934,10 @@ function transformSystemModule(context) {
|
|
|
109826
109934
|
node
|
|
109827
109935
|
);
|
|
109828
109936
|
} else if (isImportSpecifier(importDeclaration)) {
|
|
109937
|
+
const importedName = importDeclaration.propertyName || importDeclaration.name;
|
|
109938
|
+
const target = factory2.getGeneratedNameForNode(((_b = (_a = importDeclaration.parent) == null ? void 0 : _a.parent) == null ? void 0 : _b.parent) || importDeclaration);
|
|
109829
109939
|
return setTextRange(
|
|
109830
|
-
factory2.createPropertyAccessExpression(
|
|
109831
|
-
factory2.getGeneratedNameForNode(((_b = (_a = importDeclaration.parent) == null ? void 0 : _a.parent) == null ? void 0 : _b.parent) || importDeclaration),
|
|
109832
|
-
factory2.cloneNode(importDeclaration.propertyName || importDeclaration.name)
|
|
109833
|
-
),
|
|
109940
|
+
importedName.kind === 11 /* StringLiteral */ ? factory2.createElementAccessExpression(target, factory2.cloneNode(importedName)) : factory2.createPropertyAccessExpression(target, factory2.cloneNode(importedName)),
|
|
109834
109941
|
/*location*/
|
|
109835
109942
|
node
|
|
109836
109943
|
);
|
|
@@ -111421,15 +111528,17 @@ function transformDeclarations(context) {
|
|
|
111421
111528
|
if (isDeclarationAndNotVisible(input)) return;
|
|
111422
111529
|
if (hasDynamicName(input)) {
|
|
111423
111530
|
if (isolatedDeclarations) {
|
|
111424
|
-
if (
|
|
111425
|
-
|
|
111426
|
-
|
|
111427
|
-
|
|
111428
|
-
|
|
111429
|
-
|
|
111430
|
-
|
|
111431
|
-
|
|
111432
|
-
|
|
111531
|
+
if (!resolver.isDefinitelyReferenceToGlobalSymbolObject(input.name.expression)) {
|
|
111532
|
+
if (isClassDeclaration(input.parent) || isObjectLiteralExpression(input.parent)) {
|
|
111533
|
+
context.addDiagnostic(createDiagnosticForNode(input, Diagnostics.Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations));
|
|
111534
|
+
return;
|
|
111535
|
+
} else if (
|
|
111536
|
+
// Type declarations just need to double-check that the input computed name is an entity name expression
|
|
111537
|
+
(isInterfaceDeclaration(input.parent) || isTypeLiteralNode(input.parent)) && !isEntityNameExpression(input.name.expression)
|
|
111538
|
+
) {
|
|
111539
|
+
context.addDiagnostic(createDiagnosticForNode(input, Diagnostics.Computed_properties_must_be_number_or_string_literals_variables_or_dotted_expressions_with_isolatedDeclarations));
|
|
111540
|
+
return;
|
|
111541
|
+
}
|
|
111433
111542
|
}
|
|
111434
111543
|
} else if (!resolver.isLateBound(getParseTreeNode(input)) || !isEntityNameExpression(input.name.expression)) {
|
|
111435
111544
|
return;
|
|
@@ -113045,10 +113154,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
113045
113154
|
emitSkipped = true;
|
|
113046
113155
|
return;
|
|
113047
113156
|
}
|
|
113048
|
-
const buildInfo = host.getBuildInfo() ||
|
|
113049
|
-
/*program*/
|
|
113050
|
-
void 0
|
|
113051
|
-
);
|
|
113157
|
+
const buildInfo = host.getBuildInfo() || { version };
|
|
113052
113158
|
writeFile(
|
|
113053
113159
|
host,
|
|
113054
113160
|
emitterDiagnostics,
|
|
@@ -113331,9 +113437,6 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
113331
113437
|
return encodeURI(sourceMapFile);
|
|
113332
113438
|
}
|
|
113333
113439
|
}
|
|
113334
|
-
function createBuildInfo(program) {
|
|
113335
|
-
return { program, version };
|
|
113336
|
-
}
|
|
113337
113440
|
function getBuildInfoText(buildInfo) {
|
|
113338
113441
|
return JSON.stringify(buildInfo);
|
|
113339
113442
|
}
|
|
@@ -113378,7 +113481,8 @@ var notImplementedResolver = {
|
|
|
113378
113481
|
getJsxFragmentFactoryEntity: notImplemented,
|
|
113379
113482
|
isBindingCapturedByNode: notImplemented,
|
|
113380
113483
|
getDeclarationStatementsForSourceFile: notImplemented,
|
|
113381
|
-
isImportRequiredByAugmentation: notImplemented
|
|
113484
|
+
isImportRequiredByAugmentation: notImplemented,
|
|
113485
|
+
isDefinitelyReferenceToGlobalSymbolObject: notImplemented
|
|
113382
113486
|
};
|
|
113383
113487
|
var createPrinterWithDefaults = /* @__PURE__ */ memoize(() => createPrinter({}));
|
|
113384
113488
|
var createPrinterWithRemoveComments = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true }));
|
|
@@ -118113,7 +118217,7 @@ function isIgnoredFileFromWildCardWatching({
|
|
|
118113
118217
|
}
|
|
118114
118218
|
return false;
|
|
118115
118219
|
function hasSourceFile(file) {
|
|
118116
|
-
return realProgram ? !!realProgram.getSourceFileByPath(file) : builderProgram ? builderProgram.
|
|
118220
|
+
return realProgram ? !!realProgram.getSourceFileByPath(file) : builderProgram ? builderProgram.state.fileInfos.has(file) : !!find(program, (rootFile) => toPath3(rootFile) === file);
|
|
118117
118221
|
}
|
|
118118
118222
|
function isSupportedScriptKind() {
|
|
118119
118223
|
if (!getScriptKind) return false;
|
|
@@ -118134,9 +118238,6 @@ function isIgnoredFileFromWildCardWatching({
|
|
|
118134
118238
|
}
|
|
118135
118239
|
}
|
|
118136
118240
|
}
|
|
118137
|
-
function isBuilderProgram(program) {
|
|
118138
|
-
return !!program.getState;
|
|
118139
|
-
}
|
|
118140
118241
|
function isEmittedFileOfProgram(program, file) {
|
|
118141
118242
|
if (!program) {
|
|
118142
118243
|
return false;
|
|
@@ -122694,6 +122795,13 @@ var BuilderState;
|
|
|
122694
122795
|
})(BuilderState || (BuilderState = {}));
|
|
122695
122796
|
|
|
122696
122797
|
// src/compiler/builder.ts
|
|
122798
|
+
function isBuilderProgramStateWithDefinedProgram(state) {
|
|
122799
|
+
return state.program !== void 0;
|
|
122800
|
+
}
|
|
122801
|
+
function toBuilderProgramStateWithDefinedProgram(state) {
|
|
122802
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
122803
|
+
return state;
|
|
122804
|
+
}
|
|
122697
122805
|
function getBuilderFileEmit(options) {
|
|
122698
122806
|
let result = 1 /* Js */;
|
|
122699
122807
|
if (options.sourceMap) result = result | 2 /* JsMap */;
|
|
@@ -122958,7 +123066,11 @@ function getNextAffectedFile(state, cancellationToken, host) {
|
|
|
122958
123066
|
const affectedFile = affectedFiles[affectedFilesIndex];
|
|
122959
123067
|
if (!seenAffectedFiles.has(affectedFile.resolvedPath)) {
|
|
122960
123068
|
state.affectedFilesIndex = affectedFilesIndex;
|
|
122961
|
-
addToAffectedFilesPendingEmit(
|
|
123069
|
+
addToAffectedFilesPendingEmit(
|
|
123070
|
+
state,
|
|
123071
|
+
affectedFile.resolvedPath,
|
|
123072
|
+
getBuilderFileEmit(state.compilerOptions)
|
|
123073
|
+
);
|
|
122962
123074
|
handleDtsMayChangeOfAffectedFile(
|
|
122963
123075
|
state,
|
|
122964
123076
|
affectedFile,
|
|
@@ -122978,12 +123090,11 @@ function getNextAffectedFile(state, cancellationToken, host) {
|
|
|
122978
123090
|
if (nextKey.done) {
|
|
122979
123091
|
return void 0;
|
|
122980
123092
|
}
|
|
122981
|
-
const
|
|
122982
|
-
|
|
122983
|
-
if (compilerOptions.outFile) return program;
|
|
123093
|
+
const compilerOptions = state.program.getCompilerOptions();
|
|
123094
|
+
if (compilerOptions.outFile) return state.program;
|
|
122984
123095
|
state.affectedFiles = BuilderState.getFilesAffectedByWithOldState(
|
|
122985
123096
|
state,
|
|
122986
|
-
program,
|
|
123097
|
+
state.program,
|
|
122987
123098
|
nextKey.value,
|
|
122988
123099
|
cancellationToken,
|
|
122989
123100
|
host
|
|
@@ -123044,9 +123155,8 @@ function getNextPendingEmitDiagnosticsFile(state) {
|
|
|
123044
123155
|
function removeDiagnosticsOfLibraryFiles(state) {
|
|
123045
123156
|
if (!state.cleanedDiagnosticsOfLibFiles) {
|
|
123046
123157
|
state.cleanedDiagnosticsOfLibFiles = true;
|
|
123047
|
-
const
|
|
123048
|
-
|
|
123049
|
-
forEach(program.getSourceFiles(), (f) => program.isSourceFileDefaultLibrary(f) && !skipTypeChecking(f, options, program) && removeSemanticDiagnosticsOf(state, f.resolvedPath));
|
|
123158
|
+
const options = state.program.getCompilerOptions();
|
|
123159
|
+
forEach(state.program.getSourceFiles(), (f) => state.program.isSourceFileDefaultLibrary(f) && !skipTypeChecking(f, options, state.program) && removeSemanticDiagnosticsOf(state, f.resolvedPath));
|
|
123050
123160
|
}
|
|
123051
123161
|
}
|
|
123052
123162
|
function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, host) {
|
|
@@ -123055,7 +123165,7 @@ function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken
|
|
|
123055
123165
|
removeDiagnosticsOfLibraryFiles(state);
|
|
123056
123166
|
BuilderState.updateShapeSignature(
|
|
123057
123167
|
state,
|
|
123058
|
-
|
|
123168
|
+
state.program,
|
|
123059
123169
|
affectedFile,
|
|
123060
123170
|
cancellationToken,
|
|
123061
123171
|
host
|
|
@@ -123073,12 +123183,11 @@ function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken
|
|
|
123073
123183
|
function handleDtsMayChangeOf(state, path, invalidateJsFiles, cancellationToken, host) {
|
|
123074
123184
|
removeSemanticDiagnosticsOf(state, path);
|
|
123075
123185
|
if (!state.changedFilesSet.has(path)) {
|
|
123076
|
-
const
|
|
123077
|
-
const sourceFile = program.getSourceFileByPath(path);
|
|
123186
|
+
const sourceFile = state.program.getSourceFileByPath(path);
|
|
123078
123187
|
if (sourceFile) {
|
|
123079
123188
|
BuilderState.updateShapeSignature(
|
|
123080
123189
|
state,
|
|
123081
|
-
program,
|
|
123190
|
+
state.program,
|
|
123082
123191
|
sourceFile,
|
|
123083
123192
|
cancellationToken,
|
|
123084
123193
|
host,
|
|
@@ -123086,9 +123195,17 @@ function handleDtsMayChangeOf(state, path, invalidateJsFiles, cancellationToken,
|
|
|
123086
123195
|
true
|
|
123087
123196
|
);
|
|
123088
123197
|
if (invalidateJsFiles) {
|
|
123089
|
-
addToAffectedFilesPendingEmit(
|
|
123198
|
+
addToAffectedFilesPendingEmit(
|
|
123199
|
+
state,
|
|
123200
|
+
path,
|
|
123201
|
+
getBuilderFileEmit(state.compilerOptions)
|
|
123202
|
+
);
|
|
123090
123203
|
} else if (getEmitDeclarations(state.compilerOptions)) {
|
|
123091
|
-
addToAffectedFilesPendingEmit(
|
|
123204
|
+
addToAffectedFilesPendingEmit(
|
|
123205
|
+
state,
|
|
123206
|
+
path,
|
|
123207
|
+
state.compilerOptions.declarationMap ? 24 /* AllDts */ : 8 /* Dts */
|
|
123208
|
+
);
|
|
123092
123209
|
}
|
|
123093
123210
|
}
|
|
123094
123211
|
}
|
|
@@ -123155,7 +123272,7 @@ function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile
|
|
|
123155
123272
|
host
|
|
123156
123273
|
);
|
|
123157
123274
|
if (isChangedSignature(state, currentPath)) {
|
|
123158
|
-
const currentSourceFile =
|
|
123275
|
+
const currentSourceFile = state.program.getSourceFileByPath(currentPath);
|
|
123159
123276
|
queue.push(...BuilderState.getReferencedByPaths(state, currentSourceFile.resolvedPath));
|
|
123160
123277
|
}
|
|
123161
123278
|
}
|
|
@@ -123204,7 +123321,7 @@ function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, invalidateJsF
|
|
|
123204
123321
|
function getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken, semanticDiagnosticsPerFile) {
|
|
123205
123322
|
return concatenate(
|
|
123206
123323
|
getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationToken, semanticDiagnosticsPerFile),
|
|
123207
|
-
|
|
123324
|
+
state.program.getProgramDiagnostics(sourceFile)
|
|
123208
123325
|
);
|
|
123209
123326
|
}
|
|
123210
123327
|
function getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationToken, semanticDiagnosticsPerFile) {
|
|
@@ -123214,17 +123331,20 @@ function getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationTok
|
|
|
123214
123331
|
if (cachedDiagnostics) {
|
|
123215
123332
|
return filterSemanticDiagnostics(cachedDiagnostics, state.compilerOptions);
|
|
123216
123333
|
}
|
|
123217
|
-
const diagnostics =
|
|
123334
|
+
const diagnostics = state.program.getBindAndCheckDiagnostics(sourceFile, cancellationToken);
|
|
123218
123335
|
semanticDiagnosticsPerFile.set(path, diagnostics);
|
|
123219
123336
|
return filterSemanticDiagnostics(diagnostics, state.compilerOptions);
|
|
123220
123337
|
}
|
|
123221
|
-
function
|
|
123338
|
+
function isIncrementalBundleEmitBuildInfo(info) {
|
|
123222
123339
|
var _a;
|
|
123223
123340
|
return !!((_a = info.options) == null ? void 0 : _a.outFile);
|
|
123224
123341
|
}
|
|
123342
|
+
function isIncrementalBuildInfo(info) {
|
|
123343
|
+
return !!info.fileNames;
|
|
123344
|
+
}
|
|
123225
123345
|
function getBuildInfo2(state) {
|
|
123226
123346
|
var _a, _b;
|
|
123227
|
-
const currentDirectory =
|
|
123347
|
+
const currentDirectory = state.program.getCurrentDirectory();
|
|
123228
123348
|
const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(state.compilerOptions), currentDirectory));
|
|
123229
123349
|
const latestChangedDtsFile = state.latestChangedDtsFile ? relativeToBuildInfoEnsuringAbsolutePath(state.latestChangedDtsFile) : void 0;
|
|
123230
123350
|
const fileNames = [];
|
|
@@ -123237,14 +123357,14 @@ function getBuildInfo2(state) {
|
|
|
123237
123357
|
tryAddRoot(key, fileId);
|
|
123238
123358
|
return value.impliedFormat ? { version: value.version, impliedFormat: value.impliedFormat, signature: void 0, affectsGlobalScope: void 0 } : value.version;
|
|
123239
123359
|
});
|
|
123240
|
-
|
|
123360
|
+
return {
|
|
123241
123361
|
fileNames,
|
|
123242
123362
|
fileInfos: fileInfos2,
|
|
123243
123363
|
root,
|
|
123244
123364
|
resolvedRoot: toResolvedRoot(),
|
|
123245
|
-
options:
|
|
123246
|
-
semanticDiagnosticsPerFile:
|
|
123247
|
-
emitDiagnosticsPerFile:
|
|
123365
|
+
options: toIncrementalBuildInfoCompilerOptions(state.compilerOptions),
|
|
123366
|
+
semanticDiagnosticsPerFile: toIncrementalBuildInfoDiagnostics(),
|
|
123367
|
+
emitDiagnosticsPerFile: toIncrementalBuildInfoEmitDiagnostics(),
|
|
123248
123368
|
changeFileSet: toChangeFileSet(),
|
|
123249
123369
|
outSignature: state.outSignature,
|
|
123250
123370
|
latestChangedDtsFile,
|
|
@@ -123254,10 +123374,10 @@ function getBuildInfo2(state) {
|
|
|
123254
123374
|
// Pending emit is same as deteremined by compilerOptions
|
|
123255
123375
|
state.programEmitPending
|
|
123256
123376
|
)
|
|
123257
|
-
)
|
|
123377
|
+
),
|
|
123258
123378
|
// Actual value
|
|
123379
|
+
version
|
|
123259
123380
|
};
|
|
123260
|
-
return createBuildInfo(program2);
|
|
123261
123381
|
}
|
|
123262
123382
|
let fileIdsList;
|
|
123263
123383
|
let fileNamesToFileIdListId;
|
|
@@ -123312,7 +123432,7 @@ function getBuildInfo2(state) {
|
|
|
123312
123432
|
toFileIdListId(state.referencedMap.getValues(key))
|
|
123313
123433
|
]);
|
|
123314
123434
|
}
|
|
123315
|
-
const semanticDiagnosticsPerFile =
|
|
123435
|
+
const semanticDiagnosticsPerFile = toIncrementalBuildInfoDiagnostics();
|
|
123316
123436
|
let affectedFilesPendingEmit;
|
|
123317
123437
|
if ((_b = state.affectedFilesPendingEmit) == null ? void 0 : _b.size) {
|
|
123318
123438
|
const fullEmitForOptions = getBuilderFileEmit(state.compilerOptions);
|
|
@@ -123336,22 +123456,22 @@ function getBuildInfo2(state) {
|
|
|
123336
123456
|
}
|
|
123337
123457
|
}
|
|
123338
123458
|
}
|
|
123339
|
-
|
|
123459
|
+
return {
|
|
123340
123460
|
fileNames,
|
|
123461
|
+
fileIdsList,
|
|
123341
123462
|
fileInfos,
|
|
123342
123463
|
root,
|
|
123343
123464
|
resolvedRoot: toResolvedRoot(),
|
|
123344
|
-
options:
|
|
123345
|
-
fileIdsList,
|
|
123465
|
+
options: toIncrementalBuildInfoCompilerOptions(state.compilerOptions),
|
|
123346
123466
|
referencedMap,
|
|
123347
123467
|
semanticDiagnosticsPerFile,
|
|
123348
|
-
emitDiagnosticsPerFile:
|
|
123468
|
+
emitDiagnosticsPerFile: toIncrementalBuildInfoEmitDiagnostics(),
|
|
123349
123469
|
affectedFilesPendingEmit,
|
|
123350
123470
|
changeFileSet: toChangeFileSet(),
|
|
123351
123471
|
emitSignatures,
|
|
123352
|
-
latestChangedDtsFile
|
|
123472
|
+
latestChangedDtsFile,
|
|
123473
|
+
version
|
|
123353
123474
|
};
|
|
123354
|
-
return createBuildInfo(program);
|
|
123355
123475
|
function relativeToBuildInfoEnsuringAbsolutePath(path) {
|
|
123356
123476
|
return relativeToBuildInfo(getNormalizedAbsolutePath(path, currentDirectory));
|
|
123357
123477
|
}
|
|
@@ -123399,13 +123519,13 @@ function getBuildInfo2(state) {
|
|
|
123399
123519
|
});
|
|
123400
123520
|
return result;
|
|
123401
123521
|
}
|
|
123402
|
-
function
|
|
123522
|
+
function toIncrementalBuildInfoCompilerOptions(options) {
|
|
123403
123523
|
let result;
|
|
123404
123524
|
const { optionsNameMap } = getOptionsNameMap();
|
|
123405
123525
|
for (const name of getOwnKeys(options).sort(compareStringsCaseSensitive)) {
|
|
123406
123526
|
const optionInfo = optionsNameMap.get(name.toLowerCase());
|
|
123407
123527
|
if (optionInfo == null ? void 0 : optionInfo.affectsBuildInfo) {
|
|
123408
|
-
(result || (result = {}))[name] =
|
|
123528
|
+
(result || (result = {}))[name] = toReusableCompilerOptionValue(
|
|
123409
123529
|
optionInfo,
|
|
123410
123530
|
options[name]
|
|
123411
123531
|
);
|
|
@@ -123413,7 +123533,7 @@ function getBuildInfo2(state) {
|
|
|
123413
123533
|
}
|
|
123414
123534
|
return result;
|
|
123415
123535
|
}
|
|
123416
|
-
function
|
|
123536
|
+
function toReusableCompilerOptionValue(option, value) {
|
|
123417
123537
|
if (option) {
|
|
123418
123538
|
Debug.assert(option.type !== "listOrElement");
|
|
123419
123539
|
if (option.type === "list") {
|
|
@@ -123427,7 +123547,7 @@ function getBuildInfo2(state) {
|
|
|
123427
123547
|
}
|
|
123428
123548
|
return value;
|
|
123429
123549
|
}
|
|
123430
|
-
function
|
|
123550
|
+
function toIncrementalBuildInfoDiagnostics() {
|
|
123431
123551
|
let result;
|
|
123432
123552
|
state.fileInfos.forEach((_value, key) => {
|
|
123433
123553
|
const value = state.semanticDiagnosticsPerFile.get(key);
|
|
@@ -123436,13 +123556,13 @@ function getBuildInfo2(state) {
|
|
|
123436
123556
|
} else if (value.length) {
|
|
123437
123557
|
result = append(result, [
|
|
123438
123558
|
toFileId(key),
|
|
123439
|
-
|
|
123559
|
+
toReusableDiagnostic(value, key)
|
|
123440
123560
|
]);
|
|
123441
123561
|
}
|
|
123442
123562
|
});
|
|
123443
123563
|
return result;
|
|
123444
123564
|
}
|
|
123445
|
-
function
|
|
123565
|
+
function toIncrementalBuildInfoEmitDiagnostics() {
|
|
123446
123566
|
var _a2;
|
|
123447
123567
|
let result;
|
|
123448
123568
|
if (!((_a2 = state.emitDiagnosticsPerFile) == null ? void 0 : _a2.size)) return result;
|
|
@@ -123450,51 +123570,51 @@ function getBuildInfo2(state) {
|
|
|
123450
123570
|
const value = state.emitDiagnosticsPerFile.get(key);
|
|
123451
123571
|
result = append(result, [
|
|
123452
123572
|
toFileId(key),
|
|
123453
|
-
|
|
123573
|
+
toReusableDiagnostic(value, key)
|
|
123454
123574
|
]);
|
|
123455
123575
|
}
|
|
123456
123576
|
return result;
|
|
123457
123577
|
}
|
|
123458
|
-
function
|
|
123578
|
+
function toReusableDiagnostic(diagnostics, diagnosticFilePath) {
|
|
123459
123579
|
Debug.assert(!!diagnostics.length);
|
|
123460
123580
|
return diagnostics.map((diagnostic) => {
|
|
123461
|
-
const result =
|
|
123581
|
+
const result = toReusableDiagnosticRelatedInformation(diagnostic, diagnosticFilePath);
|
|
123462
123582
|
result.reportsUnnecessary = diagnostic.reportsUnnecessary;
|
|
123463
123583
|
result.reportDeprecated = diagnostic.reportsDeprecated;
|
|
123464
123584
|
result.source = diagnostic.source;
|
|
123465
123585
|
result.skippedOn = diagnostic.skippedOn;
|
|
123466
123586
|
const { relatedInformation } = diagnostic;
|
|
123467
|
-
result.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map((r) =>
|
|
123587
|
+
result.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map((r) => toReusableDiagnosticRelatedInformation(r, diagnosticFilePath)) : [] : void 0;
|
|
123468
123588
|
return result;
|
|
123469
123589
|
});
|
|
123470
123590
|
}
|
|
123471
|
-
function
|
|
123591
|
+
function toReusableDiagnosticRelatedInformation(diagnostic, diagnosticFilePath) {
|
|
123472
123592
|
const { file } = diagnostic;
|
|
123473
123593
|
return {
|
|
123474
123594
|
...diagnostic,
|
|
123475
123595
|
file: file ? file.resolvedPath === diagnosticFilePath ? void 0 : relativeToBuildInfo(file.resolvedPath) : false,
|
|
123476
|
-
messageText: isString(diagnostic.messageText) ? diagnostic.messageText :
|
|
123596
|
+
messageText: isString(diagnostic.messageText) ? diagnostic.messageText : toReusableDiagnosticMessageChain(diagnostic.messageText)
|
|
123477
123597
|
};
|
|
123478
123598
|
}
|
|
123479
|
-
function
|
|
123599
|
+
function toReusableDiagnosticMessageChain(chain) {
|
|
123480
123600
|
if (chain.repopulateInfo) {
|
|
123481
123601
|
return {
|
|
123482
123602
|
info: chain.repopulateInfo(),
|
|
123483
|
-
next:
|
|
123603
|
+
next: toReusableDiagnosticMessageChainArray(chain.next)
|
|
123484
123604
|
};
|
|
123485
123605
|
}
|
|
123486
|
-
const next =
|
|
123606
|
+
const next = toReusableDiagnosticMessageChainArray(chain.next);
|
|
123487
123607
|
return next === chain.next ? chain : { ...chain, next };
|
|
123488
123608
|
}
|
|
123489
|
-
function
|
|
123609
|
+
function toReusableDiagnosticMessageChainArray(array) {
|
|
123490
123610
|
if (!array) return array;
|
|
123491
123611
|
return forEach(array, (chain, index) => {
|
|
123492
|
-
const reusable =
|
|
123612
|
+
const reusable = toReusableDiagnosticMessageChain(chain);
|
|
123493
123613
|
if (chain === reusable) return void 0;
|
|
123494
123614
|
const result = index > 0 ? array.slice(0, index - 1) : [];
|
|
123495
123615
|
result.push(reusable);
|
|
123496
123616
|
for (let i = index + 1; i < array.length; i++) {
|
|
123497
|
-
result.push(
|
|
123617
|
+
result.push(toReusableDiagnosticMessageChain(array[i]));
|
|
123498
123618
|
}
|
|
123499
123619
|
return result;
|
|
123500
123620
|
}) || array;
|
|
@@ -123566,24 +123686,27 @@ function computeSignature(text, host, data) {
|
|
|
123566
123686
|
return (host.createHash ?? generateDjb2Hash)(getTextHandlingSourceMapForSignature(text, data));
|
|
123567
123687
|
}
|
|
123568
123688
|
function createBuilderProgram(kind, { newProgram, host, oldProgram, configFileParsingDiagnostics }) {
|
|
123569
|
-
let oldState = oldProgram && oldProgram.
|
|
123689
|
+
let oldState = oldProgram && oldProgram.state;
|
|
123570
123690
|
if (oldState && newProgram === oldState.program && configFileParsingDiagnostics === newProgram.getConfigFileParsingDiagnostics()) {
|
|
123571
123691
|
newProgram = void 0;
|
|
123572
123692
|
oldState = void 0;
|
|
123573
123693
|
return oldProgram;
|
|
123574
123694
|
}
|
|
123575
123695
|
const state = createBuilderProgramState(newProgram, oldState);
|
|
123576
|
-
newProgram.getBuildInfo = () => getBuildInfo2(state);
|
|
123696
|
+
newProgram.getBuildInfo = () => getBuildInfo2(toBuilderProgramStateWithDefinedProgram(state));
|
|
123577
123697
|
newProgram = void 0;
|
|
123578
123698
|
oldProgram = void 0;
|
|
123579
123699
|
oldState = void 0;
|
|
123580
|
-
const
|
|
123581
|
-
|
|
123582
|
-
builderProgram.getState = getState;
|
|
123700
|
+
const builderProgram = createRedirectedBuilderProgram(state, configFileParsingDiagnostics);
|
|
123701
|
+
builderProgram.state = state;
|
|
123583
123702
|
builderProgram.saveEmitState = () => backupBuilderProgramEmitState(state);
|
|
123584
123703
|
builderProgram.restoreEmitState = (saved) => restoreBuilderProgramEmitState(state, saved);
|
|
123585
123704
|
builderProgram.hasChangedEmitSignature = () => !!state.hasChangedEmitSignature;
|
|
123586
|
-
builderProgram.getAllDependencies = (sourceFile) => BuilderState.getAllDependencies(
|
|
123705
|
+
builderProgram.getAllDependencies = (sourceFile) => BuilderState.getAllDependencies(
|
|
123706
|
+
state,
|
|
123707
|
+
Debug.checkDefined(state.program),
|
|
123708
|
+
sourceFile
|
|
123709
|
+
);
|
|
123587
123710
|
builderProgram.getSemanticDiagnostics = getSemanticDiagnostics;
|
|
123588
123711
|
builderProgram.emit = emit;
|
|
123589
123712
|
builderProgram.releaseProgram = () => releaseCache(state);
|
|
@@ -123598,8 +123721,12 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123598
123721
|
}
|
|
123599
123722
|
return builderProgram;
|
|
123600
123723
|
function emitBuildInfo(writeFile2, cancellationToken) {
|
|
123724
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
123601
123725
|
if (state.buildInfoEmitPending) {
|
|
123602
|
-
const result =
|
|
123726
|
+
const result = state.program.emitBuildInfo(
|
|
123727
|
+
writeFile2 || maybeBind(host, host.writeFile),
|
|
123728
|
+
cancellationToken
|
|
123729
|
+
);
|
|
123603
123730
|
state.buildInfoEmitPending = false;
|
|
123604
123731
|
return result;
|
|
123605
123732
|
}
|
|
@@ -123607,6 +123734,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123607
123734
|
}
|
|
123608
123735
|
function emitNextAffectedFile(writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers) {
|
|
123609
123736
|
var _a, _b, _c, _d;
|
|
123737
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
123610
123738
|
let affected = getNextAffectedFile(state, cancellationToken, host);
|
|
123611
123739
|
const programEmitKind = getBuilderFileEmit(state.compilerOptions);
|
|
123612
123740
|
let emitKind = emitOnlyDtsFiles ? programEmitKind & 24 /* AllDts */ : programEmitKind;
|
|
@@ -123647,7 +123775,10 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123647
123775
|
if (!affected) {
|
|
123648
123776
|
if (!state.buildInfoEmitPending) return void 0;
|
|
123649
123777
|
const affected2 = state.program;
|
|
123650
|
-
const result2 = affected2.emitBuildInfo(
|
|
123778
|
+
const result2 = affected2.emitBuildInfo(
|
|
123779
|
+
writeFile2 || maybeBind(host, host.writeFile),
|
|
123780
|
+
cancellationToken
|
|
123781
|
+
);
|
|
123651
123782
|
state.buildInfoEmitPending = false;
|
|
123652
123783
|
return { result: result2, affected: affected2 };
|
|
123653
123784
|
}
|
|
@@ -123695,6 +123826,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123695
123826
|
return { result, affected };
|
|
123696
123827
|
}
|
|
123697
123828
|
function getWriteFileCallback(writeFile2, customTransformers) {
|
|
123829
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
123698
123830
|
if (!getEmitDeclarations(state.compilerOptions)) return writeFile2 || maybeBind(host, host.writeFile);
|
|
123699
123831
|
return (fileName, text, writeByteOrderMark, onError, sourceFiles, data) => {
|
|
123700
123832
|
var _a, _b, _c;
|
|
@@ -123761,6 +123893,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123761
123893
|
};
|
|
123762
123894
|
}
|
|
123763
123895
|
function emit(targetSourceFile, writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers) {
|
|
123896
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
123764
123897
|
if (kind === 1 /* EmitAndSemanticDiagnosticsBuilderProgram */) {
|
|
123765
123898
|
assertSourceFileOkWithoutNextAffectedCall(state, targetSourceFile);
|
|
123766
123899
|
}
|
|
@@ -123773,7 +123906,12 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123773
123906
|
let diagnostics;
|
|
123774
123907
|
let emittedFiles = [];
|
|
123775
123908
|
let affectedEmitResult;
|
|
123776
|
-
while (affectedEmitResult = emitNextAffectedFile(
|
|
123909
|
+
while (affectedEmitResult = emitNextAffectedFile(
|
|
123910
|
+
writeFile2,
|
|
123911
|
+
cancellationToken,
|
|
123912
|
+
emitOnlyDtsFiles,
|
|
123913
|
+
customTransformers
|
|
123914
|
+
)) {
|
|
123777
123915
|
emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped;
|
|
123778
123916
|
diagnostics = addRange(diagnostics, affectedEmitResult.result.diagnostics);
|
|
123779
123917
|
emittedFiles = addRange(emittedFiles, affectedEmitResult.result.emittedFiles);
|
|
@@ -123789,7 +123927,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123789
123927
|
clearAffectedFilesPendingEmit(state, emitOnlyDtsFiles);
|
|
123790
123928
|
}
|
|
123791
123929
|
}
|
|
123792
|
-
return
|
|
123930
|
+
return state.program.emit(
|
|
123793
123931
|
targetSourceFile,
|
|
123794
123932
|
getWriteFileCallback(writeFile2, customTransformers),
|
|
123795
123933
|
cancellationToken,
|
|
@@ -123798,6 +123936,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123798
123936
|
);
|
|
123799
123937
|
}
|
|
123800
123938
|
function getSemanticDiagnosticsOfNextAffectedFile(cancellationToken, ignoreSourceFile) {
|
|
123939
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
123801
123940
|
while (true) {
|
|
123802
123941
|
const affected = getNextAffectedFile(state, cancellationToken, host);
|
|
123803
123942
|
let result;
|
|
@@ -123835,6 +123974,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123835
123974
|
}
|
|
123836
123975
|
}
|
|
123837
123976
|
function getSemanticDiagnostics(sourceFile, cancellationToken) {
|
|
123977
|
+
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
123838
123978
|
assertSourceFileOkWithoutNextAffectedCall(state, sourceFile);
|
|
123839
123979
|
if (sourceFile) {
|
|
123840
123980
|
return getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken);
|
|
@@ -123845,7 +123985,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
123845
123985
|
if (affectedResult.affected === state.program) return affectedResult.result;
|
|
123846
123986
|
}
|
|
123847
123987
|
let diagnostics;
|
|
123848
|
-
for (const sourceFile2 of
|
|
123988
|
+
for (const sourceFile2 of state.program.getSourceFiles()) {
|
|
123849
123989
|
diagnostics = addRange(diagnostics, getSemanticDiagnosticsOfFile(state, sourceFile2, cancellationToken));
|
|
123850
123990
|
}
|
|
123851
123991
|
return diagnostics || emptyArray;
|
|
@@ -123866,43 +124006,42 @@ function toBuilderFileEmit(value, fullEmitForOptions) {
|
|
|
123866
124006
|
function toProgramEmitPending(value, options) {
|
|
123867
124007
|
return !value ? getBuilderFileEmit(options || {}) : value;
|
|
123868
124008
|
}
|
|
123869
|
-
function
|
|
124009
|
+
function createBuilderProgramUsingIncrementalBuildInfo(buildInfo, buildInfoPath, host) {
|
|
123870
124010
|
var _a, _b, _c, _d;
|
|
123871
|
-
const program = buildInfo.program;
|
|
123872
124011
|
const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
|
|
123873
124012
|
const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames());
|
|
123874
124013
|
let state;
|
|
123875
|
-
const filePaths = (_a =
|
|
124014
|
+
const filePaths = (_a = buildInfo.fileNames) == null ? void 0 : _a.map(toPathInBuildInfoDirectory);
|
|
123876
124015
|
let filePathsSetList;
|
|
123877
|
-
const latestChangedDtsFile =
|
|
124016
|
+
const latestChangedDtsFile = buildInfo.latestChangedDtsFile ? toAbsolutePath(buildInfo.latestChangedDtsFile) : void 0;
|
|
123878
124017
|
const fileInfos = /* @__PURE__ */ new Map();
|
|
123879
|
-
const changedFilesSet = new Set(map(
|
|
123880
|
-
if (
|
|
123881
|
-
|
|
124018
|
+
const changedFilesSet = new Set(map(buildInfo.changeFileSet, toFilePath));
|
|
124019
|
+
if (isIncrementalBundleEmitBuildInfo(buildInfo)) {
|
|
124020
|
+
buildInfo.fileInfos.forEach((fileInfo, index) => {
|
|
123882
124021
|
const path = toFilePath(index + 1);
|
|
123883
124022
|
fileInfos.set(path, isString(fileInfo) ? { version: fileInfo, signature: void 0, affectsGlobalScope: void 0, impliedFormat: void 0 } : fileInfo);
|
|
123884
124023
|
});
|
|
123885
124024
|
state = {
|
|
123886
124025
|
fileInfos,
|
|
123887
|
-
compilerOptions:
|
|
123888
|
-
semanticDiagnosticsPerFile: toPerFileSemanticDiagnostics(
|
|
123889
|
-
emitDiagnosticsPerFile: toPerFileEmitDiagnostics(
|
|
124026
|
+
compilerOptions: buildInfo.options ? convertToOptionsWithAbsolutePaths(buildInfo.options, toAbsolutePath) : {},
|
|
124027
|
+
semanticDiagnosticsPerFile: toPerFileSemanticDiagnostics(buildInfo.semanticDiagnosticsPerFile),
|
|
124028
|
+
emitDiagnosticsPerFile: toPerFileEmitDiagnostics(buildInfo.emitDiagnosticsPerFile),
|
|
123890
124029
|
hasReusableDiagnostic: true,
|
|
123891
124030
|
changedFilesSet,
|
|
123892
124031
|
latestChangedDtsFile,
|
|
123893
|
-
outSignature:
|
|
123894
|
-
programEmitPending:
|
|
124032
|
+
outSignature: buildInfo.outSignature,
|
|
124033
|
+
programEmitPending: buildInfo.pendingEmit === void 0 ? void 0 : toProgramEmitPending(buildInfo.pendingEmit, buildInfo.options)
|
|
123895
124034
|
};
|
|
123896
124035
|
} else {
|
|
123897
|
-
filePathsSetList = (_b =
|
|
123898
|
-
const emitSignatures = ((_c =
|
|
123899
|
-
|
|
124036
|
+
filePathsSetList = (_b = buildInfo.fileIdsList) == null ? void 0 : _b.map((fileIds) => new Set(fileIds.map(toFilePath)));
|
|
124037
|
+
const emitSignatures = ((_c = buildInfo.options) == null ? void 0 : _c.composite) && !buildInfo.options.outFile ? /* @__PURE__ */ new Map() : void 0;
|
|
124038
|
+
buildInfo.fileInfos.forEach((fileInfo, index) => {
|
|
123900
124039
|
const path = toFilePath(index + 1);
|
|
123901
124040
|
const stateFileInfo = toBuilderStateFileInfoForMultiEmit(fileInfo);
|
|
123902
124041
|
fileInfos.set(path, stateFileInfo);
|
|
123903
124042
|
if (emitSignatures && stateFileInfo.signature) emitSignatures.set(path, stateFileInfo.signature);
|
|
123904
124043
|
});
|
|
123905
|
-
(_d =
|
|
124044
|
+
(_d = buildInfo.emitSignatures) == null ? void 0 : _d.forEach((value) => {
|
|
123906
124045
|
if (isNumber(value)) emitSignatures.delete(toFilePath(value));
|
|
123907
124046
|
else {
|
|
123908
124047
|
const key = toFilePath(value[0]);
|
|
@@ -123915,22 +124054,22 @@ function createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, hos
|
|
|
123915
124054
|
);
|
|
123916
124055
|
}
|
|
123917
124056
|
});
|
|
123918
|
-
const fullEmitForOptions =
|
|
124057
|
+
const fullEmitForOptions = buildInfo.affectedFilesPendingEmit ? getBuilderFileEmit(buildInfo.options || {}) : void 0;
|
|
123919
124058
|
state = {
|
|
123920
124059
|
fileInfos,
|
|
123921
|
-
compilerOptions:
|
|
123922
|
-
referencedMap: toManyToManyPathMap(
|
|
123923
|
-
semanticDiagnosticsPerFile: toPerFileSemanticDiagnostics(
|
|
123924
|
-
emitDiagnosticsPerFile: toPerFileEmitDiagnostics(
|
|
124060
|
+
compilerOptions: buildInfo.options ? convertToOptionsWithAbsolutePaths(buildInfo.options, toAbsolutePath) : {},
|
|
124061
|
+
referencedMap: toManyToManyPathMap(buildInfo.referencedMap, buildInfo.options ?? {}),
|
|
124062
|
+
semanticDiagnosticsPerFile: toPerFileSemanticDiagnostics(buildInfo.semanticDiagnosticsPerFile),
|
|
124063
|
+
emitDiagnosticsPerFile: toPerFileEmitDiagnostics(buildInfo.emitDiagnosticsPerFile),
|
|
123925
124064
|
hasReusableDiagnostic: true,
|
|
123926
|
-
affectedFilesPendingEmit:
|
|
124065
|
+
affectedFilesPendingEmit: buildInfo.affectedFilesPendingEmit && arrayToMap(buildInfo.affectedFilesPendingEmit, (value) => toFilePath(isNumber(value) ? value : value[0]), (value) => toBuilderFileEmit(value, fullEmitForOptions)),
|
|
123927
124066
|
changedFilesSet,
|
|
123928
124067
|
latestChangedDtsFile,
|
|
123929
124068
|
emitSignatures: (emitSignatures == null ? void 0 : emitSignatures.size) ? emitSignatures : void 0
|
|
123930
124069
|
};
|
|
123931
124070
|
}
|
|
123932
124071
|
return {
|
|
123933
|
-
|
|
124072
|
+
state,
|
|
123934
124073
|
saveEmitState: noop,
|
|
123935
124074
|
restoreEmitState: noop,
|
|
123936
124075
|
getProgram: notImplemented,
|
|
@@ -124024,15 +124163,15 @@ function getBuildInfoFileVersionMap(program, buildInfoPath, host) {
|
|
|
124024
124163
|
}
|
|
124025
124164
|
}
|
|
124026
124165
|
}
|
|
124027
|
-
function createRedirectedBuilderProgram(
|
|
124166
|
+
function createRedirectedBuilderProgram(state, configFileParsingDiagnostics) {
|
|
124028
124167
|
return {
|
|
124029
|
-
|
|
124168
|
+
state: void 0,
|
|
124030
124169
|
saveEmitState: noop,
|
|
124031
124170
|
restoreEmitState: noop,
|
|
124032
124171
|
getProgram,
|
|
124033
|
-
getProgramOrUndefined: () =>
|
|
124034
|
-
releaseProgram: () =>
|
|
124035
|
-
getCompilerOptions: () =>
|
|
124172
|
+
getProgramOrUndefined: () => state.program,
|
|
124173
|
+
releaseProgram: () => state.program = void 0,
|
|
124174
|
+
getCompilerOptions: () => state.compilerOptions,
|
|
124036
124175
|
getSourceFile: (fileName) => getProgram().getSourceFile(fileName),
|
|
124037
124176
|
getSourceFiles: () => getProgram().getSourceFiles(),
|
|
124038
124177
|
getOptionsDiagnostics: (cancellationToken) => getProgram().getOptionsDiagnostics(cancellationToken),
|
|
@@ -124048,13 +124187,23 @@ function createRedirectedBuilderProgram(getState, configFileParsingDiagnostics)
|
|
|
124048
124187
|
close: noop
|
|
124049
124188
|
};
|
|
124050
124189
|
function getProgram() {
|
|
124051
|
-
return Debug.checkDefined(
|
|
124190
|
+
return Debug.checkDefined(state.program);
|
|
124052
124191
|
}
|
|
124053
124192
|
}
|
|
124054
124193
|
|
|
124055
124194
|
// src/compiler/builderPublic.ts
|
|
124056
124195
|
function createEmitAndSemanticDiagnosticsBuilderProgram(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) {
|
|
124057
|
-
return createBuilderProgram(
|
|
124196
|
+
return createBuilderProgram(
|
|
124197
|
+
1 /* EmitAndSemanticDiagnosticsBuilderProgram */,
|
|
124198
|
+
getBuilderCreationParameters(
|
|
124199
|
+
newProgramOrRootNames,
|
|
124200
|
+
hostOrOptions,
|
|
124201
|
+
oldProgramOrHost,
|
|
124202
|
+
configFileParsingDiagnosticsOrOldProgram,
|
|
124203
|
+
configFileParsingDiagnostics,
|
|
124204
|
+
projectReferences
|
|
124205
|
+
)
|
|
124206
|
+
);
|
|
124058
124207
|
}
|
|
124059
124208
|
|
|
124060
124209
|
// src/compiler/resolutionCache.ts
|
|
@@ -125326,13 +125475,13 @@ function createTabularErrorsDisplay(filesInError, host) {
|
|
|
125326
125475
|
});
|
|
125327
125476
|
return tabularData;
|
|
125328
125477
|
}
|
|
125329
|
-
function
|
|
125330
|
-
return !!program.
|
|
125478
|
+
function isBuilderProgram(program) {
|
|
125479
|
+
return !!program.state;
|
|
125331
125480
|
}
|
|
125332
125481
|
function listFiles(program, write) {
|
|
125333
125482
|
const options = program.getCompilerOptions();
|
|
125334
125483
|
if (options.explainFiles) {
|
|
125335
|
-
explainFiles(
|
|
125484
|
+
explainFiles(isBuilderProgram(program) ? program.getProgram() : program, write);
|
|
125336
125485
|
} else if (options.listFiles || options.listFilesOnly) {
|
|
125337
125486
|
forEach(program.getSourceFiles(), (file) => {
|
|
125338
125487
|
write(file.fileName);
|
|
@@ -125832,8 +125981,8 @@ function readBuilderProgram(compilerOptions, host) {
|
|
|
125832
125981
|
if (!content) return void 0;
|
|
125833
125982
|
buildInfo = getBuildInfo(buildInfoPath, content);
|
|
125834
125983
|
}
|
|
125835
|
-
if (!buildInfo || buildInfo.version !== version || !buildInfo
|
|
125836
|
-
return
|
|
125984
|
+
if (!buildInfo || buildInfo.version !== version || !isIncrementalBuildInfo(buildInfo)) return void 0;
|
|
125985
|
+
return createBuilderProgramUsingIncrementalBuildInfo(buildInfo, buildInfoPath, host);
|
|
125837
125986
|
}
|
|
125838
125987
|
function createIncrementalCompilerHost(options, system = sys) {
|
|
125839
125988
|
const host = createCompilerHostWorker(
|
|
@@ -127548,7 +127697,7 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
127548
127697
|
let oldestOutputFileName;
|
|
127549
127698
|
let oldestOutputFileTime = maximumDate;
|
|
127550
127699
|
let buildInfoTime;
|
|
127551
|
-
let
|
|
127700
|
+
let incrementalBuildInfo;
|
|
127552
127701
|
let buildInfoVersionMap;
|
|
127553
127702
|
if (buildInfoPath) {
|
|
127554
127703
|
const buildInfoCacheEntry2 = getBuildInfoCacheEntry(state, buildInfoPath, resolvedPath);
|
|
@@ -127573,26 +127722,26 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
127573
127722
|
fileName: buildInfoPath
|
|
127574
127723
|
};
|
|
127575
127724
|
}
|
|
127576
|
-
if (buildInfo
|
|
127725
|
+
if (isIncrementalBuildInfo(buildInfo) && buildInfo.version !== version) {
|
|
127577
127726
|
return {
|
|
127578
127727
|
type: 13 /* TsVersionOutputOfDate */,
|
|
127579
127728
|
version: buildInfo.version
|
|
127580
127729
|
};
|
|
127581
127730
|
}
|
|
127582
|
-
if (buildInfo
|
|
127583
|
-
if (((_a = buildInfo.
|
|
127731
|
+
if (isIncrementalBuildInfo(buildInfo)) {
|
|
127732
|
+
if (((_a = buildInfo.changeFileSet) == null ? void 0 : _a.length) || (!project.options.noEmit ? ((_b = buildInfo.affectedFilesPendingEmit) == null ? void 0 : _b.length) || ((_c = buildInfo.emitDiagnosticsPerFile) == null ? void 0 : _c.length) || buildInfo.pendingEmit !== void 0 : (_d = buildInfo.semanticDiagnosticsPerFile) == null ? void 0 : _d.length)) {
|
|
127584
127733
|
return {
|
|
127585
127734
|
type: 7 /* OutOfDateBuildInfo */,
|
|
127586
127735
|
buildInfoFile: buildInfoPath
|
|
127587
127736
|
};
|
|
127588
127737
|
}
|
|
127589
|
-
if (!project.options.noEmit && getPendingEmitKind(project.options, buildInfo.
|
|
127738
|
+
if (!project.options.noEmit && getPendingEmitKind(project.options, buildInfo.options || {})) {
|
|
127590
127739
|
return {
|
|
127591
127740
|
type: 8 /* OutOfDateOptions */,
|
|
127592
127741
|
buildInfoFile: buildInfoPath
|
|
127593
127742
|
};
|
|
127594
127743
|
}
|
|
127595
|
-
|
|
127744
|
+
incrementalBuildInfo = buildInfo;
|
|
127596
127745
|
}
|
|
127597
127746
|
oldestOutputFileTime = buildInfoTime;
|
|
127598
127747
|
oldestOutputFileName = buildInfoPath;
|
|
@@ -127609,12 +127758,12 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
127609
127758
|
reason: `${inputFile} does not exist`
|
|
127610
127759
|
};
|
|
127611
127760
|
}
|
|
127612
|
-
const inputPath =
|
|
127761
|
+
const inputPath = incrementalBuildInfo ? toPath2(state, inputFile) : void 0;
|
|
127613
127762
|
if (buildInfoTime && buildInfoTime < inputTime) {
|
|
127614
127763
|
let version2;
|
|
127615
127764
|
let currentVersion;
|
|
127616
|
-
if (
|
|
127617
|
-
if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(
|
|
127765
|
+
if (incrementalBuildInfo) {
|
|
127766
|
+
if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(incrementalBuildInfo, buildInfoPath, host);
|
|
127618
127767
|
const resolvedInputPath = buildInfoVersionMap.roots.get(inputPath);
|
|
127619
127768
|
version2 = buildInfoVersionMap.fileInfos.get(resolvedInputPath ?? inputPath);
|
|
127620
127769
|
const text = version2 ? state.readFileWithCache(resolvedInputPath ?? inputFile) : void 0;
|
|
@@ -127633,10 +127782,10 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
127633
127782
|
newestInputFileName = inputFile;
|
|
127634
127783
|
newestInputFileTime = inputTime;
|
|
127635
127784
|
}
|
|
127636
|
-
if (
|
|
127785
|
+
if (incrementalBuildInfo) seenRoots.add(inputPath);
|
|
127637
127786
|
}
|
|
127638
|
-
if (
|
|
127639
|
-
if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(
|
|
127787
|
+
if (incrementalBuildInfo) {
|
|
127788
|
+
if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(incrementalBuildInfo, buildInfoPath, host);
|
|
127640
127789
|
const existingRoot = forEachEntry(
|
|
127641
127790
|
buildInfoVersionMap.roots,
|
|
127642
127791
|
// File was root file when project was built but its not any more
|
|
@@ -127783,7 +127932,7 @@ function getLatestChangedDtsTime(state, options, resolvedConfigPath) {
|
|
|
127783
127932
|
if (!options.composite) return void 0;
|
|
127784
127933
|
const entry = Debug.checkDefined(state.buildInfoCache.get(resolvedConfigPath));
|
|
127785
127934
|
if (entry.latestChangedDtsTime !== void 0) return entry.latestChangedDtsTime || void 0;
|
|
127786
|
-
const latestChangedDtsTime = entry.buildInfo && entry.buildInfo
|
|
127935
|
+
const latestChangedDtsTime = entry.buildInfo && isIncrementalBuildInfo(entry.buildInfo) && entry.buildInfo.latestChangedDtsFile ? state.host.getModifiedTime(getNormalizedAbsolutePath(entry.buildInfo.latestChangedDtsFile, getDirectoryPath(entry.path))) : void 0;
|
|
127787
127936
|
entry.latestChangedDtsTime = latestChangedDtsTime || false;
|
|
127788
127937
|
return latestChangedDtsTime;
|
|
127789
127938
|
}
|
|
@@ -129747,7 +129896,7 @@ function createSyntacticTypeNodeBuilder(options, resolver) {
|
|
|
129747
129896
|
expression,
|
|
129748
129897
|
/*includeBigInt*/
|
|
129749
129898
|
false
|
|
129750
|
-
)) {
|
|
129899
|
+
) && !resolver.isDefinitelyReferenceToGlobalSymbolObject(expression)) {
|
|
129751
129900
|
context.tracker.reportInferenceFallback(prop.name);
|
|
129752
129901
|
result = false;
|
|
129753
129902
|
}
|