@typescript-deploys/pr-build 5.5.0-pr-58650-7 → 5.5.0-pr-58364-29
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 +334 -141
- package/lib/typescript.js +334 -169
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -1518,6 +1518,15 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
1518
1518
|
);
|
|
1519
1519
|
}
|
|
1520
1520
|
Debug2.formatNodeFlags = formatNodeFlags;
|
|
1521
|
+
function formatNodeCheckFlags(flags) {
|
|
1522
|
+
return formatEnum(
|
|
1523
|
+
flags,
|
|
1524
|
+
NodeCheckFlags,
|
|
1525
|
+
/*isFlags*/
|
|
1526
|
+
true
|
|
1527
|
+
);
|
|
1528
|
+
}
|
|
1529
|
+
Debug2.formatNodeCheckFlags = formatNodeCheckFlags;
|
|
1521
1530
|
function formatModifierFlags(flags) {
|
|
1522
1531
|
return formatEnum(
|
|
1523
1532
|
flags,
|
|
@@ -3530,6 +3539,34 @@ var SymbolFlags = /* @__PURE__ */ ((SymbolFlags2) => {
|
|
|
3530
3539
|
SymbolFlags2[SymbolFlags2["LateBindingContainer"] = 6256] = "LateBindingContainer";
|
|
3531
3540
|
return SymbolFlags2;
|
|
3532
3541
|
})(SymbolFlags || {});
|
|
3542
|
+
var NodeCheckFlags = /* @__PURE__ */ ((NodeCheckFlags3) => {
|
|
3543
|
+
NodeCheckFlags3[NodeCheckFlags3["None"] = 0] = "None";
|
|
3544
|
+
NodeCheckFlags3[NodeCheckFlags3["TypeChecked"] = 1] = "TypeChecked";
|
|
3545
|
+
NodeCheckFlags3[NodeCheckFlags3["LexicalThis"] = 2] = "LexicalThis";
|
|
3546
|
+
NodeCheckFlags3[NodeCheckFlags3["CaptureThis"] = 4] = "CaptureThis";
|
|
3547
|
+
NodeCheckFlags3[NodeCheckFlags3["CaptureNewTarget"] = 8] = "CaptureNewTarget";
|
|
3548
|
+
NodeCheckFlags3[NodeCheckFlags3["SuperInstance"] = 16] = "SuperInstance";
|
|
3549
|
+
NodeCheckFlags3[NodeCheckFlags3["SuperStatic"] = 32] = "SuperStatic";
|
|
3550
|
+
NodeCheckFlags3[NodeCheckFlags3["ContextChecked"] = 64] = "ContextChecked";
|
|
3551
|
+
NodeCheckFlags3[NodeCheckFlags3["MethodWithSuperPropertyAccessInAsync"] = 128] = "MethodWithSuperPropertyAccessInAsync";
|
|
3552
|
+
NodeCheckFlags3[NodeCheckFlags3["MethodWithSuperPropertyAssignmentInAsync"] = 256] = "MethodWithSuperPropertyAssignmentInAsync";
|
|
3553
|
+
NodeCheckFlags3[NodeCheckFlags3["CaptureArguments"] = 512] = "CaptureArguments";
|
|
3554
|
+
NodeCheckFlags3[NodeCheckFlags3["EnumValuesComputed"] = 1024] = "EnumValuesComputed";
|
|
3555
|
+
NodeCheckFlags3[NodeCheckFlags3["LexicalModuleMergesWithClass"] = 2048] = "LexicalModuleMergesWithClass";
|
|
3556
|
+
NodeCheckFlags3[NodeCheckFlags3["LoopWithCapturedBlockScopedBinding"] = 4096] = "LoopWithCapturedBlockScopedBinding";
|
|
3557
|
+
NodeCheckFlags3[NodeCheckFlags3["ContainsCapturedBlockScopeBinding"] = 8192] = "ContainsCapturedBlockScopeBinding";
|
|
3558
|
+
NodeCheckFlags3[NodeCheckFlags3["CapturedBlockScopedBinding"] = 16384] = "CapturedBlockScopedBinding";
|
|
3559
|
+
NodeCheckFlags3[NodeCheckFlags3["BlockScopedBindingInLoop"] = 32768] = "BlockScopedBindingInLoop";
|
|
3560
|
+
NodeCheckFlags3[NodeCheckFlags3["NeedsLoopOutParameter"] = 65536] = "NeedsLoopOutParameter";
|
|
3561
|
+
NodeCheckFlags3[NodeCheckFlags3["AssignmentsMarked"] = 131072] = "AssignmentsMarked";
|
|
3562
|
+
NodeCheckFlags3[NodeCheckFlags3["ContainsConstructorReference"] = 262144] = "ContainsConstructorReference";
|
|
3563
|
+
NodeCheckFlags3[NodeCheckFlags3["ConstructorReference"] = 536870912] = "ConstructorReference";
|
|
3564
|
+
NodeCheckFlags3[NodeCheckFlags3["ContainsClassWithPrivateIdentifiers"] = 1048576] = "ContainsClassWithPrivateIdentifiers";
|
|
3565
|
+
NodeCheckFlags3[NodeCheckFlags3["ContainsSuperPropertyInStaticInitializer"] = 2097152] = "ContainsSuperPropertyInStaticInitializer";
|
|
3566
|
+
NodeCheckFlags3[NodeCheckFlags3["InCheckIdentifier"] = 4194304] = "InCheckIdentifier";
|
|
3567
|
+
NodeCheckFlags3[NodeCheckFlags3["LazyFlags"] = 539358128] = "LazyFlags";
|
|
3568
|
+
return NodeCheckFlags3;
|
|
3569
|
+
})(NodeCheckFlags || {});
|
|
3533
3570
|
var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
3534
3571
|
TypeFlags2[TypeFlags2["Any"] = 1] = "Any";
|
|
3535
3572
|
TypeFlags2[TypeFlags2["Unknown"] = 2] = "Unknown";
|
|
@@ -9693,25 +9730,19 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9693
9730
|
}
|
|
9694
9731
|
function reScanSlashToken(reportErrors2) {
|
|
9695
9732
|
if (token === 44 /* SlashToken */ || token === 69 /* SlashEqualsToken */) {
|
|
9696
|
-
|
|
9733
|
+
const startOfRegExpBody = tokenStart + 1;
|
|
9734
|
+
pos = startOfRegExpBody;
|
|
9697
9735
|
let inEscape = false;
|
|
9698
9736
|
let inCharacterClass = false;
|
|
9699
9737
|
while (true) {
|
|
9700
|
-
|
|
9701
|
-
|
|
9702
|
-
error(Diagnostics.Unterminated_regular_expression_literal);
|
|
9703
|
-
break;
|
|
9704
|
-
}
|
|
9705
|
-
const ch = charCodeUnchecked(p);
|
|
9706
|
-
if (isLineBreak(ch)) {
|
|
9738
|
+
const ch = charCodeChecked(pos);
|
|
9739
|
+
if (ch === -1 /* EOF */ || isLineBreak(ch)) {
|
|
9707
9740
|
tokenFlags |= 4 /* Unterminated */;
|
|
9708
|
-
error(Diagnostics.Unterminated_regular_expression_literal);
|
|
9709
9741
|
break;
|
|
9710
9742
|
}
|
|
9711
9743
|
if (inEscape) {
|
|
9712
9744
|
inEscape = false;
|
|
9713
9745
|
} else if (ch === 47 /* slash */ && !inCharacterClass) {
|
|
9714
|
-
p++;
|
|
9715
9746
|
break;
|
|
9716
9747
|
} else if (ch === 91 /* openBracket */) {
|
|
9717
9748
|
inCharacterClass = true;
|
|
@@ -9720,59 +9751,86 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9720
9751
|
} else if (ch === 93 /* closeBracket */) {
|
|
9721
9752
|
inCharacterClass = false;
|
|
9722
9753
|
}
|
|
9723
|
-
|
|
9754
|
+
pos++;
|
|
9724
9755
|
}
|
|
9725
|
-
const
|
|
9726
|
-
|
|
9727
|
-
|
|
9728
|
-
|
|
9729
|
-
|
|
9730
|
-
|
|
9731
|
-
|
|
9756
|
+
const endOfRegExpBody = pos;
|
|
9757
|
+
if (tokenFlags & 4 /* Unterminated */) {
|
|
9758
|
+
pos = startOfRegExpBody;
|
|
9759
|
+
inEscape = false;
|
|
9760
|
+
let characterClassDepth = 0;
|
|
9761
|
+
let inDecimalQuantifier = false;
|
|
9762
|
+
let groupDepth = 0;
|
|
9763
|
+
while (pos < endOfRegExpBody) {
|
|
9764
|
+
const ch = charCodeUnchecked(pos);
|
|
9765
|
+
if (inEscape) {
|
|
9766
|
+
inEscape = false;
|
|
9767
|
+
} else if (ch === 92 /* backslash */) {
|
|
9768
|
+
inEscape = true;
|
|
9769
|
+
} else if (ch === 91 /* openBracket */) {
|
|
9770
|
+
characterClassDepth++;
|
|
9771
|
+
} else if (ch === 93 /* closeBracket */ && characterClassDepth) {
|
|
9772
|
+
characterClassDepth--;
|
|
9773
|
+
} else if (!characterClassDepth) {
|
|
9774
|
+
if (ch === 123 /* openBrace */) {
|
|
9775
|
+
inDecimalQuantifier = true;
|
|
9776
|
+
} else if (ch === 125 /* closeBrace */ && inDecimalQuantifier) {
|
|
9777
|
+
inDecimalQuantifier = false;
|
|
9778
|
+
} else if (!inDecimalQuantifier) {
|
|
9779
|
+
if (ch === 40 /* openParen */) {
|
|
9780
|
+
groupDepth++;
|
|
9781
|
+
} else if (ch === 41 /* closeParen */ && groupDepth) {
|
|
9782
|
+
groupDepth--;
|
|
9783
|
+
} else if (ch === 41 /* closeParen */ || ch === 93 /* closeBracket */ || ch === 125 /* closeBrace */) {
|
|
9784
|
+
break;
|
|
9785
|
+
}
|
|
9786
|
+
}
|
|
9787
|
+
}
|
|
9788
|
+
pos++;
|
|
9732
9789
|
}
|
|
9733
|
-
|
|
9734
|
-
|
|
9735
|
-
|
|
9736
|
-
|
|
9737
|
-
|
|
9738
|
-
|
|
9739
|
-
|
|
9740
|
-
|
|
9741
|
-
|
|
9742
|
-
|
|
9743
|
-
|
|
9790
|
+
while (isWhiteSpaceLike(charCodeChecked(pos - 1)) || charCodeChecked(pos - 1) === 59 /* semicolon */) pos--;
|
|
9791
|
+
error(Diagnostics.Unterminated_regular_expression_literal, tokenStart, pos - tokenStart);
|
|
9792
|
+
} else {
|
|
9793
|
+
pos++;
|
|
9794
|
+
let regExpFlags = 0 /* None */;
|
|
9795
|
+
while (true) {
|
|
9796
|
+
const ch = codePointChecked(pos);
|
|
9797
|
+
if (ch === -1 /* EOF */ || !isIdentifierPart(ch, languageVersion)) {
|
|
9798
|
+
break;
|
|
9799
|
+
}
|
|
9800
|
+
if (reportErrors2) {
|
|
9801
|
+
const flag = characterToRegularExpressionFlag(String.fromCharCode(ch));
|
|
9802
|
+
if (flag === void 0) {
|
|
9803
|
+
error(Diagnostics.Unknown_regular_expression_flag, pos, 1);
|
|
9804
|
+
} else if (regExpFlags & flag) {
|
|
9805
|
+
error(Diagnostics.Duplicate_regular_expression_flag, pos, 1);
|
|
9806
|
+
} else if (((regExpFlags | flag) & 96 /* AnyUnicodeMode */) === 96 /* AnyUnicodeMode */) {
|
|
9807
|
+
error(Diagnostics.The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously, pos, 1);
|
|
9808
|
+
} else {
|
|
9809
|
+
regExpFlags |= flag;
|
|
9810
|
+
checkRegularExpressionFlagAvailable(flag, pos);
|
|
9811
|
+
}
|
|
9744
9812
|
}
|
|
9813
|
+
pos++;
|
|
9814
|
+
}
|
|
9815
|
+
if (reportErrors2) {
|
|
9816
|
+
scanRange(startOfRegExpBody, endOfRegExpBody - startOfRegExpBody, () => {
|
|
9817
|
+
scanRegularExpressionWorker(
|
|
9818
|
+
regExpFlags,
|
|
9819
|
+
/*annexB*/
|
|
9820
|
+
true
|
|
9821
|
+
);
|
|
9822
|
+
});
|
|
9745
9823
|
}
|
|
9746
|
-
p++;
|
|
9747
|
-
}
|
|
9748
|
-
pos = p;
|
|
9749
|
-
if (reportErrors2) {
|
|
9750
|
-
const saveTokenStart = tokenStart;
|
|
9751
|
-
const saveTokenFlags = tokenFlags;
|
|
9752
|
-
const savePos = pos;
|
|
9753
|
-
const saveEnd = end;
|
|
9754
|
-
pos = tokenStart + 1;
|
|
9755
|
-
end = endOfBody;
|
|
9756
|
-
scanRegularExpressionWorker(
|
|
9757
|
-
regExpFlags,
|
|
9758
|
-
isUnterminated,
|
|
9759
|
-
/*annexB*/
|
|
9760
|
-
true
|
|
9761
|
-
);
|
|
9762
|
-
tokenStart = saveTokenStart;
|
|
9763
|
-
tokenFlags = saveTokenFlags;
|
|
9764
|
-
pos = savePos;
|
|
9765
|
-
end = saveEnd;
|
|
9766
9824
|
}
|
|
9767
9825
|
tokenValue = text.substring(tokenStart, pos);
|
|
9768
9826
|
token = 14 /* RegularExpressionLiteral */;
|
|
9769
9827
|
}
|
|
9770
9828
|
return token;
|
|
9771
9829
|
}
|
|
9772
|
-
function scanRegularExpressionWorker(regExpFlags,
|
|
9830
|
+
function scanRegularExpressionWorker(regExpFlags, annexB) {
|
|
9773
9831
|
var unicodeSetsMode = !!(regExpFlags & 64 /* UnicodeSets */);
|
|
9774
|
-
var
|
|
9775
|
-
if (
|
|
9832
|
+
var anyUnicodeMode = !!(regExpFlags & 96 /* AnyUnicodeMode */);
|
|
9833
|
+
if (anyUnicodeMode) {
|
|
9776
9834
|
annexB = false;
|
|
9777
9835
|
}
|
|
9778
9836
|
var mayContainStrings = false;
|
|
@@ -9891,7 +9949,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9891
9949
|
if (max || charCodeChecked(pos) === 125 /* closeBrace */) {
|
|
9892
9950
|
error(Diagnostics.Incomplete_quantifier_Digit_expected, digitsStart, 0);
|
|
9893
9951
|
} else {
|
|
9894
|
-
if (
|
|
9952
|
+
if (anyUnicodeMode) {
|
|
9895
9953
|
error(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, start2, 1, String.fromCharCode(ch));
|
|
9896
9954
|
}
|
|
9897
9955
|
isPreviousTermQuantifiable = true;
|
|
@@ -9902,7 +9960,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9902
9960
|
error(Diagnostics.Numbers_out_of_order_in_quantifier, digitsStart, pos - digitsStart);
|
|
9903
9961
|
}
|
|
9904
9962
|
} else if (!min2) {
|
|
9905
|
-
if (
|
|
9963
|
+
if (anyUnicodeMode) {
|
|
9906
9964
|
error(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, start2, 1, String.fromCharCode(ch));
|
|
9907
9965
|
}
|
|
9908
9966
|
isPreviousTermQuantifiable = true;
|
|
@@ -9942,10 +10000,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9942
10000
|
}
|
|
9943
10001
|
case 93 /* closeBracket */:
|
|
9944
10002
|
case 125 /* closeBrace */:
|
|
9945
|
-
if (
|
|
9946
|
-
return;
|
|
9947
|
-
}
|
|
9948
|
-
if (unicodeMode || ch === 41 /* closeParen */) {
|
|
10003
|
+
if (anyUnicodeMode || ch === 41 /* closeParen */) {
|
|
9949
10004
|
error(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
|
|
9950
10005
|
}
|
|
9951
10006
|
pos++;
|
|
@@ -9994,7 +10049,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9994
10049
|
true
|
|
9995
10050
|
);
|
|
9996
10051
|
scanExpectedChar(62 /* greaterThan */);
|
|
9997
|
-
} else if (
|
|
10052
|
+
} else if (anyUnicodeMode) {
|
|
9998
10053
|
error(Diagnostics.k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets, pos - 2, 2);
|
|
9999
10054
|
}
|
|
10000
10055
|
break;
|
|
@@ -10027,6 +10082,9 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
10027
10082
|
Debug.assertEqual(charCodeUnchecked(pos - 1), 92 /* backslash */);
|
|
10028
10083
|
let ch = charCodeChecked(pos);
|
|
10029
10084
|
switch (ch) {
|
|
10085
|
+
case -1 /* EOF */:
|
|
10086
|
+
error(Diagnostics.Undetermined_character_escape, pos - 1, 1);
|
|
10087
|
+
return "\\";
|
|
10030
10088
|
case 99 /* c */:
|
|
10031
10089
|
pos++;
|
|
10032
10090
|
ch = charCodeChecked(pos);
|
|
@@ -10034,7 +10092,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
10034
10092
|
pos++;
|
|
10035
10093
|
return String.fromCharCode(ch & 31);
|
|
10036
10094
|
}
|
|
10037
|
-
if (
|
|
10095
|
+
if (anyUnicodeMode) {
|
|
10038
10096
|
error(Diagnostics.c_must_be_followed_by_an_ASCII_letter, pos - 2, 2);
|
|
10039
10097
|
} else if (atomEscape && annexB) {
|
|
10040
10098
|
pos--;
|
|
@@ -10059,14 +10117,10 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
10059
10117
|
pos++;
|
|
10060
10118
|
return String.fromCharCode(ch);
|
|
10061
10119
|
default:
|
|
10062
|
-
if (pos >= end) {
|
|
10063
|
-
error(Diagnostics.Undetermined_character_escape, pos - 1, 1);
|
|
10064
|
-
return "\\";
|
|
10065
|
-
}
|
|
10066
10120
|
pos--;
|
|
10067
10121
|
return scanEscapeSequence(
|
|
10068
10122
|
/*shouldEmitInvalidEscapeError*/
|
|
10069
|
-
|
|
10123
|
+
anyUnicodeMode,
|
|
10070
10124
|
/*isRegularExpression*/
|
|
10071
10125
|
annexB ? "annex-b" : true
|
|
10072
10126
|
);
|
|
@@ -10542,10 +10596,10 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
10542
10596
|
}
|
|
10543
10597
|
}
|
|
10544
10598
|
scanExpectedChar(125 /* closeBrace */);
|
|
10545
|
-
if (!
|
|
10599
|
+
if (!anyUnicodeMode) {
|
|
10546
10600
|
error(Diagnostics.Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set, start2, pos - start2);
|
|
10547
10601
|
}
|
|
10548
|
-
} else if (
|
|
10602
|
+
} else if (anyUnicodeMode) {
|
|
10549
10603
|
error(Diagnostics._0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces, pos - 2, 2, String.fromCharCode(ch));
|
|
10550
10604
|
}
|
|
10551
10605
|
return true;
|
|
@@ -10565,7 +10619,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
10565
10619
|
return value;
|
|
10566
10620
|
}
|
|
10567
10621
|
function scanSourceCharacter() {
|
|
10568
|
-
const size =
|
|
10622
|
+
const size = anyUnicodeMode ? charSize(charCodeChecked(pos)) : 1;
|
|
10569
10623
|
pos += size;
|
|
10570
10624
|
return size > 0 ? text.substring(pos - size, pos) : "";
|
|
10571
10625
|
}
|
|
@@ -28415,10 +28469,7 @@ var Parser;
|
|
|
28415
28469
|
function parseErrorAtPosition(start, length2, message, ...args) {
|
|
28416
28470
|
const lastError = lastOrUndefined(parseDiagnostics);
|
|
28417
28471
|
let result;
|
|
28418
|
-
if (
|
|
28419
|
-
result = createDetachedDiagnostic(fileName, sourceText, start, length2, message, ...args);
|
|
28420
|
-
addRelatedInfo(lastError, result);
|
|
28421
|
-
} else if (!lastError || start !== lastError.start) {
|
|
28472
|
+
if (!lastError || start !== lastError.start) {
|
|
28422
28473
|
result = createDetachedDiagnostic(fileName, sourceText, start, length2, message, ...args);
|
|
28423
28474
|
parseDiagnostics.push(result);
|
|
28424
28475
|
}
|
|
@@ -35866,7 +35917,7 @@ var commandOptionsWithoutBuild = [
|
|
|
35866
35917
|
showInSimplifiedHelpView: false,
|
|
35867
35918
|
category: Diagnostics.Compiler_Diagnostics,
|
|
35868
35919
|
description: Diagnostics.Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported,
|
|
35869
|
-
transpileOptionValue:
|
|
35920
|
+
transpileOptionValue: true,
|
|
35870
35921
|
defaultValueDescription: false,
|
|
35871
35922
|
affectsSemanticDiagnostics: true,
|
|
35872
35923
|
affectsBuildInfo: true,
|
|
@@ -47663,10 +47714,22 @@ function createTypeChecker(host) {
|
|
|
47663
47714
|
return !!aliasDeclarationLinks.typeOnlyDeclaration;
|
|
47664
47715
|
}
|
|
47665
47716
|
function getTypeOnlyAliasDeclaration(symbol, include) {
|
|
47717
|
+
var _a;
|
|
47666
47718
|
if (!(symbol.flags & 2097152 /* Alias */)) {
|
|
47667
47719
|
return void 0;
|
|
47668
47720
|
}
|
|
47669
47721
|
const links = getSymbolLinks(symbol);
|
|
47722
|
+
if (links.typeOnlyDeclaration === void 0) {
|
|
47723
|
+
links.typeOnlyDeclaration = false;
|
|
47724
|
+
const resolved = resolveSymbol(symbol);
|
|
47725
|
+
markSymbolOfAliasDeclarationIfTypeOnly(
|
|
47726
|
+
(_a = symbol.declarations) == null ? void 0 : _a[0],
|
|
47727
|
+
getDeclarationOfAliasSymbol(symbol) && getImmediateAliasedSymbol(symbol),
|
|
47728
|
+
resolved,
|
|
47729
|
+
/*overwriteEmpty*/
|
|
47730
|
+
true
|
|
47731
|
+
);
|
|
47732
|
+
}
|
|
47670
47733
|
if (include === void 0) {
|
|
47671
47734
|
return links.typeOnlyDeclaration || void 0;
|
|
47672
47735
|
}
|
|
@@ -65733,17 +65796,12 @@ function createTypeChecker(host) {
|
|
|
65733
65796
|
}
|
|
65734
65797
|
}
|
|
65735
65798
|
function applyToReturnTypes(source, target, callback) {
|
|
65799
|
+
const sourceTypePredicate = getTypePredicateOfSignature(source);
|
|
65736
65800
|
const targetTypePredicate = getTypePredicateOfSignature(target);
|
|
65737
|
-
if (targetTypePredicate) {
|
|
65738
|
-
|
|
65739
|
-
|
|
65740
|
-
|
|
65741
|
-
return;
|
|
65742
|
-
}
|
|
65743
|
-
}
|
|
65744
|
-
const targetReturnType = getReturnTypeOfSignature(target);
|
|
65745
|
-
if (couldContainTypeVariables(targetReturnType)) {
|
|
65746
|
-
callback(getReturnTypeOfSignature(source), targetReturnType);
|
|
65801
|
+
if (sourceTypePredicate && targetTypePredicate && typePredicateKindsMatch(sourceTypePredicate, targetTypePredicate) && sourceTypePredicate.type && targetTypePredicate.type) {
|
|
65802
|
+
callback(sourceTypePredicate.type, targetTypePredicate.type);
|
|
65803
|
+
} else {
|
|
65804
|
+
callback(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target));
|
|
65747
65805
|
}
|
|
65748
65806
|
}
|
|
65749
65807
|
function createInferenceContext(typeParameters, signature, flags, compareTypes) {
|
|
@@ -69168,9 +69226,6 @@ function createTypeChecker(host) {
|
|
|
69168
69226
|
if (isJsxOpeningLikeElement(location) || isJsxOpeningFragment(location)) {
|
|
69169
69227
|
return markJsxAliasReferenced(location);
|
|
69170
69228
|
}
|
|
69171
|
-
if (isFunctionLikeDeclaration(location) || isMethodSignature(location)) {
|
|
69172
|
-
return markAsyncFunctionAliasReferenced(location);
|
|
69173
|
-
}
|
|
69174
69229
|
if (isImportEqualsDeclaration(location)) {
|
|
69175
69230
|
if (isInternalModuleImportEqualsDeclaration(location) || checkExternalImportOrExportDeclaration(location)) {
|
|
69176
69231
|
return markImportEqualsAliasReferenced(location);
|
|
@@ -69180,6 +69235,9 @@ function createTypeChecker(host) {
|
|
|
69180
69235
|
if (isExportSpecifier(location)) {
|
|
69181
69236
|
return markExportSpecifierAliasReferenced(location);
|
|
69182
69237
|
}
|
|
69238
|
+
if (isFunctionLikeDeclaration(location) || isMethodSignature(location)) {
|
|
69239
|
+
markAsyncFunctionAliasReferenced(location);
|
|
69240
|
+
}
|
|
69183
69241
|
if (!compilerOptions.emitDecoratorMetadata) {
|
|
69184
69242
|
return;
|
|
69185
69243
|
}
|
|
@@ -69517,18 +69575,12 @@ function createTypeChecker(host) {
|
|
|
69517
69575
|
}
|
|
69518
69576
|
return type;
|
|
69519
69577
|
}
|
|
69520
|
-
function
|
|
69521
|
-
if (isThisInTypeQuery(node))
|
|
69522
|
-
return checkThisExpression(node);
|
|
69523
|
-
}
|
|
69524
|
-
const symbol = getResolvedSymbol(node);
|
|
69525
|
-
if (symbol === unknownSymbol) {
|
|
69526
|
-
return errorType;
|
|
69527
|
-
}
|
|
69578
|
+
function checkIdentifierCalculateNodeCheckFlags(node, symbol) {
|
|
69579
|
+
if (isThisInTypeQuery(node)) return;
|
|
69528
69580
|
if (symbol === argumentsSymbol) {
|
|
69529
69581
|
if (isInPropertyInitializerOrClassStaticBlock(node)) {
|
|
69530
69582
|
error(node, Diagnostics.arguments_cannot_be_referenced_in_property_initializers);
|
|
69531
|
-
return
|
|
69583
|
+
return;
|
|
69532
69584
|
}
|
|
69533
69585
|
let container = getContainingFunction(node);
|
|
69534
69586
|
if (container) {
|
|
@@ -69547,17 +69599,14 @@ function createTypeChecker(host) {
|
|
|
69547
69599
|
}
|
|
69548
69600
|
}
|
|
69549
69601
|
}
|
|
69550
|
-
return
|
|
69551
|
-
}
|
|
69552
|
-
if (shouldMarkIdentifierAliasReferenced(node)) {
|
|
69553
|
-
markLinkedReferences(node, 1 /* Identifier */);
|
|
69602
|
+
return;
|
|
69554
69603
|
}
|
|
69555
69604
|
const localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol);
|
|
69556
69605
|
const targetSymbol = resolveAliasWithDeprecationCheck(localOrExportSymbol, node);
|
|
69557
69606
|
if (isDeprecatedSymbol(targetSymbol) && isUncalledFunctionReference(node, targetSymbol) && targetSymbol.declarations) {
|
|
69558
69607
|
addDeprecatedSuggestion(node, targetSymbol.declarations, node.escapedText);
|
|
69559
69608
|
}
|
|
69560
|
-
|
|
69609
|
+
const declaration = localOrExportSymbol.valueDeclaration;
|
|
69561
69610
|
if (declaration && localOrExportSymbol.flags & 32 /* Class */) {
|
|
69562
69611
|
if (isClassLike(declaration) && declaration.name !== node) {
|
|
69563
69612
|
let container = getThisContainer(
|
|
@@ -69584,6 +69633,27 @@ function createTypeChecker(host) {
|
|
|
69584
69633
|
}
|
|
69585
69634
|
}
|
|
69586
69635
|
checkNestedBlockScopedBinding(node, symbol);
|
|
69636
|
+
}
|
|
69637
|
+
function checkIdentifier(node, checkMode) {
|
|
69638
|
+
if (isThisInTypeQuery(node)) {
|
|
69639
|
+
return checkThisExpression(node);
|
|
69640
|
+
}
|
|
69641
|
+
const symbol = getResolvedSymbol(node);
|
|
69642
|
+
if (symbol === unknownSymbol) {
|
|
69643
|
+
return errorType;
|
|
69644
|
+
}
|
|
69645
|
+
checkIdentifierCalculateNodeCheckFlags(node, symbol);
|
|
69646
|
+
if (symbol === argumentsSymbol) {
|
|
69647
|
+
if (isInPropertyInitializerOrClassStaticBlock(node)) {
|
|
69648
|
+
return errorType;
|
|
69649
|
+
}
|
|
69650
|
+
return getTypeOfSymbol(symbol);
|
|
69651
|
+
}
|
|
69652
|
+
if (shouldMarkIdentifierAliasReferenced(node)) {
|
|
69653
|
+
markLinkedReferences(node, 1 /* Identifier */);
|
|
69654
|
+
}
|
|
69655
|
+
const localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol);
|
|
69656
|
+
let declaration = localOrExportSymbol.valueDeclaration;
|
|
69587
69657
|
let type = getNarrowedTypeOfSymbol(localOrExportSymbol, node, checkMode);
|
|
69588
69658
|
const assignmentKind = getAssignmentTargetKind(node);
|
|
69589
69659
|
if (assignmentKind) {
|
|
@@ -84570,7 +84640,6 @@ function createTypeChecker(host) {
|
|
|
84570
84640
|
if (links.isDeclarationWithCollidingName === void 0) {
|
|
84571
84641
|
const container = getEnclosingBlockScopeContainer(symbol.valueDeclaration);
|
|
84572
84642
|
if (isStatementWithLocals(container) || isSymbolOfDestructuredElementOfCatchBinding(symbol)) {
|
|
84573
|
-
const nodeLinks2 = getNodeLinks(symbol.valueDeclaration);
|
|
84574
84643
|
if (resolveName(
|
|
84575
84644
|
container.parent,
|
|
84576
84645
|
symbol.escapedName,
|
|
@@ -84581,8 +84650,8 @@ function createTypeChecker(host) {
|
|
|
84581
84650
|
false
|
|
84582
84651
|
)) {
|
|
84583
84652
|
links.isDeclarationWithCollidingName = true;
|
|
84584
|
-
} else if (
|
|
84585
|
-
const isDeclaredInLoop =
|
|
84653
|
+
} else if (hasNodeCheckFlag(symbol.valueDeclaration, 16384 /* CapturedBlockScopedBinding */)) {
|
|
84654
|
+
const isDeclaredInLoop = hasNodeCheckFlag(symbol.valueDeclaration, 32768 /* BlockScopedBindingInLoop */);
|
|
84586
84655
|
const inLoopInitializer = isIterationStatement(
|
|
84587
84656
|
container,
|
|
84588
84657
|
/*lookInLabeledStatements*/
|
|
@@ -84664,6 +84733,9 @@ function createTypeChecker(host) {
|
|
|
84664
84733
|
if (!symbol) {
|
|
84665
84734
|
return false;
|
|
84666
84735
|
}
|
|
84736
|
+
const container = getSourceFileOfNode(symbol.valueDeclaration);
|
|
84737
|
+
const fileSymbol = container && getSymbolOfDeclaration(container);
|
|
84738
|
+
void resolveExternalModuleSymbol(fileSymbol);
|
|
84667
84739
|
const target = getExportSymbolOfValueSymbolIfExported(resolveAlias(symbol));
|
|
84668
84740
|
if (target === unknownSymbol) {
|
|
84669
84741
|
return !excludeTypeOnlyValues || !getTypeOnlyAliasDeclaration(symbol);
|
|
@@ -84762,6 +84834,108 @@ function createTypeChecker(host) {
|
|
|
84762
84834
|
if (nodeId < 0 || nodeId >= nodeLinks.length) return 0;
|
|
84763
84835
|
return ((_a = nodeLinks[nodeId]) == null ? void 0 : _a.flags) || 0;
|
|
84764
84836
|
}
|
|
84837
|
+
function hasNodeCheckFlag(node, flag) {
|
|
84838
|
+
calculateNodeCheckFlagWorker(node, flag);
|
|
84839
|
+
return !!(getNodeCheckFlags(node) & flag);
|
|
84840
|
+
}
|
|
84841
|
+
function calculateNodeCheckFlagWorker(node, flag) {
|
|
84842
|
+
if (!compilerOptions.noCheck) {
|
|
84843
|
+
return;
|
|
84844
|
+
}
|
|
84845
|
+
const links = getNodeLinks(node);
|
|
84846
|
+
if (links.calculatedFlags & flag) {
|
|
84847
|
+
return;
|
|
84848
|
+
}
|
|
84849
|
+
switch (flag) {
|
|
84850
|
+
case 16 /* SuperInstance */:
|
|
84851
|
+
case 32 /* SuperStatic */:
|
|
84852
|
+
return checkSingleSuperExpression(node);
|
|
84853
|
+
case 128 /* MethodWithSuperPropertyAccessInAsync */:
|
|
84854
|
+
case 256 /* MethodWithSuperPropertyAssignmentInAsync */:
|
|
84855
|
+
case 2097152 /* ContainsSuperPropertyInStaticInitializer */:
|
|
84856
|
+
return checkChildSuperExpressions(node);
|
|
84857
|
+
case 512 /* CaptureArguments */:
|
|
84858
|
+
case 8192 /* ContainsCapturedBlockScopeBinding */:
|
|
84859
|
+
case 65536 /* NeedsLoopOutParameter */:
|
|
84860
|
+
case 262144 /* ContainsConstructorReference */:
|
|
84861
|
+
return checkChildIdentifiers(node);
|
|
84862
|
+
case 536870912 /* ConstructorReference */:
|
|
84863
|
+
return checkSingleIdentifier(node);
|
|
84864
|
+
case 4096 /* LoopWithCapturedBlockScopedBinding */:
|
|
84865
|
+
case 32768 /* BlockScopedBindingInLoop */:
|
|
84866
|
+
case 16384 /* CapturedBlockScopedBinding */:
|
|
84867
|
+
return checkContainingBlockScopeBindingUses(node);
|
|
84868
|
+
default:
|
|
84869
|
+
return Debug.assertNever(flag, `Unhandled node check flag calculation: ${Debug.formatNodeCheckFlags(flag)}`);
|
|
84870
|
+
}
|
|
84871
|
+
function forEachNodeRecursively(root, cb) {
|
|
84872
|
+
const rootResult = cb(root, root.parent);
|
|
84873
|
+
if (rootResult === "skip") return void 0;
|
|
84874
|
+
if (rootResult) return rootResult;
|
|
84875
|
+
return forEachChildRecursively(root, cb);
|
|
84876
|
+
}
|
|
84877
|
+
function checkSuperExpressions(node2) {
|
|
84878
|
+
const links2 = getNodeLinks(node2);
|
|
84879
|
+
if (links2.calculatedFlags & flag) return "skip";
|
|
84880
|
+
links2.calculatedFlags |= 128 /* MethodWithSuperPropertyAccessInAsync */ | 256 /* MethodWithSuperPropertyAssignmentInAsync */ | 2097152 /* ContainsSuperPropertyInStaticInitializer */;
|
|
84881
|
+
checkSingleSuperExpression(node2);
|
|
84882
|
+
return void 0;
|
|
84883
|
+
}
|
|
84884
|
+
function checkChildSuperExpressions(node2) {
|
|
84885
|
+
forEachNodeRecursively(node2, checkSuperExpressions);
|
|
84886
|
+
}
|
|
84887
|
+
function checkSingleSuperExpression(node2) {
|
|
84888
|
+
const nodeLinks2 = getNodeLinks(node2);
|
|
84889
|
+
nodeLinks2.calculatedFlags |= 16 /* SuperInstance */ | 32 /* SuperStatic */;
|
|
84890
|
+
if (node2.kind === 108 /* SuperKeyword */) {
|
|
84891
|
+
checkSuperExpression(node2);
|
|
84892
|
+
}
|
|
84893
|
+
}
|
|
84894
|
+
function checkIdentifiers(node2) {
|
|
84895
|
+
const links2 = getNodeLinks(node2);
|
|
84896
|
+
if (links2.calculatedFlags & flag) return "skip";
|
|
84897
|
+
links2.calculatedFlags |= 512 /* CaptureArguments */ | 8192 /* ContainsCapturedBlockScopeBinding */ | 65536 /* NeedsLoopOutParameter */ | 262144 /* ContainsConstructorReference */;
|
|
84898
|
+
checkSingleIdentifier(node2);
|
|
84899
|
+
return void 0;
|
|
84900
|
+
}
|
|
84901
|
+
function checkChildIdentifiers(node2) {
|
|
84902
|
+
forEachNodeRecursively(node2, checkIdentifiers);
|
|
84903
|
+
}
|
|
84904
|
+
function checkSingleIdentifier(node2) {
|
|
84905
|
+
const nodeLinks2 = getNodeLinks(node2);
|
|
84906
|
+
nodeLinks2.calculatedFlags |= 536870912 /* ConstructorReference */ | 16384 /* CapturedBlockScopedBinding */ | 32768 /* BlockScopedBindingInLoop */;
|
|
84907
|
+
if (isIdentifier(node2) && isExpressionNode(node2) && !(isPropertyAccessExpression(node2.parent) && node2.parent.name === node2)) {
|
|
84908
|
+
const s = getSymbolAtLocation(
|
|
84909
|
+
node2,
|
|
84910
|
+
/*ignoreErrors*/
|
|
84911
|
+
true
|
|
84912
|
+
);
|
|
84913
|
+
if (s && s !== unknownSymbol) {
|
|
84914
|
+
checkIdentifierCalculateNodeCheckFlags(node2, s);
|
|
84915
|
+
}
|
|
84916
|
+
}
|
|
84917
|
+
}
|
|
84918
|
+
function checkBlockScopeBindings(node2) {
|
|
84919
|
+
const links2 = getNodeLinks(node2);
|
|
84920
|
+
if (links2.calculatedFlags & flag) return "skip";
|
|
84921
|
+
links2.calculatedFlags |= 4096 /* LoopWithCapturedBlockScopedBinding */ | 32768 /* BlockScopedBindingInLoop */ | 16384 /* CapturedBlockScopedBinding */;
|
|
84922
|
+
checkSingleBlockScopeBinding(node2);
|
|
84923
|
+
return void 0;
|
|
84924
|
+
}
|
|
84925
|
+
function checkContainingBlockScopeBindingUses(node2) {
|
|
84926
|
+
const scope = getEnclosingBlockScopeContainer(isDeclarationName(node2) ? node2.parent : node2);
|
|
84927
|
+
forEachNodeRecursively(scope, checkBlockScopeBindings);
|
|
84928
|
+
}
|
|
84929
|
+
function checkSingleBlockScopeBinding(node2) {
|
|
84930
|
+
checkSingleIdentifier(node2);
|
|
84931
|
+
if (isComputedPropertyName(node2)) {
|
|
84932
|
+
checkComputedPropertyName(node2);
|
|
84933
|
+
}
|
|
84934
|
+
if (isPrivateIdentifier(node2) && isClassElement(node2.parent)) {
|
|
84935
|
+
setNodeLinksForPrivateIdentifierScope(node2.parent);
|
|
84936
|
+
}
|
|
84937
|
+
}
|
|
84938
|
+
}
|
|
84765
84939
|
function getEnumMemberValue(node) {
|
|
84766
84940
|
computeEnumMemberValues(node.parent);
|
|
84767
84941
|
return getNodeLinks(node).enumMemberValue ?? evaluatorResult(
|
|
@@ -84782,7 +84956,15 @@ function createTypeChecker(host) {
|
|
|
84782
84956
|
if (node.kind === 306 /* EnumMember */) {
|
|
84783
84957
|
return getEnumMemberValue(node).value;
|
|
84784
84958
|
}
|
|
84785
|
-
|
|
84959
|
+
if (!getNodeLinks(node).resolvedSymbol) {
|
|
84960
|
+
void checkExpressionCached(node);
|
|
84961
|
+
}
|
|
84962
|
+
const symbol = getNodeLinks(node).resolvedSymbol || (isEntityNameExpression(node) ? resolveEntityName(
|
|
84963
|
+
node,
|
|
84964
|
+
111551 /* Value */,
|
|
84965
|
+
/*ignoreErrors*/
|
|
84966
|
+
true
|
|
84967
|
+
) : void 0);
|
|
84786
84968
|
if (symbol && symbol.flags & 8 /* EnumMember */) {
|
|
84787
84969
|
const member = symbol.valueDeclaration;
|
|
84788
84970
|
if (isEnumConst(member.parent)) {
|
|
@@ -85133,9 +85315,10 @@ function createTypeChecker(host) {
|
|
|
85133
85315
|
const node = getParseTreeNode(nodeIn);
|
|
85134
85316
|
return node && canCollectSymbolAliasAccessabilityData ? isReferencedAliasDeclaration(node, checkChildren) : true;
|
|
85135
85317
|
},
|
|
85136
|
-
|
|
85318
|
+
hasNodeCheckFlag: (nodeIn, flag) => {
|
|
85137
85319
|
const node = getParseTreeNode(nodeIn);
|
|
85138
|
-
|
|
85320
|
+
if (!node) return false;
|
|
85321
|
+
return hasNodeCheckFlag(node, flag);
|
|
85139
85322
|
},
|
|
85140
85323
|
isTopLevelValueImportEqualsWithEntityName,
|
|
85141
85324
|
isDeclarationVisible,
|
|
@@ -85158,6 +85341,10 @@ function createTypeChecker(host) {
|
|
|
85158
85341
|
return node ? getEnumMemberValue(node) : void 0;
|
|
85159
85342
|
},
|
|
85160
85343
|
collectLinkedAliases,
|
|
85344
|
+
markLinkedReferences: (nodeIn) => {
|
|
85345
|
+
const node = getParseTreeNode(nodeIn);
|
|
85346
|
+
return node && markLinkedReferences(node, 0 /* Unspecified */);
|
|
85347
|
+
},
|
|
85161
85348
|
getReferencedValueDeclaration,
|
|
85162
85349
|
getReferencedValueDeclarations,
|
|
85163
85350
|
getTypeReferenceSerializationKind,
|
|
@@ -92949,7 +93136,7 @@ function transformClassFields(context) {
|
|
|
92949
93136
|
containsInstancePrivateElements || (containsInstancePrivateElements = isPrivateIdentifierClassElementDeclaration(member));
|
|
92950
93137
|
} else if (isPrivateIdentifierClassElementDeclaration(member)) {
|
|
92951
93138
|
containsInstancePrivateElements = true;
|
|
92952
|
-
if (resolver.
|
|
93139
|
+
if (resolver.hasNodeCheckFlag(member, 262144 /* ContainsConstructorReference */)) {
|
|
92953
93140
|
facts |= 2 /* NeedsClassConstructorReference */;
|
|
92954
93141
|
}
|
|
92955
93142
|
} else if (isPropertyDeclaration(member)) {
|
|
@@ -93056,7 +93243,7 @@ function transformClassFields(context) {
|
|
|
93056
93243
|
if ((_b = node.emitNode) == null ? void 0 : _b.classThis) {
|
|
93057
93244
|
getClassLexicalEnvironment().classThis = node.emitNode.classThis;
|
|
93058
93245
|
}
|
|
93059
|
-
const isClassWithConstructorReference = resolver.
|
|
93246
|
+
const isClassWithConstructorReference = resolver.hasNodeCheckFlag(node, 262144 /* ContainsConstructorReference */);
|
|
93060
93247
|
const isExport = hasSyntacticModifier(node, 32 /* Export */);
|
|
93061
93248
|
const isDefault = hasSyntacticModifier(node, 2048 /* Default */);
|
|
93062
93249
|
let modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier);
|
|
@@ -93118,15 +93305,14 @@ function transformClassFields(context) {
|
|
|
93118
93305
|
var _a, _b, _c;
|
|
93119
93306
|
const isDecoratedClassDeclaration = !!(facts & 1 /* ClassWasDecorated */);
|
|
93120
93307
|
const staticPropertiesOrClassStaticBlocks = getStaticPropertiesAndClassStaticBlock(node);
|
|
93121
|
-
const
|
|
93122
|
-
const
|
|
93308
|
+
const isClassWithConstructorReference = resolver.hasNodeCheckFlag(node, 262144 /* ContainsConstructorReference */);
|
|
93309
|
+
const requiresBlockScopedVar = resolver.hasNodeCheckFlag(node, 32768 /* BlockScopedBindingInLoop */);
|
|
93123
93310
|
let temp;
|
|
93124
93311
|
function createClassTempVar() {
|
|
93125
93312
|
var _a2;
|
|
93126
93313
|
if (shouldTransformPrivateElementsOrClassStaticBlocks && ((_a2 = node.emitNode) == null ? void 0 : _a2.classThis)) {
|
|
93127
93314
|
return getClassLexicalEnvironment().classConstructor = node.emitNode.classThis;
|
|
93128
93315
|
}
|
|
93129
|
-
const requiresBlockScopedVar = classCheckFlags & 32768 /* BlockScopedBindingInLoop */;
|
|
93130
93316
|
const temp2 = factory2.createTempVariable(
|
|
93131
93317
|
requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration,
|
|
93132
93318
|
/*reservedInNestedScopes*/
|
|
@@ -93694,7 +93880,7 @@ function transformClassFields(context) {
|
|
|
93694
93880
|
const alreadyTransformed = !!cacheAssignment || isAssignmentExpression(innerExpression) && isGeneratedIdentifier(innerExpression.left);
|
|
93695
93881
|
if (!alreadyTransformed && !inlinable && shouldHoist) {
|
|
93696
93882
|
const generatedName = factory2.getGeneratedNameForNode(name);
|
|
93697
|
-
if (resolver.
|
|
93883
|
+
if (resolver.hasNodeCheckFlag(name, 32768 /* BlockScopedBindingInLoop */)) {
|
|
93698
93884
|
addBlockScopedVariable(generatedName);
|
|
93699
93885
|
} else {
|
|
93700
93886
|
hoistVariableDeclaration(generatedName);
|
|
@@ -93848,7 +94034,7 @@ function transformClassFields(context) {
|
|
|
93848
94034
|
prefix,
|
|
93849
94035
|
suffix
|
|
93850
94036
|
);
|
|
93851
|
-
if (resolver.
|
|
94037
|
+
if (resolver.hasNodeCheckFlag(node, 32768 /* BlockScopedBindingInLoop */)) {
|
|
93852
94038
|
addBlockScopedVariable(identifier);
|
|
93853
94039
|
} else {
|
|
93854
94040
|
hoistVariableDeclaration(identifier);
|
|
@@ -94087,7 +94273,7 @@ function transformClassFields(context) {
|
|
|
94087
94273
|
}
|
|
94088
94274
|
function trySubstituteClassAlias(node) {
|
|
94089
94275
|
if (enabledSubstitutions & 1 /* ClassAliases */) {
|
|
94090
|
-
if (resolver.
|
|
94276
|
+
if (resolver.hasNodeCheckFlag(node, 536870912 /* ConstructorReference */)) {
|
|
94091
94277
|
const declaration = resolver.getReferencedValueDeclaration(node);
|
|
94092
94278
|
if (declaration) {
|
|
94093
94279
|
const classAlias = classAliases[declaration.id];
|
|
@@ -94954,7 +95140,7 @@ function transformLegacyDecorators(context) {
|
|
|
94954
95140
|
}
|
|
94955
95141
|
}
|
|
94956
95142
|
function getClassAliasIfNeeded(node) {
|
|
94957
|
-
if (resolver.
|
|
95143
|
+
if (resolver.hasNodeCheckFlag(node, 262144 /* ContainsConstructorReference */)) {
|
|
94958
95144
|
enableSubstitutionForClassAliases();
|
|
94959
95145
|
const classAlias = factory2.createUniqueName(node.name && !isGeneratedIdentifier(node.name) ? idText(node.name) : "default");
|
|
94960
95146
|
classAliases[getOriginalNodeId(node)] = classAlias;
|
|
@@ -94987,7 +95173,7 @@ function transformLegacyDecorators(context) {
|
|
|
94987
95173
|
}
|
|
94988
95174
|
function trySubstituteClassAlias(node) {
|
|
94989
95175
|
if (classAliases) {
|
|
94990
|
-
if (resolver.
|
|
95176
|
+
if (resolver.hasNodeCheckFlag(node, 536870912 /* ConstructorReference */)) {
|
|
94991
95177
|
const declaration = resolver.getReferencedValueDeclaration(node);
|
|
94992
95178
|
if (declaration) {
|
|
94993
95179
|
const classAlias = classAliases[declaration.id];
|
|
@@ -97296,7 +97482,7 @@ function transformES2017(context) {
|
|
|
97296
97482
|
hasSuperElementAccess = false;
|
|
97297
97483
|
let updated = visitFunctionBody(node.body, visitor, context);
|
|
97298
97484
|
const originalMethod = getOriginalNode(node, isFunctionLikeDeclaration);
|
|
97299
|
-
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.
|
|
97485
|
+
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && (resolver.hasNodeCheckFlag(node, 256 /* MethodWithSuperPropertyAssignmentInAsync */) || resolver.hasNodeCheckFlag(node, 128 /* MethodWithSuperPropertyAccessInAsync */)) && (getFunctionFlags(originalMethod) & 3 /* AsyncGenerator */) !== 3 /* AsyncGenerator */;
|
|
97300
97486
|
if (emitSuperHelpers) {
|
|
97301
97487
|
enableSubstitutionForAsyncMethodsWithSuper();
|
|
97302
97488
|
if (capturedSuperProperties.size) {
|
|
@@ -97307,9 +97493,9 @@ function transformES2017(context) {
|
|
|
97307
97493
|
updated = factory2.updateBlock(updated, statements);
|
|
97308
97494
|
}
|
|
97309
97495
|
if (hasSuperElementAccess) {
|
|
97310
|
-
if (resolver.
|
|
97496
|
+
if (resolver.hasNodeCheckFlag(node, 256 /* MethodWithSuperPropertyAssignmentInAsync */)) {
|
|
97311
97497
|
addEmitHelper(updated, advancedAsyncSuperHelper);
|
|
97312
|
-
} else if (resolver.
|
|
97498
|
+
} else if (resolver.hasNodeCheckFlag(node, 128 /* MethodWithSuperPropertyAccessInAsync */)) {
|
|
97313
97499
|
addEmitHelper(updated, asyncSuperHelper);
|
|
97314
97500
|
}
|
|
97315
97501
|
}
|
|
@@ -97376,7 +97562,7 @@ function transformES2017(context) {
|
|
|
97376
97562
|
const promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : void 0;
|
|
97377
97563
|
const isArrowFunction2 = node.kind === 219 /* ArrowFunction */;
|
|
97378
97564
|
const savedLexicalArgumentsBinding = lexicalArgumentsBinding;
|
|
97379
|
-
const hasLexicalArguments =
|
|
97565
|
+
const hasLexicalArguments = resolver.hasNodeCheckFlag(node, 512 /* CaptureArguments */);
|
|
97380
97566
|
const captureLexicalArguments = hasLexicalArguments && !lexicalArgumentsBinding;
|
|
97381
97567
|
if (captureLexicalArguments) {
|
|
97382
97568
|
lexicalArgumentsBinding = factory2.createUniqueName("arguments");
|
|
@@ -97431,7 +97617,7 @@ function transformES2017(context) {
|
|
|
97431
97617
|
)
|
|
97432
97618
|
)
|
|
97433
97619
|
);
|
|
97434
|
-
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.
|
|
97620
|
+
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && (resolver.hasNodeCheckFlag(node, 256 /* MethodWithSuperPropertyAssignmentInAsync */) || resolver.hasNodeCheckFlag(node, 128 /* MethodWithSuperPropertyAccessInAsync */));
|
|
97435
97621
|
if (emitSuperHelpers) {
|
|
97436
97622
|
enableSubstitutionForAsyncMethodsWithSuper();
|
|
97437
97623
|
if (capturedSuperProperties.size) {
|
|
@@ -97450,9 +97636,9 @@ function transformES2017(context) {
|
|
|
97450
97636
|
);
|
|
97451
97637
|
setTextRange(block, node.body);
|
|
97452
97638
|
if (emitSuperHelpers && hasSuperElementAccess) {
|
|
97453
|
-
if (resolver.
|
|
97639
|
+
if (resolver.hasNodeCheckFlag(node, 256 /* MethodWithSuperPropertyAssignmentInAsync */)) {
|
|
97454
97640
|
addEmitHelper(block, advancedAsyncSuperHelper);
|
|
97455
|
-
} else if (resolver.
|
|
97641
|
+
} else if (resolver.hasNodeCheckFlag(node, 128 /* MethodWithSuperPropertyAccessInAsync */)) {
|
|
97456
97642
|
addEmitHelper(block, asyncSuperHelper);
|
|
97457
97643
|
}
|
|
97458
97644
|
}
|
|
@@ -97511,7 +97697,7 @@ function transformES2017(context) {
|
|
|
97511
97697
|
}
|
|
97512
97698
|
function onEmitNode(hint, node, emitCallback) {
|
|
97513
97699
|
if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && isSuperContainer(node)) {
|
|
97514
|
-
const superContainerFlags = resolver.
|
|
97700
|
+
const superContainerFlags = (resolver.hasNodeCheckFlag(node, 128 /* MethodWithSuperPropertyAccessInAsync */) ? 128 /* MethodWithSuperPropertyAccessInAsync */ : 0) | (resolver.hasNodeCheckFlag(node, 256 /* MethodWithSuperPropertyAssignmentInAsync */) ? 256 /* MethodWithSuperPropertyAssignmentInAsync */ : 0);
|
|
97515
97701
|
if (superContainerFlags !== enclosingSuperContainerFlags) {
|
|
97516
97702
|
const savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags;
|
|
97517
97703
|
enclosingSuperContainerFlags = superContainerFlags;
|
|
@@ -97615,7 +97801,7 @@ function transformES2017(context) {
|
|
|
97615
97801
|
}
|
|
97616
97802
|
}
|
|
97617
97803
|
function createSuperAccessVariableStatement(factory2, resolver, node, names) {
|
|
97618
|
-
const hasBinding =
|
|
97804
|
+
const hasBinding = resolver.hasNodeCheckFlag(node, 256 /* MethodWithSuperPropertyAssignmentInAsync */);
|
|
97619
97805
|
const accessors = [];
|
|
97620
97806
|
names.forEach((_, key) => {
|
|
97621
97807
|
const name = unescapeLeadingUnderscores(key);
|
|
@@ -98710,7 +98896,7 @@ function transformES2018(context) {
|
|
|
98710
98896
|
!!(hierarchyFacts & 1 /* HasLexicalThis */)
|
|
98711
98897
|
)
|
|
98712
98898
|
);
|
|
98713
|
-
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.
|
|
98899
|
+
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && (resolver.hasNodeCheckFlag(node, 256 /* MethodWithSuperPropertyAssignmentInAsync */) || resolver.hasNodeCheckFlag(node, 128 /* MethodWithSuperPropertyAccessInAsync */));
|
|
98714
98900
|
if (emitSuperHelpers) {
|
|
98715
98901
|
enableSubstitutionForAsyncMethodsWithSuper();
|
|
98716
98902
|
const variableStatement = createSuperAccessVariableStatement(factory2, resolver, node, capturedSuperProperties);
|
|
@@ -98720,9 +98906,9 @@ function transformES2018(context) {
|
|
|
98720
98906
|
outerStatements.push(returnStatement);
|
|
98721
98907
|
const block = factory2.updateBlock(node.body, outerStatements);
|
|
98722
98908
|
if (emitSuperHelpers && hasSuperElementAccess) {
|
|
98723
|
-
if (resolver.
|
|
98909
|
+
if (resolver.hasNodeCheckFlag(node, 256 /* MethodWithSuperPropertyAssignmentInAsync */)) {
|
|
98724
98910
|
addEmitHelper(block, advancedAsyncSuperHelper);
|
|
98725
|
-
} else if (resolver.
|
|
98911
|
+
} else if (resolver.hasNodeCheckFlag(node, 128 /* MethodWithSuperPropertyAccessInAsync */)) {
|
|
98726
98912
|
addEmitHelper(block, asyncSuperHelper);
|
|
98727
98913
|
}
|
|
98728
98914
|
}
|
|
@@ -98855,7 +99041,7 @@ function transformES2018(context) {
|
|
|
98855
99041
|
}
|
|
98856
99042
|
function onEmitNode(hint, node, emitCallback) {
|
|
98857
99043
|
if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && isSuperContainer(node)) {
|
|
98858
|
-
const superContainerFlags = resolver.
|
|
99044
|
+
const superContainerFlags = (resolver.hasNodeCheckFlag(node, 128 /* MethodWithSuperPropertyAccessInAsync */) ? 128 /* MethodWithSuperPropertyAccessInAsync */ : 0) | (resolver.hasNodeCheckFlag(node, 256 /* MethodWithSuperPropertyAssignmentInAsync */) ? 256 /* MethodWithSuperPropertyAssignmentInAsync */ : 0);
|
|
98859
99045
|
if (superContainerFlags !== enclosingSuperContainerFlags) {
|
|
98860
99046
|
const savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags;
|
|
98861
99047
|
enclosingSuperContainerFlags = superContainerFlags;
|
|
@@ -102560,9 +102746,8 @@ function transformES2015(context) {
|
|
|
102560
102746
|
return createRange(pos, end);
|
|
102561
102747
|
}
|
|
102562
102748
|
function shouldEmitExplicitInitializerForLetDeclaration(node) {
|
|
102563
|
-
const
|
|
102564
|
-
const
|
|
102565
|
-
const isDeclaredInLoop = flags & 32768 /* BlockScopedBindingInLoop */;
|
|
102749
|
+
const isCapturedInFunction = resolver.hasNodeCheckFlag(node, 16384 /* CapturedBlockScopedBinding */);
|
|
102750
|
+
const isDeclaredInLoop = resolver.hasNodeCheckFlag(node, 32768 /* BlockScopedBindingInLoop */);
|
|
102566
102751
|
const emittedAsTopLevel = (hierarchyFacts & 64 /* TopLevel */) !== 0 || isCapturedInFunction && isDeclaredInLoop && (hierarchyFacts & 512 /* IterationStatementBlock */) !== 0;
|
|
102567
102752
|
const emitExplicitInitializer = !emittedAsTopLevel && (hierarchyFacts & 4096 /* ForInOrForOfStatement */) === 0 && (!resolver.isDeclarationWithCollidingName(node) || isDeclaredInLoop && !isCapturedInFunction && (hierarchyFacts & (2048 /* ForStatement */ | 4096 /* ForInOrForOfStatement */)) === 0);
|
|
102568
102753
|
return emitExplicitInitializer;
|
|
@@ -103013,7 +103198,7 @@ function transformES2015(context) {
|
|
|
103013
103198
|
return factory2.inlineExpressions(expressions);
|
|
103014
103199
|
}
|
|
103015
103200
|
function shouldConvertPartOfIterationStatement(node) {
|
|
103016
|
-
return
|
|
103201
|
+
return resolver.hasNodeCheckFlag(node, 8192 /* ContainsCapturedBlockScopeBinding */);
|
|
103017
103202
|
}
|
|
103018
103203
|
function shouldConvertInitializerOfForStatement(node) {
|
|
103019
103204
|
return isForStatement(node) && !!node.initializer && shouldConvertPartOfIterationStatement(node.initializer);
|
|
@@ -103028,7 +103213,7 @@ function transformES2015(context) {
|
|
|
103028
103213
|
return shouldConvertBodyOfIterationStatement(node) || shouldConvertInitializerOfForStatement(node);
|
|
103029
103214
|
}
|
|
103030
103215
|
function shouldConvertBodyOfIterationStatement(node) {
|
|
103031
|
-
return
|
|
103216
|
+
return resolver.hasNodeCheckFlag(node, 4096 /* LoopWithCapturedBlockScopedBinding */);
|
|
103032
103217
|
}
|
|
103033
103218
|
function hoistVariableDeclarationDeclaredInConvertedLoop(state, node) {
|
|
103034
103219
|
if (!state.hoistedLocalVariables) {
|
|
@@ -103577,11 +103762,11 @@ function transformES2015(context) {
|
|
|
103577
103762
|
void 0,
|
|
103578
103763
|
name
|
|
103579
103764
|
));
|
|
103580
|
-
const
|
|
103581
|
-
if (
|
|
103765
|
+
const needsOutParam = resolver.hasNodeCheckFlag(decl, 65536 /* NeedsLoopOutParameter */);
|
|
103766
|
+
if (needsOutParam || hasCapturedBindingsInForHead) {
|
|
103582
103767
|
const outParamName = factory2.createUniqueName("out_" + idText(name));
|
|
103583
103768
|
let flags = 0 /* None */;
|
|
103584
|
-
if (
|
|
103769
|
+
if (needsOutParam) {
|
|
103585
103770
|
flags |= 1 /* Body */;
|
|
103586
103771
|
}
|
|
103587
103772
|
if (isForStatement(container)) {
|
|
@@ -112610,6 +112795,9 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
112610
112795
|
emitSkipped = true;
|
|
112611
112796
|
return;
|
|
112612
112797
|
}
|
|
112798
|
+
if (compilerOptions.noCheck) {
|
|
112799
|
+
(isSourceFile(sourceFileOrBundle) ? [sourceFileOrBundle] : filter(sourceFileOrBundle.sourceFiles, isSourceFileNotJson)).forEach(markLinkedReferences);
|
|
112800
|
+
}
|
|
112613
112801
|
const transform = transformNodes(
|
|
112614
112802
|
resolver,
|
|
112615
112803
|
host,
|
|
@@ -112744,6 +112932,13 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
112744
112932
|
}
|
|
112745
112933
|
forEachChild(node, collectLinkedAliases);
|
|
112746
112934
|
}
|
|
112935
|
+
function markLinkedReferences(file) {
|
|
112936
|
+
forEachChildRecursively(file, (n) => {
|
|
112937
|
+
if (isImportEqualsDeclaration(n) && !(getSyntacticModifierFlags(n) & 32 /* Export */)) return "skip";
|
|
112938
|
+
if (isImportDeclaration(n)) return "skip";
|
|
112939
|
+
resolver.markLinkedReferences(n);
|
|
112940
|
+
});
|
|
112941
|
+
}
|
|
112747
112942
|
function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, transform, printer, mapOptions) {
|
|
112748
112943
|
const sourceFileOrBundle = transform.transformed[0];
|
|
112749
112944
|
const bundle = sourceFileOrBundle.kind === 308 /* Bundle */ ? sourceFileOrBundle : void 0;
|
|
@@ -112875,10 +113070,11 @@ var notImplementedResolver = {
|
|
|
112875
113070
|
isValueAliasDeclaration: notImplemented,
|
|
112876
113071
|
isReferencedAliasDeclaration: notImplemented,
|
|
112877
113072
|
isTopLevelValueImportEqualsWithEntityName: notImplemented,
|
|
112878
|
-
|
|
113073
|
+
hasNodeCheckFlag: notImplemented,
|
|
112879
113074
|
isDeclarationVisible: notImplemented,
|
|
112880
113075
|
isLateBound: (_node) => false,
|
|
112881
113076
|
collectLinkedAliases: notImplemented,
|
|
113077
|
+
markLinkedReferences: notImplemented,
|
|
112882
113078
|
isImplementationOfOverload: notImplemented,
|
|
112883
113079
|
requiresAddingImplicitUndefined: notImplemented,
|
|
112884
113080
|
isExpandoFunctionDeclaration: notImplemented,
|
|
@@ -120968,9 +121164,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
120968
121164
|
if (options.noEmit) {
|
|
120969
121165
|
createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "noCheck", "noEmit");
|
|
120970
121166
|
}
|
|
120971
|
-
if (!options.emitDeclarationOnly) {
|
|
120972
|
-
createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "noCheck", "emitDeclarationOnly");
|
|
120973
|
-
}
|
|
120974
121167
|
}
|
|
120975
121168
|
if (options.emitDecoratorMetadata && !options.experimentalDecorators) {
|
|
120976
121169
|
createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDecoratorMetadata", "experimentalDecorators");
|