typescript 5.6.0-dev.20240604 → 5.6.0-dev.20240605
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 +258 -147
- package/lib/typescript.d.ts +12 -10
- package/lib/typescript.js +339 -173
- package/package.json +2 -2
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-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20240605`;
|
|
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)) {
|
|
@@ -26045,6 +26063,9 @@ function isNamedExports(node) {
|
|
|
26045
26063
|
function isExportSpecifier(node) {
|
|
26046
26064
|
return node.kind === 281 /* ExportSpecifier */;
|
|
26047
26065
|
}
|
|
26066
|
+
function isModuleExportName(node) {
|
|
26067
|
+
return node.kind === 80 /* Identifier */ || node.kind === 11 /* StringLiteral */;
|
|
26068
|
+
}
|
|
26048
26069
|
function isNotEmittedStatement(node) {
|
|
26049
26070
|
return node.kind === 353 /* NotEmittedStatement */;
|
|
26050
26071
|
}
|
|
@@ -26743,6 +26764,9 @@ function getLocalNameForExternalImport(factory2, node, sourceFile) {
|
|
|
26743
26764
|
const namespaceDeclaration = getNamespaceDeclarationNode(node);
|
|
26744
26765
|
if (namespaceDeclaration && !isDefaultImport(node) && !isExportNamespaceAsDefaultDeclaration(node)) {
|
|
26745
26766
|
const name = namespaceDeclaration.name;
|
|
26767
|
+
if (name.kind === 11 /* StringLiteral */) {
|
|
26768
|
+
return factory2.getGeneratedNameForNode(node);
|
|
26769
|
+
}
|
|
26746
26770
|
return isGeneratedIdentifier(name) ? name : factory2.createIdentifier(getSourceTextOfNodeFromSourceFile(sourceFile, name) || idText(name));
|
|
26747
26771
|
}
|
|
26748
26772
|
if (node.kind === 272 /* ImportDeclaration */ && node.importClause) {
|
|
@@ -29078,6 +29102,9 @@ var Parser;
|
|
|
29078
29102
|
if (token() === 161 /* FromKeyword */ && lookAhead(nextTokenIsStringLiteral)) {
|
|
29079
29103
|
return false;
|
|
29080
29104
|
}
|
|
29105
|
+
if (token() === 11 /* StringLiteral */) {
|
|
29106
|
+
return true;
|
|
29107
|
+
}
|
|
29081
29108
|
return tokenIsIdentifierOrKeyword(token());
|
|
29082
29109
|
case 13 /* JsxAttributes */:
|
|
29083
29110
|
return tokenIsIdentifierOrKeyword(token()) || token() === 19 /* OpenBraceToken */;
|
|
@@ -33526,6 +33553,12 @@ var Parser;
|
|
|
33526
33553
|
const name = parseIdentifier();
|
|
33527
33554
|
return finishNode(factory2.createNamespaceImport(name), pos);
|
|
33528
33555
|
}
|
|
33556
|
+
function canParseModuleExportName() {
|
|
33557
|
+
return tokenIsIdentifierOrKeyword(token()) || token() === 11 /* StringLiteral */;
|
|
33558
|
+
}
|
|
33559
|
+
function parseModuleExportName(parseName) {
|
|
33560
|
+
return token() === 11 /* StringLiteral */ ? parseLiteralNode() : parseName();
|
|
33561
|
+
}
|
|
33529
33562
|
function parseNamedImportsOrExports(kind) {
|
|
33530
33563
|
const pos = getNodePos();
|
|
33531
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 */));
|
|
@@ -33546,42 +33579,51 @@ var Parser;
|
|
|
33546
33579
|
let isTypeOnly = false;
|
|
33547
33580
|
let propertyName;
|
|
33548
33581
|
let canParseAsKeyword = true;
|
|
33549
|
-
let name = parseIdentifierName
|
|
33550
|
-
if (name.escapedText === "type") {
|
|
33582
|
+
let name = parseModuleExportName(parseIdentifierName);
|
|
33583
|
+
if (name.kind === 80 /* Identifier */ && name.escapedText === "type") {
|
|
33551
33584
|
if (token() === 130 /* AsKeyword */) {
|
|
33552
33585
|
const firstAs = parseIdentifierName();
|
|
33553
33586
|
if (token() === 130 /* AsKeyword */) {
|
|
33554
33587
|
const secondAs = parseIdentifierName();
|
|
33555
|
-
if (
|
|
33588
|
+
if (canParseModuleExportName()) {
|
|
33556
33589
|
isTypeOnly = true;
|
|
33557
33590
|
propertyName = firstAs;
|
|
33558
|
-
name = parseNameWithKeywordCheck
|
|
33591
|
+
name = parseModuleExportName(parseNameWithKeywordCheck);
|
|
33559
33592
|
canParseAsKeyword = false;
|
|
33560
33593
|
} else {
|
|
33561
33594
|
propertyName = name;
|
|
33562
33595
|
name = secondAs;
|
|
33563
33596
|
canParseAsKeyword = false;
|
|
33564
33597
|
}
|
|
33565
|
-
} else if (
|
|
33598
|
+
} else if (canParseModuleExportName()) {
|
|
33566
33599
|
propertyName = name;
|
|
33567
33600
|
canParseAsKeyword = false;
|
|
33568
|
-
name = parseNameWithKeywordCheck
|
|
33601
|
+
name = parseModuleExportName(parseNameWithKeywordCheck);
|
|
33569
33602
|
} else {
|
|
33570
33603
|
isTypeOnly = true;
|
|
33571
33604
|
name = firstAs;
|
|
33572
33605
|
}
|
|
33573
|
-
} else if (
|
|
33606
|
+
} else if (canParseModuleExportName()) {
|
|
33574
33607
|
isTypeOnly = true;
|
|
33575
|
-
name = parseNameWithKeywordCheck
|
|
33608
|
+
name = parseModuleExportName(parseNameWithKeywordCheck);
|
|
33576
33609
|
}
|
|
33577
33610
|
}
|
|
33578
33611
|
if (canParseAsKeyword && token() === 130 /* AsKeyword */) {
|
|
33579
33612
|
propertyName = name;
|
|
33580
33613
|
parseExpected(130 /* AsKeyword */);
|
|
33581
|
-
name = parseNameWithKeywordCheck
|
|
33614
|
+
name = parseModuleExportName(parseNameWithKeywordCheck);
|
|
33582
33615
|
}
|
|
33583
|
-
if (kind === 276 /* ImportSpecifier */
|
|
33584
|
-
|
|
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
|
+
}
|
|
33585
33627
|
}
|
|
33586
33628
|
const node = kind === 276 /* ImportSpecifier */ ? factory2.createImportSpecifier(isTypeOnly, propertyName, name) : factory2.createExportSpecifier(isTypeOnly, propertyName, name);
|
|
33587
33629
|
return finishNode(node, pos);
|
|
@@ -33593,7 +33635,7 @@ var Parser;
|
|
|
33593
33635
|
}
|
|
33594
33636
|
}
|
|
33595
33637
|
function parseNamespaceExport(pos) {
|
|
33596
|
-
return finishNode(factory2.createNamespaceExport(parseIdentifierName
|
|
33638
|
+
return finishNode(factory2.createNamespaceExport(parseModuleExportName(parseIdentifierName)), pos);
|
|
33597
33639
|
}
|
|
33598
33640
|
function parseExportDeclaration(pos, hasJSDoc, modifiers) {
|
|
33599
33641
|
const savedAwaitContext = inAwaitContext();
|
|
@@ -41117,6 +41159,9 @@ function getModuleInstanceStateWorker(node, visited) {
|
|
|
41117
41159
|
}
|
|
41118
41160
|
function getModuleInstanceStateForAliasTarget(specifier, visited) {
|
|
41119
41161
|
const name = specifier.propertyName || specifier.name;
|
|
41162
|
+
if (name.kind !== 80 /* Identifier */) {
|
|
41163
|
+
return 1 /* Instantiated */;
|
|
41164
|
+
}
|
|
41120
41165
|
let p = specifier.parent;
|
|
41121
41166
|
while (p) {
|
|
41122
41167
|
if (isBlock(p) || isModuleBlock(p) || isSourceFile(p)) {
|
|
@@ -41361,7 +41406,7 @@ function createBinder() {
|
|
|
41361
41406
|
}
|
|
41362
41407
|
function declareSymbol(symbolTable, parent2, node, includes, excludes, isReplaceableByMethod, isComputedName) {
|
|
41363
41408
|
Debug.assert(isComputedName || !hasDynamicName(node));
|
|
41364
|
-
const isDefaultExport = hasSyntacticModifier(node, 2048 /* Default */) || isExportSpecifier(node) && node.name
|
|
41409
|
+
const isDefaultExport = hasSyntacticModifier(node, 2048 /* Default */) || isExportSpecifier(node) && moduleExportNameIsDefault(node.name);
|
|
41365
41410
|
const name = isComputedName ? "__computed" /* Computed */ : isDefaultExport && parent2 ? "default" /* Default */ : getDeclarationName(node);
|
|
41366
41411
|
let symbol;
|
|
41367
41412
|
if (name === void 0) {
|
|
@@ -45149,7 +45194,8 @@ function createTypeChecker(host) {
|
|
|
45149
45194
|
isUndefinedIdentifierExpression(node) {
|
|
45150
45195
|
Debug.assert(isExpressionNode(node));
|
|
45151
45196
|
return getSymbolAtLocation(node) === undefinedSymbol;
|
|
45152
|
-
}
|
|
45197
|
+
},
|
|
45198
|
+
isDefinitelyReferenceToGlobalSymbolObject
|
|
45153
45199
|
});
|
|
45154
45200
|
var evaluate = createEvaluator({
|
|
45155
45201
|
evaluateElementAccessExpression,
|
|
@@ -46106,6 +46152,21 @@ function createTypeChecker(host) {
|
|
|
46106
46152
|
];
|
|
46107
46153
|
initializeTypeChecker();
|
|
46108
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
|
+
}
|
|
46109
46170
|
function getCachedType(key) {
|
|
46110
46171
|
return key ? cachedTypes.get(key) : void 0;
|
|
46111
46172
|
}
|
|
@@ -47134,7 +47195,7 @@ function createTypeChecker(host) {
|
|
|
47134
47195
|
const isExport = typeOnlyDeclaration.kind === 281 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 278 /* ExportDeclaration */;
|
|
47135
47196
|
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;
|
|
47136
47197
|
const relatedMessage = isExport ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here;
|
|
47137
|
-
const name = typeOnlyDeclaration.kind === 278 /* ExportDeclaration */ ? "*" :
|
|
47198
|
+
const name = typeOnlyDeclaration.kind === 278 /* ExportDeclaration */ ? "*" : moduleExportNameTextUnescaped(typeOnlyDeclaration.name);
|
|
47138
47199
|
addRelatedInfo(error(node.moduleReference, message), createDiagnosticForNode(typeOnlyDeclaration, relatedMessage, name));
|
|
47139
47200
|
}
|
|
47140
47201
|
}
|
|
@@ -47378,12 +47439,12 @@ function createTypeChecker(host) {
|
|
|
47378
47439
|
if (valueSymbol.exports) result.exports = new Map(valueSymbol.exports);
|
|
47379
47440
|
return result;
|
|
47380
47441
|
}
|
|
47381
|
-
function getExportOfModule(symbol,
|
|
47442
|
+
function getExportOfModule(symbol, nameText, specifier, dontResolveAlias) {
|
|
47382
47443
|
var _a;
|
|
47383
47444
|
if (symbol.flags & 1536 /* Module */) {
|
|
47384
|
-
const exportSymbol = getExportsOfSymbol(symbol).get(
|
|
47445
|
+
const exportSymbol = getExportsOfSymbol(symbol).get(nameText);
|
|
47385
47446
|
const resolved = resolveSymbol(exportSymbol, dontResolveAlias);
|
|
47386
|
-
const exportStarDeclaration = (_a = getSymbolLinks(symbol).typeOnlyExportStarMap) == null ? void 0 : _a.get(
|
|
47447
|
+
const exportStarDeclaration = (_a = getSymbolLinks(symbol).typeOnlyExportStarMap) == null ? void 0 : _a.get(nameText);
|
|
47387
47448
|
markSymbolOfAliasDeclarationIfTypeOnly(
|
|
47388
47449
|
specifier,
|
|
47389
47450
|
exportSymbol,
|
|
@@ -47391,7 +47452,7 @@ function createTypeChecker(host) {
|
|
|
47391
47452
|
/*overwriteEmpty*/
|
|
47392
47453
|
false,
|
|
47393
47454
|
exportStarDeclaration,
|
|
47394
|
-
|
|
47455
|
+
nameText
|
|
47395
47456
|
);
|
|
47396
47457
|
return resolved;
|
|
47397
47458
|
}
|
|
@@ -47409,10 +47470,11 @@ function createTypeChecker(host) {
|
|
|
47409
47470
|
const moduleSpecifier = getExternalModuleRequireArgument(node) || node.moduleSpecifier;
|
|
47410
47471
|
const moduleSymbol = resolveExternalModuleName(node, moduleSpecifier);
|
|
47411
47472
|
const name = !isPropertyAccessExpression(specifier) && specifier.propertyName || specifier.name;
|
|
47412
|
-
if (!isIdentifier(name)) {
|
|
47473
|
+
if (!isIdentifier(name) && name.kind !== 11 /* StringLiteral */) {
|
|
47413
47474
|
return void 0;
|
|
47414
47475
|
}
|
|
47415
|
-
const
|
|
47476
|
+
const nameText = moduleExportNameTextEscaped(name);
|
|
47477
|
+
const suppressInteropError = nameText === "default" /* Default */ && allowSyntheticDefaultImports;
|
|
47416
47478
|
const targetSymbol = resolveESModuleSymbol(
|
|
47417
47479
|
moduleSymbol,
|
|
47418
47480
|
moduleSpecifier,
|
|
@@ -47421,7 +47483,7 @@ function createTypeChecker(host) {
|
|
|
47421
47483
|
suppressInteropError
|
|
47422
47484
|
);
|
|
47423
47485
|
if (targetSymbol) {
|
|
47424
|
-
if (name.
|
|
47486
|
+
if (nameText || name.kind === 11 /* StringLiteral */) {
|
|
47425
47487
|
if (isShorthandAmbientModuleSymbol(moduleSymbol)) {
|
|
47426
47488
|
return moduleSymbol;
|
|
47427
47489
|
}
|
|
@@ -47429,16 +47491,16 @@ function createTypeChecker(host) {
|
|
|
47429
47491
|
if (moduleSymbol && moduleSymbol.exports && moduleSymbol.exports.get("export=" /* ExportEquals */)) {
|
|
47430
47492
|
symbolFromVariable = getPropertyOfType(
|
|
47431
47493
|
getTypeOfSymbol(targetSymbol),
|
|
47432
|
-
|
|
47494
|
+
nameText,
|
|
47433
47495
|
/*skipObjectFunctionPropertyAugment*/
|
|
47434
47496
|
true
|
|
47435
47497
|
);
|
|
47436
47498
|
} else {
|
|
47437
|
-
symbolFromVariable = getPropertyOfVariable(targetSymbol,
|
|
47499
|
+
symbolFromVariable = getPropertyOfVariable(targetSymbol, nameText);
|
|
47438
47500
|
}
|
|
47439
47501
|
symbolFromVariable = resolveSymbol(symbolFromVariable, dontResolveAlias);
|
|
47440
|
-
let symbolFromModule = getExportOfModule(targetSymbol,
|
|
47441
|
-
if (symbolFromModule === void 0 &&
|
|
47502
|
+
let symbolFromModule = getExportOfModule(targetSymbol, nameText, specifier, dontResolveAlias);
|
|
47503
|
+
if (symbolFromModule === void 0 && nameText === "default" /* Default */) {
|
|
47442
47504
|
const file = (_a = moduleSymbol.declarations) == null ? void 0 : _a.find(isSourceFile);
|
|
47443
47505
|
if (isOnlyImportableAsDefault(moduleSpecifier) || canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, moduleSpecifier)) {
|
|
47444
47506
|
symbolFromModule = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);
|
|
@@ -47456,7 +47518,7 @@ function createTypeChecker(host) {
|
|
|
47456
47518
|
var _a;
|
|
47457
47519
|
const moduleName = getFullyQualifiedName(moduleSymbol, node);
|
|
47458
47520
|
const declarationName = declarationNameToString(name);
|
|
47459
|
-
const suggestion = getSuggestedSymbolForNonexistentModule(name, targetSymbol);
|
|
47521
|
+
const suggestion = isIdentifier(name) ? getSuggestedSymbolForNonexistentModule(name, targetSymbol) : void 0;
|
|
47460
47522
|
if (suggestion !== void 0) {
|
|
47461
47523
|
const suggestionName = symbolToString(suggestion);
|
|
47462
47524
|
const diagnostic = error(name, Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, moduleName, declarationName, suggestionName);
|
|
@@ -47478,7 +47540,7 @@ function createTypeChecker(host) {
|
|
|
47478
47540
|
}
|
|
47479
47541
|
function reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName) {
|
|
47480
47542
|
var _a, _b;
|
|
47481
|
-
const localSymbol = (_b = (_a = tryCast(moduleSymbol.valueDeclaration, canHaveLocals)) == null ? void 0 : _a.locals) == null ? void 0 : _b.get(name
|
|
47543
|
+
const localSymbol = (_b = (_a = tryCast(moduleSymbol.valueDeclaration, canHaveLocals)) == null ? void 0 : _a.locals) == null ? void 0 : _b.get(moduleExportNameTextEscaped(name));
|
|
47482
47544
|
const exports2 = moduleSymbol.exports;
|
|
47483
47545
|
if (localSymbol) {
|
|
47484
47546
|
const exportedEqualsSymbol = exports2 == null ? void 0 : exports2.get("export=" /* ExportEquals */);
|
|
@@ -47510,7 +47572,7 @@ function createTypeChecker(host) {
|
|
|
47510
47572
|
}
|
|
47511
47573
|
}
|
|
47512
47574
|
function getTargetOfImportSpecifier(node, dontResolveAlias) {
|
|
47513
|
-
if (isImportSpecifier(node) &&
|
|
47575
|
+
if (isImportSpecifier(node) && moduleExportNameIsDefault(node.propertyName || node.name)) {
|
|
47514
47576
|
const specifier = getModuleSpecifierForImportOrExport(node);
|
|
47515
47577
|
const moduleSymbol = specifier && resolveExternalModuleName(node, specifier);
|
|
47516
47578
|
if (moduleSymbol) {
|
|
@@ -47554,19 +47616,23 @@ function createTypeChecker(host) {
|
|
|
47554
47616
|
}
|
|
47555
47617
|
}
|
|
47556
47618
|
function getTargetOfExportSpecifier(node, meaning, dontResolveAlias) {
|
|
47557
|
-
|
|
47619
|
+
const name = node.propertyName || node.name;
|
|
47620
|
+
if (moduleExportNameIsDefault(name)) {
|
|
47558
47621
|
const specifier = getModuleSpecifierForImportOrExport(node);
|
|
47559
47622
|
const moduleSymbol = specifier && resolveExternalModuleName(node, specifier);
|
|
47560
47623
|
if (moduleSymbol) {
|
|
47561
47624
|
return getTargetofModuleDefault(moduleSymbol, node, !!dontResolveAlias);
|
|
47562
47625
|
}
|
|
47563
47626
|
}
|
|
47564
|
-
const resolved = node.parent.parent.moduleSpecifier ? getExternalModuleMember(node.parent.parent, node, dontResolveAlias) :
|
|
47565
|
-
|
|
47566
|
-
|
|
47567
|
-
|
|
47568
|
-
|
|
47569
|
-
|
|
47627
|
+
const resolved = node.parent.parent.moduleSpecifier ? getExternalModuleMember(node.parent.parent, node, dontResolveAlias) : name.kind === 11 /* StringLiteral */ ? void 0 : (
|
|
47628
|
+
// Skip for invalid syntax like this: export { "x" }
|
|
47629
|
+
resolveEntityName(
|
|
47630
|
+
name,
|
|
47631
|
+
meaning,
|
|
47632
|
+
/*ignoreErrors*/
|
|
47633
|
+
false,
|
|
47634
|
+
dontResolveAlias
|
|
47635
|
+
)
|
|
47570
47636
|
);
|
|
47571
47637
|
markSymbolOfAliasDeclarationIfTypeOnly(
|
|
47572
47638
|
node,
|
|
@@ -52163,9 +52229,10 @@ function createTypeChecker(host) {
|
|
|
52163
52229
|
if (index >= 0) {
|
|
52164
52230
|
const exportDecl = statements[index];
|
|
52165
52231
|
const replacements = mapDefined(exportDecl.exportClause.elements, (e) => {
|
|
52166
|
-
if (!e.propertyName) {
|
|
52232
|
+
if (!e.propertyName && e.name.kind !== 11 /* StringLiteral */) {
|
|
52233
|
+
const name = e.name;
|
|
52167
52234
|
const indices = indicesOf(statements);
|
|
52168
|
-
const associatedIndices = filter(indices, (i) => nodeHasName(statements[i],
|
|
52235
|
+
const associatedIndices = filter(indices, (i) => nodeHasName(statements[i], name));
|
|
52169
52236
|
if (length(associatedIndices) && every(associatedIndices, (i) => canHaveExportModifier(statements[i]))) {
|
|
52170
52237
|
for (const index2 of associatedIndices) {
|
|
52171
52238
|
statements[index2] = addExportModifier(statements[index2]);
|
|
@@ -52799,7 +52866,7 @@ function createTypeChecker(host) {
|
|
|
52799
52866
|
function getSomeTargetNameFromDeclarations(declarations) {
|
|
52800
52867
|
return firstDefined(declarations, (d) => {
|
|
52801
52868
|
if (isImportSpecifier(d) || isExportSpecifier(d)) {
|
|
52802
|
-
return
|
|
52869
|
+
return moduleExportNameTextUnescaped(d.propertyName || d.name);
|
|
52803
52870
|
}
|
|
52804
52871
|
if (isBinaryExpression(d) || isExportAssignment(d)) {
|
|
52805
52872
|
const expression = isExportAssignment(d) ? d.expression : d.right;
|
|
@@ -52817,7 +52884,7 @@ function createTypeChecker(host) {
|
|
|
52817
52884
|
});
|
|
52818
52885
|
}
|
|
52819
52886
|
function serializeAsAlias(symbol, localName, modifierFlags) {
|
|
52820
|
-
var _a2, _b, _c, _d, _e
|
|
52887
|
+
var _a2, _b, _c, _d, _e;
|
|
52821
52888
|
const node = getDeclarationOfAliasSymbol(symbol);
|
|
52822
52889
|
if (!node) return Debug.fail();
|
|
52823
52890
|
const target = getMergedSymbol(getTargetOfAliasDeclaration(
|
|
@@ -53015,8 +53082,11 @@ function createTypeChecker(host) {
|
|
|
53015
53082
|
}
|
|
53016
53083
|
case 281 /* ExportSpecifier */:
|
|
53017
53084
|
const specifier = node.parent.parent.moduleSpecifier;
|
|
53018
|
-
if (specifier
|
|
53019
|
-
|
|
53085
|
+
if (specifier) {
|
|
53086
|
+
const propertyName = node.propertyName;
|
|
53087
|
+
if (propertyName && moduleExportNameIsDefault(propertyName)) {
|
|
53088
|
+
verbatimTargetName = "default" /* Default */;
|
|
53089
|
+
}
|
|
53020
53090
|
}
|
|
53021
53091
|
serializeExportSpecifier(
|
|
53022
53092
|
unescapeLeadingUnderscores(symbol.escapedName),
|
|
@@ -53729,7 +53799,7 @@ function createTypeChecker(host) {
|
|
|
53729
53799
|
}
|
|
53730
53800
|
function collectLinkedAliases(node, setVisibility) {
|
|
53731
53801
|
let exportSymbol;
|
|
53732
|
-
if (node.parent && node.parent.kind === 277 /* ExportAssignment */) {
|
|
53802
|
+
if (node.kind !== 11 /* StringLiteral */ && node.parent && node.parent.kind === 277 /* ExportAssignment */) {
|
|
53733
53803
|
exportSymbol = resolveName(
|
|
53734
53804
|
node,
|
|
53735
53805
|
node,
|
|
@@ -69302,9 +69372,10 @@ function createTypeChecker(host) {
|
|
|
69302
69372
|
return;
|
|
69303
69373
|
case 281 /* ExportSpecifier */:
|
|
69304
69374
|
const exportDeclaration = node.parent.parent;
|
|
69305
|
-
|
|
69375
|
+
const name = node.propertyName || node.name;
|
|
69376
|
+
if (!node.isTypeOnly && !exportDeclaration.isTypeOnly && !exportDeclaration.moduleSpecifier && name.kind !== 11 /* StringLiteral */) {
|
|
69306
69377
|
const symbol = resolveEntityName(
|
|
69307
|
-
|
|
69378
|
+
name,
|
|
69308
69379
|
111551 /* Value */,
|
|
69309
69380
|
/*ignoreErrors*/
|
|
69310
69381
|
true,
|
|
@@ -69598,6 +69669,9 @@ function createTypeChecker(host) {
|
|
|
69598
69669
|
function markExportSpecifierAliasReferenced(location) {
|
|
69599
69670
|
if (!location.parent.parent.moduleSpecifier && !location.isTypeOnly && !location.parent.parent.isTypeOnly) {
|
|
69600
69671
|
const exportedName = location.propertyName || location.name;
|
|
69672
|
+
if (exportedName.kind === 11 /* StringLiteral */) {
|
|
69673
|
+
return;
|
|
69674
|
+
}
|
|
69601
69675
|
const symbol = resolveName(
|
|
69602
69676
|
exportedName,
|
|
69603
69677
|
exportedName.escapedText,
|
|
@@ -69612,7 +69686,7 @@ function createTypeChecker(host) {
|
|
|
69612
69686
|
const target = symbol && (symbol.flags & 2097152 /* Alias */ ? resolveAlias(symbol) : symbol);
|
|
69613
69687
|
if (!target || getSymbolFlags(target) & 111551 /* Value */) {
|
|
69614
69688
|
markExportAsReferenced(location);
|
|
69615
|
-
markIdentifierAliasReferenced(
|
|
69689
|
+
markIdentifierAliasReferenced(exportedName);
|
|
69616
69690
|
}
|
|
69617
69691
|
}
|
|
69618
69692
|
return;
|
|
@@ -83208,6 +83282,16 @@ function createTypeChecker(host) {
|
|
|
83208
83282
|
}
|
|
83209
83283
|
return true;
|
|
83210
83284
|
}
|
|
83285
|
+
function checkModuleExportName(name, allowStringLiteral = true) {
|
|
83286
|
+
if (name === void 0 || name.kind !== 11 /* StringLiteral */) {
|
|
83287
|
+
return;
|
|
83288
|
+
}
|
|
83289
|
+
if (!allowStringLiteral) {
|
|
83290
|
+
grammarErrorOnNode(name, Diagnostics.Identifier_expected);
|
|
83291
|
+
} else if (moduleKind === 5 /* ES2015 */ || moduleKind === 6 /* ES2020 */) {
|
|
83292
|
+
grammarErrorOnNode(name, Diagnostics.String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es2020);
|
|
83293
|
+
}
|
|
83294
|
+
}
|
|
83211
83295
|
function checkAliasSymbol(node) {
|
|
83212
83296
|
var _a, _b, _c, _d;
|
|
83213
83297
|
let symbol = getSymbolOfDeclaration(node);
|
|
@@ -83219,7 +83303,7 @@ function createTypeChecker(host) {
|
|
|
83219
83303
|
Debug.assert(node.kind !== 280 /* NamespaceExport */);
|
|
83220
83304
|
if (node.kind === 281 /* ExportSpecifier */) {
|
|
83221
83305
|
const diag2 = error(errorNode, Diagnostics.Types_cannot_appear_in_export_declarations_in_JavaScript_files);
|
|
83222
|
-
const alreadyExportedSymbol = (_b = (_a = getSourceFileOfNode(node).symbol) == null ? void 0 : _a.exports) == null ? void 0 : _b.get((node.propertyName || node.name)
|
|
83306
|
+
const alreadyExportedSymbol = (_b = (_a = getSourceFileOfNode(node).symbol) == null ? void 0 : _a.exports) == null ? void 0 : _b.get(moduleExportNameTextEscaped(node.propertyName || node.name));
|
|
83223
83307
|
if (alreadyExportedSymbol === target) {
|
|
83224
83308
|
const exportingDeclaration = (_c = alreadyExportedSymbol.declarations) == null ? void 0 : _c.find(isJSDocNode);
|
|
83225
83309
|
if (exportingDeclaration) {
|
|
@@ -83274,7 +83358,7 @@ function createTypeChecker(host) {
|
|
|
83274
83358
|
if (compilerOptions.verbatimModuleSyntax) {
|
|
83275
83359
|
Debug.assertIsDefined(node.name, "An ImportClause with a symbol should have a name");
|
|
83276
83360
|
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;
|
|
83277
|
-
const name =
|
|
83361
|
+
const name = moduleExportNameTextUnescaped(node.kind === 276 /* ImportSpecifier */ ? node.propertyName || node.name : node.name);
|
|
83278
83362
|
addTypeOnlyDeclarationRelatedInfo(
|
|
83279
83363
|
error(node, message, name),
|
|
83280
83364
|
isType ? void 0 : typeOnlyAlias,
|
|
@@ -83288,7 +83372,7 @@ function createTypeChecker(host) {
|
|
|
83288
83372
|
}
|
|
83289
83373
|
case 281 /* ExportSpecifier */: {
|
|
83290
83374
|
if (compilerOptions.verbatimModuleSyntax || getSourceFileOfNode(typeOnlyAlias) !== getSourceFileOfNode(node)) {
|
|
83291
|
-
const name =
|
|
83375
|
+
const name = moduleExportNameTextUnescaped(node.propertyName || node.name);
|
|
83292
83376
|
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);
|
|
83293
83377
|
addTypeOnlyDeclarationRelatedInfo(diagnostic, isType ? void 0 : typeOnlyAlias, name);
|
|
83294
83378
|
break;
|
|
@@ -83338,8 +83422,11 @@ function createTypeChecker(host) {
|
|
|
83338
83422
|
function checkImportBinding(node) {
|
|
83339
83423
|
checkCollisionsForDeclarationName(node, node.name);
|
|
83340
83424
|
checkAliasSymbol(node);
|
|
83341
|
-
if (node.kind === 276 /* ImportSpecifier */
|
|
83342
|
-
|
|
83425
|
+
if (node.kind === 276 /* ImportSpecifier */) {
|
|
83426
|
+
checkModuleExportName(node.propertyName);
|
|
83427
|
+
if (moduleExportNameIsDefault(node.propertyName || node.name) && getESModuleInterop(compilerOptions) && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) < 4 /* System */) {
|
|
83428
|
+
checkExternalEmitHelpers(node, 131072 /* ImportDefault */);
|
|
83429
|
+
}
|
|
83343
83430
|
}
|
|
83344
83431
|
}
|
|
83345
83432
|
function checkImportAttributes(declaration) {
|
|
@@ -83460,6 +83547,7 @@ function createTypeChecker(host) {
|
|
|
83460
83547
|
error(node.moduleSpecifier, Diagnostics.Module_0_uses_export_and_cannot_be_used_with_export_Asterisk, symbolToString(moduleSymbol));
|
|
83461
83548
|
} else if (node.exportClause) {
|
|
83462
83549
|
checkAliasSymbol(node.exportClause);
|
|
83550
|
+
checkModuleExportName(node.exportClause.name);
|
|
83463
83551
|
}
|
|
83464
83552
|
if (host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) < 4 /* System */) {
|
|
83465
83553
|
if (node.exportClause) {
|
|
@@ -83490,6 +83578,9 @@ function createTypeChecker(host) {
|
|
|
83490
83578
|
}
|
|
83491
83579
|
function checkExportSpecifier(node) {
|
|
83492
83580
|
checkAliasSymbol(node);
|
|
83581
|
+
const hasModuleSpecifier = node.parent.parent.moduleSpecifier !== void 0;
|
|
83582
|
+
checkModuleExportName(node.propertyName, hasModuleSpecifier);
|
|
83583
|
+
checkModuleExportName(node.name);
|
|
83493
83584
|
if (getEmitDeclarations(compilerOptions)) {
|
|
83494
83585
|
collectLinkedAliases(
|
|
83495
83586
|
node.propertyName || node.name,
|
|
@@ -83497,8 +83588,11 @@ function createTypeChecker(host) {
|
|
|
83497
83588
|
true
|
|
83498
83589
|
);
|
|
83499
83590
|
}
|
|
83500
|
-
if (!
|
|
83591
|
+
if (!hasModuleSpecifier) {
|
|
83501
83592
|
const exportedName = node.propertyName || node.name;
|
|
83593
|
+
if (exportedName.kind === 11 /* StringLiteral */) {
|
|
83594
|
+
return;
|
|
83595
|
+
}
|
|
83502
83596
|
const symbol = resolveName(
|
|
83503
83597
|
exportedName,
|
|
83504
83598
|
exportedName.escapedText,
|
|
@@ -83514,7 +83608,7 @@ function createTypeChecker(host) {
|
|
|
83514
83608
|
markLinkedReferences(node, 7 /* ExportSpecifier */);
|
|
83515
83609
|
}
|
|
83516
83610
|
} else {
|
|
83517
|
-
if (getESModuleInterop(compilerOptions) && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) < 4 /* System */ &&
|
|
83611
|
+
if (getESModuleInterop(compilerOptions) && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) < 4 /* System */ && moduleExportNameIsDefault(node.propertyName || node.name)) {
|
|
83518
83612
|
checkExternalEmitHelpers(node, 131072 /* ImportDefault */);
|
|
83519
83613
|
}
|
|
83520
83614
|
}
|
|
@@ -84669,7 +84763,11 @@ function createTypeChecker(host) {
|
|
|
84669
84763
|
}
|
|
84670
84764
|
function getExportSpecifierLocalTargetSymbol(node) {
|
|
84671
84765
|
if (isExportSpecifier(node)) {
|
|
84672
|
-
|
|
84766
|
+
const name = node.propertyName || node.name;
|
|
84767
|
+
return node.parent.parent.moduleSpecifier ? getExternalModuleMember(node.parent.parent, node) : name.kind === 11 /* StringLiteral */ ? void 0 : (
|
|
84768
|
+
// Skip for invalid syntax like this: export { "x" }
|
|
84769
|
+
resolveEntityName(name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)
|
|
84770
|
+
);
|
|
84673
84771
|
} else {
|
|
84674
84772
|
return resolveEntityName(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */);
|
|
84675
84773
|
}
|
|
@@ -85640,7 +85738,8 @@ function createTypeChecker(host) {
|
|
|
85640
85738
|
resolveExternalModuleSymbol(sym);
|
|
85641
85739
|
return !sym.exports ? [] : nodeBuilder.symbolTableToDeclarationStatements(sym.exports, node, flags, tracker);
|
|
85642
85740
|
},
|
|
85643
|
-
isImportRequiredByAugmentation
|
|
85741
|
+
isImportRequiredByAugmentation,
|
|
85742
|
+
isDefinitelyReferenceToGlobalSymbolObject
|
|
85644
85743
|
};
|
|
85645
85744
|
function isImportRequiredByAugmentation(node) {
|
|
85646
85745
|
const file = getSourceFileOfNode(node);
|
|
@@ -87479,7 +87578,7 @@ function isDeclarationNameOrImportPropertyName(name) {
|
|
|
87479
87578
|
switch (name.parent.kind) {
|
|
87480
87579
|
case 276 /* ImportSpecifier */:
|
|
87481
87580
|
case 281 /* ExportSpecifier */:
|
|
87482
|
-
return isIdentifier(name)
|
|
87581
|
+
return isIdentifier(name) || name.kind === 11 /* StringLiteral */;
|
|
87483
87582
|
default:
|
|
87484
87583
|
return isDeclarationName(name);
|
|
87485
87584
|
}
|
|
@@ -88724,7 +88823,7 @@ var visitEachChildTable = {
|
|
|
88724
88823
|
return context.factory.updateImportSpecifier(
|
|
88725
88824
|
node,
|
|
88726
88825
|
node.isTypeOnly,
|
|
88727
|
-
nodeVisitor(node.propertyName, visitor,
|
|
88826
|
+
nodeVisitor(node.propertyName, visitor, isModuleExportName),
|
|
88728
88827
|
Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier))
|
|
88729
88828
|
);
|
|
88730
88829
|
},
|
|
@@ -88755,8 +88854,8 @@ var visitEachChildTable = {
|
|
|
88755
88854
|
return context.factory.updateExportSpecifier(
|
|
88756
88855
|
node,
|
|
88757
88856
|
node.isTypeOnly,
|
|
88758
|
-
nodeVisitor(node.propertyName, visitor,
|
|
88759
|
-
Debug.checkDefined(nodeVisitor(node.name, visitor,
|
|
88857
|
+
nodeVisitor(node.propertyName, visitor, isModuleExportName),
|
|
88858
|
+
Debug.checkDefined(nodeVisitor(node.name, visitor, isModuleExportName))
|
|
88760
88859
|
);
|
|
88761
88860
|
},
|
|
88762
88861
|
// Module references
|
|
@@ -89300,7 +89399,7 @@ function containsDefaultReference(node) {
|
|
|
89300
89399
|
return some(node.elements, isNamedDefaultReference);
|
|
89301
89400
|
}
|
|
89302
89401
|
function isNamedDefaultReference(e) {
|
|
89303
|
-
return e.propertyName
|
|
89402
|
+
return moduleExportNameIsDefault(e.propertyName || e.name);
|
|
89304
89403
|
}
|
|
89305
89404
|
function chainBundle(context, transformSourceFile) {
|
|
89306
89405
|
return transformSourceFileOrBundle;
|
|
@@ -89376,9 +89475,10 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
89376
89475
|
hasImportDefault || (hasImportDefault = containsDefaultReference(node.exportClause));
|
|
89377
89476
|
} else {
|
|
89378
89477
|
const name = node.exportClause.name;
|
|
89379
|
-
|
|
89478
|
+
const nameText = moduleExportNameTextUnescaped(name);
|
|
89479
|
+
if (!uniqueExports.get(nameText)) {
|
|
89380
89480
|
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name);
|
|
89381
|
-
uniqueExports.set(
|
|
89481
|
+
uniqueExports.set(nameText, true);
|
|
89382
89482
|
exportedNames = append(exportedNames, name);
|
|
89383
89483
|
}
|
|
89384
89484
|
hasImportStar = true;
|
|
@@ -89436,20 +89536,23 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
89436
89536
|
return { externalImports, exportSpecifiers, exportEquals, hasExportStarsToExportValues, exportedBindings, exportedNames, exportedFunctions, externalHelpersImportDeclaration };
|
|
89437
89537
|
function addExportedNamesForExportDeclaration(node) {
|
|
89438
89538
|
for (const specifier of cast(node.exportClause, isNamedExports).elements) {
|
|
89439
|
-
|
|
89539
|
+
const specifierNameText = moduleExportNameTextUnescaped(specifier.name);
|
|
89540
|
+
if (!uniqueExports.get(specifierNameText)) {
|
|
89440
89541
|
const name = specifier.propertyName || specifier.name;
|
|
89441
|
-
if (
|
|
89442
|
-
|
|
89443
|
-
|
|
89444
|
-
|
|
89445
|
-
|
|
89446
|
-
if (decl
|
|
89447
|
-
|
|
89448
|
-
|
|
89542
|
+
if (name.kind !== 11 /* StringLiteral */) {
|
|
89543
|
+
if (!node.moduleSpecifier) {
|
|
89544
|
+
exportSpecifiers.add(name, specifier);
|
|
89545
|
+
}
|
|
89546
|
+
const decl = resolver.getReferencedImportDeclaration(name) || resolver.getReferencedValueDeclaration(name);
|
|
89547
|
+
if (decl) {
|
|
89548
|
+
if (decl.kind === 262 /* FunctionDeclaration */) {
|
|
89549
|
+
addExportedFunctionDeclaration(decl, specifier.name, moduleExportNameIsDefault(specifier.name));
|
|
89550
|
+
continue;
|
|
89551
|
+
}
|
|
89552
|
+
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(decl), specifier.name);
|
|
89449
89553
|
}
|
|
89450
|
-
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(decl), specifier.name);
|
|
89451
89554
|
}
|
|
89452
|
-
uniqueExports.set(
|
|
89555
|
+
uniqueExports.set(specifierNameText, true);
|
|
89453
89556
|
exportedNames = append(exportedNames, specifier.name);
|
|
89454
89557
|
}
|
|
89455
89558
|
}
|
|
@@ -89463,9 +89566,10 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
89463
89566
|
}
|
|
89464
89567
|
} else {
|
|
89465
89568
|
name ?? (name = node.name);
|
|
89466
|
-
|
|
89569
|
+
const nameText = moduleExportNameTextUnescaped(name);
|
|
89570
|
+
if (!uniqueExports.get(nameText)) {
|
|
89467
89571
|
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name);
|
|
89468
|
-
uniqueExports.set(
|
|
89572
|
+
uniqueExports.set(nameText, true);
|
|
89469
89573
|
}
|
|
89470
89574
|
}
|
|
89471
89575
|
}
|
|
@@ -106742,7 +106846,7 @@ function transformModule(context) {
|
|
|
106742
106846
|
factory2.createExpressionStatement(
|
|
106743
106847
|
reduceLeft(
|
|
106744
106848
|
currentModuleInfo.exportedNames.slice(i, i + chunkSize),
|
|
106745
|
-
(prev, nextId) => factory2.createAssignment(factory2.createPropertyAccessExpression(factory2.createIdentifier("exports"), factory2.createIdentifier(idText(nextId))), prev),
|
|
106849
|
+
(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),
|
|
106746
106850
|
factory2.createVoidZero()
|
|
106747
106851
|
)
|
|
106748
106852
|
)
|
|
@@ -107065,7 +107169,10 @@ function transformModule(context) {
|
|
|
107065
107169
|
append(statements, createUnderscoreUnderscoreESModule());
|
|
107066
107170
|
}
|
|
107067
107171
|
if (some(currentModuleInfo.exportedNames)) {
|
|
107068
|
-
append(
|
|
107172
|
+
append(
|
|
107173
|
+
statements,
|
|
107174
|
+
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()))
|
|
107175
|
+
);
|
|
107069
107176
|
}
|
|
107070
107177
|
for (const f of currentModuleInfo.exportedFunctions) {
|
|
107071
107178
|
appendExportsOfHoistedDeclaration(statements, f);
|
|
@@ -107936,17 +108043,16 @@ function transformModule(context) {
|
|
|
107936
108043
|
);
|
|
107937
108044
|
}
|
|
107938
108045
|
for (const specifier of node.exportClause.elements) {
|
|
107939
|
-
const
|
|
107940
|
-
const
|
|
107941
|
-
|
|
107942
|
-
|
|
107943
|
-
);
|
|
108046
|
+
const specifierName = specifier.propertyName || specifier.name;
|
|
108047
|
+
const exportNeedsImportDefault = !!getESModuleInterop(compilerOptions) && !(getInternalEmitFlags(node) & 2 /* NeverApplyImportHelper */) && moduleExportNameIsDefault(specifierName);
|
|
108048
|
+
const target = exportNeedsImportDefault ? emitHelpers().createImportDefaultHelper(generatedName) : generatedName;
|
|
108049
|
+
const exportedValue = specifierName.kind === 11 /* StringLiteral */ ? factory2.createElementAccessExpression(target, specifierName) : factory2.createPropertyAccessExpression(target, specifierName);
|
|
107944
108050
|
statements.push(
|
|
107945
108051
|
setOriginalNode(
|
|
107946
108052
|
setTextRange(
|
|
107947
108053
|
factory2.createExpressionStatement(
|
|
107948
108054
|
createExportExpression(
|
|
107949
|
-
factory2.getExportName(specifier),
|
|
108055
|
+
specifier.name.kind === 11 /* StringLiteral */ ? factory2.cloneNode(specifier.name) : factory2.getExportName(specifier),
|
|
107950
108056
|
exportedValue,
|
|
107951
108057
|
/*location*/
|
|
107952
108058
|
void 0,
|
|
@@ -107971,7 +108077,7 @@ function transformModule(context) {
|
|
|
107971
108077
|
factory2.cloneNode(node.exportClause.name),
|
|
107972
108078
|
getHelperExpressionForExport(
|
|
107973
108079
|
node,
|
|
107974
|
-
moduleKind !== 2 /* AMD */ ? createRequireCall(node) : isExportNamespaceAsDefaultDeclaration(node) ? generatedName : factory2.createIdentifier(idText(node.exportClause.name))
|
|
108080
|
+
moduleKind !== 2 /* AMD */ ? createRequireCall(node) : isExportNamespaceAsDefaultDeclaration(node) ? generatedName : node.exportClause.name.kind === 11 /* StringLiteral */ ? generatedName : factory2.createIdentifier(idText(node.exportClause.name))
|
|
107975
108081
|
)
|
|
107976
108082
|
)
|
|
107977
108083
|
),
|
|
@@ -108301,10 +108407,13 @@ function transformModule(context) {
|
|
|
108301
108407
|
return statements;
|
|
108302
108408
|
}
|
|
108303
108409
|
function appendExportStatement(statements, seen, exportName, expression, location, allowComments, liveBinding) {
|
|
108304
|
-
if (
|
|
108410
|
+
if (exportName.kind !== 11 /* StringLiteral */) {
|
|
108411
|
+
if (seen.has(exportName)) {
|
|
108412
|
+
return statements;
|
|
108413
|
+
}
|
|
108305
108414
|
seen.set(exportName, true);
|
|
108306
|
-
statements = append(statements, createExportStatement(exportName, expression, location, allowComments, liveBinding));
|
|
108307
108415
|
}
|
|
108416
|
+
statements = append(statements, createExportStatement(exportName, expression, location, allowComments, liveBinding));
|
|
108308
108417
|
return statements;
|
|
108309
108418
|
}
|
|
108310
108419
|
function createUnderscoreUnderscoreESModule() {
|
|
@@ -108374,7 +108483,10 @@ function transformModule(context) {
|
|
|
108374
108483
|
])
|
|
108375
108484
|
]
|
|
108376
108485
|
) : factory2.createAssignment(
|
|
108377
|
-
factory2.
|
|
108486
|
+
name.kind === 11 /* StringLiteral */ ? factory2.createElementAccessExpression(
|
|
108487
|
+
factory2.createIdentifier("exports"),
|
|
108488
|
+
factory2.cloneNode(name)
|
|
108489
|
+
) : factory2.createPropertyAccessExpression(
|
|
108378
108490
|
factory2.createIdentifier("exports"),
|
|
108379
108491
|
factory2.cloneNode(name)
|
|
108380
108492
|
),
|
|
@@ -108510,11 +108622,9 @@ function transformModule(context) {
|
|
|
108510
108622
|
);
|
|
108511
108623
|
} else if (isImportSpecifier(importDeclaration)) {
|
|
108512
108624
|
const name = importDeclaration.propertyName || importDeclaration.name;
|
|
108625
|
+
const target = factory2.getGeneratedNameForNode(((_b = (_a = importDeclaration.parent) == null ? void 0 : _a.parent) == null ? void 0 : _b.parent) || importDeclaration);
|
|
108513
108626
|
return setTextRange(
|
|
108514
|
-
factory2.createPropertyAccessExpression(
|
|
108515
|
-
factory2.getGeneratedNameForNode(((_b = (_a = importDeclaration.parent) == null ? void 0 : _a.parent) == null ? void 0 : _b.parent) || importDeclaration),
|
|
108516
|
-
factory2.cloneNode(name)
|
|
108517
|
-
),
|
|
108627
|
+
name.kind === 11 /* StringLiteral */ ? factory2.createElementAccessExpression(target, factory2.cloneNode(name)) : factory2.createPropertyAccessExpression(target, factory2.cloneNode(name)),
|
|
108518
108628
|
/*location*/
|
|
108519
108629
|
node
|
|
108520
108630
|
);
|
|
@@ -108802,7 +108912,7 @@ function transformSystemModule(context) {
|
|
|
108802
108912
|
const exportedNames = [];
|
|
108803
108913
|
if (moduleInfo.exportedNames) {
|
|
108804
108914
|
for (const exportedLocalName of moduleInfo.exportedNames) {
|
|
108805
|
-
if (exportedLocalName
|
|
108915
|
+
if (moduleExportNameIsDefault(exportedLocalName)) {
|
|
108806
108916
|
continue;
|
|
108807
108917
|
}
|
|
108808
108918
|
exportedNames.push(
|
|
@@ -108980,10 +109090,10 @@ function transformSystemModule(context) {
|
|
|
108980
109090
|
for (const e of entry.exportClause.elements) {
|
|
108981
109091
|
properties.push(
|
|
108982
109092
|
factory2.createPropertyAssignment(
|
|
108983
|
-
factory2.createStringLiteral(
|
|
109093
|
+
factory2.createStringLiteral(moduleExportNameTextUnescaped(e.name)),
|
|
108984
109094
|
factory2.createElementAccessExpression(
|
|
108985
109095
|
parameterName,
|
|
108986
|
-
factory2.createStringLiteral(
|
|
109096
|
+
factory2.createStringLiteral(moduleExportNameTextUnescaped(e.propertyName || e.name))
|
|
108987
109097
|
)
|
|
108988
109098
|
)
|
|
108989
109099
|
);
|
|
@@ -109010,7 +109120,7 @@ function transformSystemModule(context) {
|
|
|
109010
109120
|
/*typeArguments*/
|
|
109011
109121
|
void 0,
|
|
109012
109122
|
[
|
|
109013
|
-
factory2.createStringLiteral(
|
|
109123
|
+
factory2.createStringLiteral(moduleExportNameTextUnescaped(entry.exportClause.name)),
|
|
109014
109124
|
parameterName
|
|
109015
109125
|
]
|
|
109016
109126
|
)
|
|
@@ -109350,7 +109460,7 @@ function transformSystemModule(context) {
|
|
|
109350
109460
|
const exportSpecifiers = moduleInfo.exportSpecifiers.get(name);
|
|
109351
109461
|
if (exportSpecifiers) {
|
|
109352
109462
|
for (const exportSpecifier of exportSpecifiers) {
|
|
109353
|
-
if (exportSpecifier.name
|
|
109463
|
+
if (moduleExportNameTextUnescaped(exportSpecifier.name) !== excludeName) {
|
|
109354
109464
|
statements = appendExportStatement(statements, exportSpecifier.name, name);
|
|
109355
109465
|
}
|
|
109356
109466
|
}
|
|
@@ -109771,13 +109881,12 @@ function transformSystemModule(context) {
|
|
|
109771
109881
|
node
|
|
109772
109882
|
);
|
|
109773
109883
|
} else if (isImportSpecifier(importDeclaration)) {
|
|
109884
|
+
const importedName = importDeclaration.propertyName || importDeclaration.name;
|
|
109885
|
+
const target = factory2.getGeneratedNameForNode(((_b = (_a = importDeclaration.parent) == null ? void 0 : _a.parent) == null ? void 0 : _b.parent) || importDeclaration);
|
|
109774
109886
|
return setTextRange(
|
|
109775
109887
|
factory2.createPropertyAssignment(
|
|
109776
109888
|
factory2.cloneNode(name),
|
|
109777
|
-
factory2.createPropertyAccessExpression(
|
|
109778
|
-
factory2.getGeneratedNameForNode(((_b = (_a = importDeclaration.parent) == null ? void 0 : _a.parent) == null ? void 0 : _b.parent) || importDeclaration),
|
|
109779
|
-
factory2.cloneNode(importDeclaration.propertyName || importDeclaration.name)
|
|
109780
|
-
)
|
|
109889
|
+
importedName.kind === 11 /* StringLiteral */ ? factory2.createElementAccessExpression(target, factory2.cloneNode(importedName)) : factory2.createPropertyAccessExpression(target, factory2.cloneNode(importedName))
|
|
109781
109890
|
),
|
|
109782
109891
|
/*location*/
|
|
109783
109892
|
node
|
|
@@ -109820,11 +109929,10 @@ function transformSystemModule(context) {
|
|
|
109820
109929
|
node
|
|
109821
109930
|
);
|
|
109822
109931
|
} else if (isImportSpecifier(importDeclaration)) {
|
|
109932
|
+
const importedName = importDeclaration.propertyName || importDeclaration.name;
|
|
109933
|
+
const target = factory2.getGeneratedNameForNode(((_b = (_a = importDeclaration.parent) == null ? void 0 : _a.parent) == null ? void 0 : _b.parent) || importDeclaration);
|
|
109823
109934
|
return setTextRange(
|
|
109824
|
-
factory2.createPropertyAccessExpression(
|
|
109825
|
-
factory2.getGeneratedNameForNode(((_b = (_a = importDeclaration.parent) == null ? void 0 : _a.parent) == null ? void 0 : _b.parent) || importDeclaration),
|
|
109826
|
-
factory2.cloneNode(importDeclaration.propertyName || importDeclaration.name)
|
|
109827
|
-
),
|
|
109935
|
+
importedName.kind === 11 /* StringLiteral */ ? factory2.createElementAccessExpression(target, factory2.cloneNode(importedName)) : factory2.createPropertyAccessExpression(target, factory2.cloneNode(importedName)),
|
|
109828
109936
|
/*location*/
|
|
109829
109937
|
node
|
|
109830
109938
|
);
|
|
@@ -111415,15 +111523,17 @@ function transformDeclarations(context) {
|
|
|
111415
111523
|
if (isDeclarationAndNotVisible(input)) return;
|
|
111416
111524
|
if (hasDynamicName(input)) {
|
|
111417
111525
|
if (isolatedDeclarations) {
|
|
111418
|
-
if (
|
|
111419
|
-
|
|
111420
|
-
|
|
111421
|
-
|
|
111422
|
-
|
|
111423
|
-
|
|
111424
|
-
|
|
111425
|
-
|
|
111426
|
-
|
|
111526
|
+
if (!resolver.isDefinitelyReferenceToGlobalSymbolObject(input.name.expression)) {
|
|
111527
|
+
if (isClassDeclaration(input.parent) || isObjectLiteralExpression(input.parent)) {
|
|
111528
|
+
context.addDiagnostic(createDiagnosticForNode(input, Diagnostics.Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations));
|
|
111529
|
+
return;
|
|
111530
|
+
} else if (
|
|
111531
|
+
// Type declarations just need to double-check that the input computed name is an entity name expression
|
|
111532
|
+
(isInterfaceDeclaration(input.parent) || isTypeLiteralNode(input.parent)) && !isEntityNameExpression(input.name.expression)
|
|
111533
|
+
) {
|
|
111534
|
+
context.addDiagnostic(createDiagnosticForNode(input, Diagnostics.Computed_properties_must_be_number_or_string_literals_variables_or_dotted_expressions_with_isolatedDeclarations));
|
|
111535
|
+
return;
|
|
111536
|
+
}
|
|
111427
111537
|
}
|
|
111428
111538
|
} else if (!resolver.isLateBound(getParseTreeNode(input)) || !isEntityNameExpression(input.name.expression)) {
|
|
111429
111539
|
return;
|
|
@@ -113372,7 +113482,8 @@ var notImplementedResolver = {
|
|
|
113372
113482
|
getJsxFragmentFactoryEntity: notImplemented,
|
|
113373
113483
|
isBindingCapturedByNode: notImplemented,
|
|
113374
113484
|
getDeclarationStatementsForSourceFile: notImplemented,
|
|
113375
|
-
isImportRequiredByAugmentation: notImplemented
|
|
113485
|
+
isImportRequiredByAugmentation: notImplemented,
|
|
113486
|
+
isDefinitelyReferenceToGlobalSymbolObject: notImplemented
|
|
113376
113487
|
};
|
|
113377
113488
|
var createPrinterWithDefaults = /* @__PURE__ */ memoize(() => createPrinter({}));
|
|
113378
113489
|
var createPrinterWithRemoveComments = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true }));
|
|
@@ -129741,7 +129852,7 @@ function createSyntacticTypeNodeBuilder(options, resolver) {
|
|
|
129741
129852
|
expression,
|
|
129742
129853
|
/*includeBigInt*/
|
|
129743
129854
|
false
|
|
129744
|
-
)) {
|
|
129855
|
+
) && !resolver.isDefinitelyReferenceToGlobalSymbolObject(expression)) {
|
|
129745
129856
|
context.tracker.reportInferenceFallback(prop.name);
|
|
129746
129857
|
result = false;
|
|
129747
129858
|
}
|