@typescript-deploys/pr-build 5.1.0-pr-53092-8 → 5.1.0-pr-52845-10
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 +272 -232
- package/lib/tsserver.js +342 -294
- package/lib/tsserverlibrary.d.ts +48 -0
- package/lib/tsserverlibrary.js +343 -294
- package/lib/typescript.d.ts +48 -0
- package/lib/typescript.js +343 -293
- package/lib/typingsInstaller.js +127 -3797
- package/package.json +3 -2
- package/lib/README.md +0 -5
package/lib/tsc.js
CHANGED
|
@@ -23,7 +23,7 @@ var __export = (target, all) => {
|
|
|
23
23
|
|
|
24
24
|
// src/compiler/corePublic.ts
|
|
25
25
|
var versionMajorMinor = "5.1";
|
|
26
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
26
|
+
var version = `${versionMajorMinor}.0-insiders.20230308`;
|
|
27
27
|
|
|
28
28
|
// src/compiler/core.ts
|
|
29
29
|
var emptyArray = [];
|
|
@@ -3814,6 +3814,7 @@ function diagnosticCategoryName(d, lowerCase = true) {
|
|
|
3814
3814
|
}
|
|
3815
3815
|
var ModuleResolutionKind = /* @__PURE__ */ ((ModuleResolutionKind2) => {
|
|
3816
3816
|
ModuleResolutionKind2[ModuleResolutionKind2["Classic"] = 1] = "Classic";
|
|
3817
|
+
ModuleResolutionKind2[ModuleResolutionKind2["NodeJs"] = 2] = "NodeJs";
|
|
3817
3818
|
ModuleResolutionKind2[ModuleResolutionKind2["Node10"] = 2] = "Node10";
|
|
3818
3819
|
ModuleResolutionKind2[ModuleResolutionKind2["Node16"] = 3] = "Node16";
|
|
3819
3820
|
ModuleResolutionKind2[ModuleResolutionKind2["NodeNext"] = 99] = "NodeNext";
|
|
@@ -6854,12 +6855,14 @@ var Diagnostics = {
|
|
|
6854
6855
|
Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set: diag(5096, 1 /* Error */, "Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096", "Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set."),
|
|
6855
6856
|
An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled: diag(5097, 1 /* Error */, "An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097", "An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled."),
|
|
6856
6857
|
Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler: diag(5098, 1 /* Error */, "Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098", "Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."),
|
|
6857
|
-
|
|
6858
|
-
|
|
6858
|
+
Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprec_5101", `Option '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '"ignoreDeprecations": "{2}"' to silence this error.`),
|
|
6859
|
+
Option_0_has_been_removed_Please_remove_it_from_your_configuration: diag(5102, 1 /* Error */, "Option_0_has_been_removed_Please_remove_it_from_your_configuration_5102", "Option '{0}' has been removed. Please remove it from your configuration."),
|
|
6859
6860
|
Invalid_value_for_ignoreDeprecations: diag(5103, 1 /* Error */, "Invalid_value_for_ignoreDeprecations_5103", "Invalid value for '--ignoreDeprecations'."),
|
|
6860
6861
|
Option_0_is_redundant_and_cannot_be_specified_with_option_1: diag(5104, 1 /* Error */, "Option_0_is_redundant_and_cannot_be_specified_with_option_1_5104", "Option '{0}' is redundant and cannot be specified with option '{1}'."),
|
|
6861
6862
|
Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System: diag(5105, 1 /* Error */, "Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System_5105", "Option 'verbatimModuleSyntax' cannot be used when 'module' is set to 'UMD', 'AMD', or 'System'."),
|
|
6862
6863
|
Use_0_instead: diag(5106, 3 /* Message */, "Use_0_instead_5106", "Use '{0}' instead."),
|
|
6864
|
+
Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error: diag(5107, 1 /* Error */, "Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDepr_5107", `Option '{0}={1}' is deprecated and will stop functioning in TypeScript {2}. Specify compilerOption '"ignoreDeprecations": "{3}"' to silence this error.`),
|
|
6865
|
+
Option_0_1_has_been_removed_Please_remove_it_from_your_configuration: diag(5108, 1 /* Error */, "Option_0_1_has_been_removed_Please_remove_it_from_your_configuration_5108", "Option '{0}={1}' has been removed. Please remove it from your configuration."),
|
|
6863
6866
|
Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6e3, 3 /* Message */, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."),
|
|
6864
6867
|
Concatenate_and_emit_output_to_single_file: diag(6001, 3 /* Message */, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."),
|
|
6865
6868
|
Generates_corresponding_d_ts_file: diag(6002, 3 /* Message */, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."),
|
|
@@ -8433,8 +8436,8 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
8433
8436
|
var text = textInitial;
|
|
8434
8437
|
var pos;
|
|
8435
8438
|
var end;
|
|
8436
|
-
var
|
|
8437
|
-
var
|
|
8439
|
+
var fullStartPos;
|
|
8440
|
+
var tokenStart;
|
|
8438
8441
|
var token;
|
|
8439
8442
|
var tokenValue;
|
|
8440
8443
|
var tokenFlags;
|
|
@@ -8442,11 +8445,14 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
8442
8445
|
var inJSDocType = 0;
|
|
8443
8446
|
setText(text, start, length2);
|
|
8444
8447
|
var scanner = {
|
|
8445
|
-
|
|
8448
|
+
getTokenFullStart: () => fullStartPos,
|
|
8449
|
+
getStartPos: () => fullStartPos,
|
|
8450
|
+
getTokenEnd: () => pos,
|
|
8446
8451
|
getTextPos: () => pos,
|
|
8447
8452
|
getToken: () => token,
|
|
8448
|
-
|
|
8449
|
-
|
|
8453
|
+
getTokenStart: () => tokenStart,
|
|
8454
|
+
getTokenPos: () => tokenStart,
|
|
8455
|
+
getTokenText: () => text.substring(tokenStart, pos),
|
|
8450
8456
|
getTokenValue: () => tokenValue,
|
|
8451
8457
|
hasUnicodeEscape: () => (tokenFlags & 1024 /* UnicodeEscape */) !== 0,
|
|
8452
8458
|
hasExtendedUnicodeEscape: () => (tokenFlags & 8 /* ExtendedUnicodeEscape */) !== 0,
|
|
@@ -8480,7 +8486,8 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
8480
8486
|
setScriptTarget,
|
|
8481
8487
|
setLanguageVariant,
|
|
8482
8488
|
setOnError,
|
|
8483
|
-
|
|
8489
|
+
resetTokenState,
|
|
8490
|
+
setTextPos: resetTokenState,
|
|
8484
8491
|
setInJSDocType,
|
|
8485
8492
|
tryScan,
|
|
8486
8493
|
lookAhead,
|
|
@@ -8490,7 +8497,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
8490
8497
|
Object.defineProperty(scanner, "__debugShowCurrentPositionInText", {
|
|
8491
8498
|
get: () => {
|
|
8492
8499
|
const text2 = scanner.getText();
|
|
8493
|
-
return text2.slice(0, scanner.
|
|
8500
|
+
return text2.slice(0, scanner.getTokenFullStart()) + "\u2551" + text2.slice(scanner.getTokenFullStart());
|
|
8494
8501
|
}
|
|
8495
8502
|
});
|
|
8496
8503
|
}
|
|
@@ -9013,11 +9020,11 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9013
9020
|
}
|
|
9014
9021
|
}
|
|
9015
9022
|
function scan() {
|
|
9016
|
-
|
|
9023
|
+
fullStartPos = pos;
|
|
9017
9024
|
tokenFlags = 0 /* None */;
|
|
9018
9025
|
let asteriskSeen = false;
|
|
9019
9026
|
while (true) {
|
|
9020
|
-
|
|
9027
|
+
tokenStart = pos;
|
|
9021
9028
|
if (pos >= end) {
|
|
9022
9029
|
return token = 1 /* EndOfFileToken */;
|
|
9023
9030
|
}
|
|
@@ -9176,9 +9183,9 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9176
9183
|
}
|
|
9177
9184
|
commentDirectives = appendIfCommentDirective(
|
|
9178
9185
|
commentDirectives,
|
|
9179
|
-
text.slice(
|
|
9186
|
+
text.slice(tokenStart, pos),
|
|
9180
9187
|
commentDirectiveRegExSingleLine,
|
|
9181
|
-
|
|
9188
|
+
tokenStart
|
|
9182
9189
|
);
|
|
9183
9190
|
if (skipTrivia2) {
|
|
9184
9191
|
continue;
|
|
@@ -9192,7 +9199,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9192
9199
|
tokenFlags |= 2 /* PrecedingJSDocComment */;
|
|
9193
9200
|
}
|
|
9194
9201
|
let commentClosed = false;
|
|
9195
|
-
let lastLineStart =
|
|
9202
|
+
let lastLineStart = tokenStart;
|
|
9196
9203
|
while (pos < end) {
|
|
9197
9204
|
const ch2 = text.charCodeAt(pos);
|
|
9198
9205
|
if (ch2 === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) {
|
|
@@ -9470,7 +9477,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9470
9477
|
}
|
|
9471
9478
|
function reScanInvalidIdentifier() {
|
|
9472
9479
|
Debug.assert(token === 0 /* Unknown */, "'reScanInvalidIdentifier' should only be called when the current token is 'SyntaxKind.Unknown'.");
|
|
9473
|
-
pos =
|
|
9480
|
+
pos = tokenStart = fullStartPos;
|
|
9474
9481
|
tokenFlags = 0;
|
|
9475
9482
|
const ch = codePointAt(text, pos);
|
|
9476
9483
|
const identifierKind = scanIdentifier(ch, 99 /* ESNext */);
|
|
@@ -9486,7 +9493,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9486
9493
|
pos += charSize(ch);
|
|
9487
9494
|
while (pos < end && isIdentifierPart(ch = codePointAt(text, pos), languageVersion2))
|
|
9488
9495
|
pos += charSize(ch);
|
|
9489
|
-
tokenValue = text.substring(
|
|
9496
|
+
tokenValue = text.substring(tokenStart, pos);
|
|
9490
9497
|
if (ch === 92 /* backslash */) {
|
|
9491
9498
|
tokenValue += scanIdentifierParts();
|
|
9492
9499
|
}
|
|
@@ -9517,12 +9524,12 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9517
9524
|
}
|
|
9518
9525
|
function reScanAsteriskEqualsToken() {
|
|
9519
9526
|
Debug.assert(token === 66 /* AsteriskEqualsToken */, "'reScanAsteriskEqualsToken' should only be called on a '*='");
|
|
9520
|
-
pos =
|
|
9527
|
+
pos = tokenStart + 1;
|
|
9521
9528
|
return token = 63 /* EqualsToken */;
|
|
9522
9529
|
}
|
|
9523
9530
|
function reScanSlashToken() {
|
|
9524
9531
|
if (token === 43 /* SlashToken */ || token === 68 /* SlashEqualsToken */) {
|
|
9525
|
-
let p =
|
|
9532
|
+
let p = tokenStart + 1;
|
|
9526
9533
|
let inEscape = false;
|
|
9527
9534
|
let inCharacterClass = false;
|
|
9528
9535
|
while (true) {
|
|
@@ -9555,7 +9562,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9555
9562
|
p++;
|
|
9556
9563
|
}
|
|
9557
9564
|
pos = p;
|
|
9558
|
-
tokenValue = text.substring(
|
|
9565
|
+
tokenValue = text.substring(tokenStart, pos);
|
|
9559
9566
|
token = 13 /* RegularExpressionLiteral */;
|
|
9560
9567
|
}
|
|
9561
9568
|
return token;
|
|
@@ -9588,41 +9595,41 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9588
9595
|
}
|
|
9589
9596
|
function reScanTemplateToken(isTaggedTemplate) {
|
|
9590
9597
|
Debug.assert(token === 19 /* CloseBraceToken */, "'reScanTemplateToken' should only be called on a '}'");
|
|
9591
|
-
pos =
|
|
9598
|
+
pos = tokenStart;
|
|
9592
9599
|
return token = scanTemplateAndSetTokenValue(isTaggedTemplate);
|
|
9593
9600
|
}
|
|
9594
9601
|
function reScanTemplateHeadOrNoSubstitutionTemplate() {
|
|
9595
|
-
pos =
|
|
9602
|
+
pos = tokenStart;
|
|
9596
9603
|
return token = scanTemplateAndSetTokenValue(
|
|
9597
9604
|
/* isTaggedTemplate */
|
|
9598
9605
|
true
|
|
9599
9606
|
);
|
|
9600
9607
|
}
|
|
9601
9608
|
function reScanJsxToken(allowMultilineJsxText = true) {
|
|
9602
|
-
pos =
|
|
9609
|
+
pos = tokenStart = fullStartPos;
|
|
9603
9610
|
return token = scanJsxToken(allowMultilineJsxText);
|
|
9604
9611
|
}
|
|
9605
9612
|
function reScanLessThanToken() {
|
|
9606
9613
|
if (token === 47 /* LessThanLessThanToken */) {
|
|
9607
|
-
pos =
|
|
9614
|
+
pos = tokenStart + 1;
|
|
9608
9615
|
return token = 29 /* LessThanToken */;
|
|
9609
9616
|
}
|
|
9610
9617
|
return token;
|
|
9611
9618
|
}
|
|
9612
9619
|
function reScanHashToken() {
|
|
9613
9620
|
if (token === 80 /* PrivateIdentifier */) {
|
|
9614
|
-
pos =
|
|
9621
|
+
pos = tokenStart + 1;
|
|
9615
9622
|
return token = 62 /* HashToken */;
|
|
9616
9623
|
}
|
|
9617
9624
|
return token;
|
|
9618
9625
|
}
|
|
9619
9626
|
function reScanQuestionToken() {
|
|
9620
9627
|
Debug.assert(token === 60 /* QuestionQuestionToken */, "'reScanQuestionToken' should only be called on a '??'");
|
|
9621
|
-
pos =
|
|
9628
|
+
pos = tokenStart + 1;
|
|
9622
9629
|
return token = 57 /* QuestionToken */;
|
|
9623
9630
|
}
|
|
9624
9631
|
function scanJsxToken(allowMultilineJsxText = true) {
|
|
9625
|
-
|
|
9632
|
+
fullStartPos = tokenStart = pos;
|
|
9626
9633
|
if (pos >= end) {
|
|
9627
9634
|
return token = 1 /* EndOfFileToken */;
|
|
9628
9635
|
}
|
|
@@ -9667,7 +9674,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9667
9674
|
}
|
|
9668
9675
|
pos++;
|
|
9669
9676
|
}
|
|
9670
|
-
tokenValue = text.substring(
|
|
9677
|
+
tokenValue = text.substring(fullStartPos, pos);
|
|
9671
9678
|
return firstNonWhitespace === -1 ? 12 /* JsxTextAllWhiteSpaces */ : 11 /* JsxText */;
|
|
9672
9679
|
}
|
|
9673
9680
|
function scanJsxIdentifier() {
|
|
@@ -9701,7 +9708,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9701
9708
|
return token;
|
|
9702
9709
|
}
|
|
9703
9710
|
function scanJsxAttributeValue() {
|
|
9704
|
-
|
|
9711
|
+
fullStartPos = pos;
|
|
9705
9712
|
switch (text.charCodeAt(pos)) {
|
|
9706
9713
|
case 34 /* doubleQuote */:
|
|
9707
9714
|
case 39 /* singleQuote */:
|
|
@@ -9715,11 +9722,11 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9715
9722
|
}
|
|
9716
9723
|
}
|
|
9717
9724
|
function reScanJsxAttributeValue() {
|
|
9718
|
-
pos =
|
|
9725
|
+
pos = tokenStart = fullStartPos;
|
|
9719
9726
|
return scanJsxAttributeValue();
|
|
9720
9727
|
}
|
|
9721
9728
|
function scanJsDocToken() {
|
|
9722
|
-
|
|
9729
|
+
fullStartPos = tokenStart = pos;
|
|
9723
9730
|
tokenFlags = 0 /* None */;
|
|
9724
9731
|
if (pos >= end) {
|
|
9725
9732
|
return token = 1 /* EndOfFileToken */;
|
|
@@ -9791,7 +9798,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9791
9798
|
let char = ch;
|
|
9792
9799
|
while (pos < end && isIdentifierPart(char = codePointAt(text, pos), languageVersion) || text.charCodeAt(pos) === 45 /* minus */)
|
|
9793
9800
|
pos += charSize(char);
|
|
9794
|
-
tokenValue = text.substring(
|
|
9801
|
+
tokenValue = text.substring(tokenStart, pos);
|
|
9795
9802
|
if (char === 92 /* backslash */) {
|
|
9796
9803
|
tokenValue += scanIdentifierParts();
|
|
9797
9804
|
}
|
|
@@ -9802,16 +9809,16 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9802
9809
|
}
|
|
9803
9810
|
function speculationHelper(callback, isLookahead) {
|
|
9804
9811
|
const savePos = pos;
|
|
9805
|
-
const saveStartPos =
|
|
9806
|
-
const saveTokenPos =
|
|
9812
|
+
const saveStartPos = fullStartPos;
|
|
9813
|
+
const saveTokenPos = tokenStart;
|
|
9807
9814
|
const saveToken = token;
|
|
9808
9815
|
const saveTokenValue = tokenValue;
|
|
9809
9816
|
const saveTokenFlags = tokenFlags;
|
|
9810
9817
|
const result = callback();
|
|
9811
9818
|
if (!result || isLookahead) {
|
|
9812
9819
|
pos = savePos;
|
|
9813
|
-
|
|
9814
|
-
|
|
9820
|
+
fullStartPos = saveStartPos;
|
|
9821
|
+
tokenStart = saveTokenPos;
|
|
9815
9822
|
token = saveToken;
|
|
9816
9823
|
tokenValue = saveTokenValue;
|
|
9817
9824
|
tokenFlags = saveTokenFlags;
|
|
@@ -9821,8 +9828,8 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9821
9828
|
function scanRange(start2, length3, callback) {
|
|
9822
9829
|
const saveEnd = end;
|
|
9823
9830
|
const savePos = pos;
|
|
9824
|
-
const saveStartPos =
|
|
9825
|
-
const saveTokenPos =
|
|
9831
|
+
const saveStartPos = fullStartPos;
|
|
9832
|
+
const saveTokenPos = tokenStart;
|
|
9826
9833
|
const saveToken = token;
|
|
9827
9834
|
const saveTokenValue = tokenValue;
|
|
9828
9835
|
const saveTokenFlags = tokenFlags;
|
|
@@ -9831,8 +9838,8 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9831
9838
|
const result = callback();
|
|
9832
9839
|
end = saveEnd;
|
|
9833
9840
|
pos = savePos;
|
|
9834
|
-
|
|
9835
|
-
|
|
9841
|
+
fullStartPos = saveStartPos;
|
|
9842
|
+
tokenStart = saveTokenPos;
|
|
9836
9843
|
token = saveToken;
|
|
9837
9844
|
tokenValue = saveTokenValue;
|
|
9838
9845
|
tokenFlags = saveTokenFlags;
|
|
@@ -9862,7 +9869,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9862
9869
|
function setText(newText, start2, length3) {
|
|
9863
9870
|
text = newText || "";
|
|
9864
9871
|
end = length3 === void 0 ? text.length : start2 + length3;
|
|
9865
|
-
|
|
9872
|
+
resetTokenState(start2 || 0);
|
|
9866
9873
|
}
|
|
9867
9874
|
function setOnError(errorCallback) {
|
|
9868
9875
|
onError = errorCallback;
|
|
@@ -9873,11 +9880,11 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9873
9880
|
function setLanguageVariant(variant) {
|
|
9874
9881
|
languageVariant = variant;
|
|
9875
9882
|
}
|
|
9876
|
-
function
|
|
9877
|
-
Debug.assert(
|
|
9878
|
-
pos =
|
|
9879
|
-
|
|
9880
|
-
|
|
9883
|
+
function resetTokenState(position) {
|
|
9884
|
+
Debug.assert(position >= 0);
|
|
9885
|
+
pos = position;
|
|
9886
|
+
fullStartPos = position;
|
|
9887
|
+
tokenStart = position;
|
|
9881
9888
|
token = 0 /* Unknown */;
|
|
9882
9889
|
tokenValue = void 0;
|
|
9883
9890
|
tokenFlags = 0 /* None */;
|
|
@@ -12351,8 +12358,8 @@ function getSpanOfTokenAtPosition(sourceFile, pos) {
|
|
|
12351
12358
|
pos
|
|
12352
12359
|
);
|
|
12353
12360
|
scanner.scan();
|
|
12354
|
-
const start = scanner.
|
|
12355
|
-
return createTextSpanFromBounds(start, scanner.
|
|
12361
|
+
const start = scanner.getTokenStart();
|
|
12362
|
+
return createTextSpanFromBounds(start, scanner.getTokenEnd());
|
|
12356
12363
|
}
|
|
12357
12364
|
function scanTokenAtPosition(sourceFile, pos) {
|
|
12358
12365
|
const scanner = createScanner(
|
|
@@ -12382,7 +12389,7 @@ function getErrorSpanForArrowFunction(sourceFile, node) {
|
|
|
12382
12389
|
function getErrorSpanForNode(sourceFile, node) {
|
|
12383
12390
|
let errorNode = node;
|
|
12384
12391
|
switch (node.kind) {
|
|
12385
|
-
case 308 /* SourceFile */:
|
|
12392
|
+
case 308 /* SourceFile */: {
|
|
12386
12393
|
const pos2 = skipTrivia(
|
|
12387
12394
|
sourceFile.text,
|
|
12388
12395
|
0,
|
|
@@ -12393,6 +12400,7 @@ function getErrorSpanForNode(sourceFile, node) {
|
|
|
12393
12400
|
return createTextSpan(0, 0);
|
|
12394
12401
|
}
|
|
12395
12402
|
return getSpanOfTokenAtPosition(sourceFile, pos2);
|
|
12403
|
+
}
|
|
12396
12404
|
case 257 /* VariableDeclaration */:
|
|
12397
12405
|
case 205 /* BindingElement */:
|
|
12398
12406
|
case 260 /* ClassDeclaration */:
|
|
@@ -12415,10 +12423,16 @@ function getErrorSpanForNode(sourceFile, node) {
|
|
|
12415
12423
|
case 216 /* ArrowFunction */:
|
|
12416
12424
|
return getErrorSpanForArrowFunction(sourceFile, node);
|
|
12417
12425
|
case 292 /* CaseClause */:
|
|
12418
|
-
case 293 /* DefaultClause */:
|
|
12426
|
+
case 293 /* DefaultClause */: {
|
|
12419
12427
|
const start = skipTrivia(sourceFile.text, node.pos);
|
|
12420
12428
|
const end = node.statements.length > 0 ? node.statements[0].pos : node.end;
|
|
12421
12429
|
return createTextSpanFromBounds(start, end);
|
|
12430
|
+
}
|
|
12431
|
+
case 250 /* ReturnStatement */:
|
|
12432
|
+
case 226 /* YieldExpression */: {
|
|
12433
|
+
const pos2 = skipTrivia(sourceFile.text, node.pos);
|
|
12434
|
+
return getSpanOfTokenAtPosition(sourceFile, pos2);
|
|
12435
|
+
}
|
|
12422
12436
|
}
|
|
12423
12437
|
if (errorNode === void 0) {
|
|
12424
12438
|
return getSpanOfTokenAtPosition(sourceFile, node.pos);
|
|
@@ -12505,6 +12519,7 @@ function isPartOfTypeNode(node) {
|
|
|
12505
12519
|
case 153 /* SymbolKeyword */:
|
|
12506
12520
|
case 149 /* ObjectKeyword */:
|
|
12507
12521
|
case 155 /* UndefinedKeyword */:
|
|
12522
|
+
case 104 /* NullKeyword */:
|
|
12508
12523
|
case 144 /* NeverKeyword */:
|
|
12509
12524
|
return true;
|
|
12510
12525
|
case 114 /* VoidKeyword */:
|
|
@@ -12757,6 +12772,14 @@ function getContainingFunction(node) {
|
|
|
12757
12772
|
function getContainingClass(node) {
|
|
12758
12773
|
return findAncestor(node.parent, isClassLike);
|
|
12759
12774
|
}
|
|
12775
|
+
function getContainingClassStaticBlock(node) {
|
|
12776
|
+
return findAncestor(node.parent, (n) => {
|
|
12777
|
+
if (isClassLike(n) || isFunctionLike(n)) {
|
|
12778
|
+
return "quit";
|
|
12779
|
+
}
|
|
12780
|
+
return isClassStaticBlockDeclaration(n);
|
|
12781
|
+
});
|
|
12782
|
+
}
|
|
12760
12783
|
function getContainingFunctionOrClassStaticBlock(node) {
|
|
12761
12784
|
return findAncestor(node.parent, isFunctionLikeOrClassStaticBlockDeclaration);
|
|
12762
12785
|
}
|
|
@@ -16851,7 +16874,7 @@ function isValidBigIntString(s, roundTripOnly) {
|
|
|
16851
16874
|
result = scanner.scan();
|
|
16852
16875
|
}
|
|
16853
16876
|
const flags = scanner.getTokenFlags();
|
|
16854
|
-
return success && result === 9 /* BigIntLiteral */ && scanner.
|
|
16877
|
+
return success && result === 9 /* BigIntLiteral */ && scanner.getTokenEnd() === s.length + 1 && !(flags & 512 /* ContainsSeparator */) && (!roundTripOnly || s === pseudoBigIntToString({ negative, base10Value: parsePseudoBigInt(scanner.getTokenValue()) }));
|
|
16855
16878
|
}
|
|
16856
16879
|
function isValidTypeOnlyAliasUseSite(useSite) {
|
|
16857
16880
|
return !!(useSite.flags & 16777216 /* Ambient */) || isPartOfTypeQuery(useSite) || isIdentifierInNonEmittingHeritageClause(useSite) || isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(useSite) || !(isExpressionNode(useSite) || isShorthandPropertyNameUseSite(useSite));
|
|
@@ -26320,13 +26343,13 @@ var Parser;
|
|
|
26320
26343
|
speculationHelper(() => {
|
|
26321
26344
|
const savedContextFlags = contextFlags;
|
|
26322
26345
|
contextFlags |= 32768 /* AwaitContext */;
|
|
26323
|
-
scanner.
|
|
26346
|
+
scanner.resetTokenState(nextStatement.pos);
|
|
26324
26347
|
nextToken();
|
|
26325
26348
|
while (token() !== 1 /* EndOfFileToken */) {
|
|
26326
|
-
const startPos = scanner.
|
|
26349
|
+
const startPos = scanner.getTokenFullStart();
|
|
26327
26350
|
const statement = parseListElement(0 /* SourceElements */, parseStatement);
|
|
26328
26351
|
statements.push(statement);
|
|
26329
|
-
if (startPos === scanner.
|
|
26352
|
+
if (startPos === scanner.getTokenFullStart()) {
|
|
26330
26353
|
nextToken();
|
|
26331
26354
|
}
|
|
26332
26355
|
if (pos >= 0) {
|
|
@@ -26514,7 +26537,7 @@ var Parser;
|
|
|
26514
26537
|
return inContext(32768 /* AwaitContext */);
|
|
26515
26538
|
}
|
|
26516
26539
|
function parseErrorAtCurrentToken(message, arg0) {
|
|
26517
|
-
return parseErrorAt(scanner.
|
|
26540
|
+
return parseErrorAt(scanner.getTokenStart(), scanner.getTokenEnd(), message, arg0);
|
|
26518
26541
|
}
|
|
26519
26542
|
function parseErrorAtPosition(start, length2, message, arg0) {
|
|
26520
26543
|
const lastError = lastOrUndefined(parseDiagnostics);
|
|
@@ -26533,10 +26556,10 @@ var Parser;
|
|
|
26533
26556
|
parseErrorAt(range.pos, range.end, message, arg0);
|
|
26534
26557
|
}
|
|
26535
26558
|
function scanError(message, length2) {
|
|
26536
|
-
parseErrorAtPosition(scanner.
|
|
26559
|
+
parseErrorAtPosition(scanner.getTokenEnd(), length2, message);
|
|
26537
26560
|
}
|
|
26538
26561
|
function getNodePos() {
|
|
26539
|
-
return scanner.
|
|
26562
|
+
return scanner.getTokenFullStart();
|
|
26540
26563
|
}
|
|
26541
26564
|
function hasPrecedingJSDocComment() {
|
|
26542
26565
|
return scanner.hasPrecedingJSDocComment();
|
|
@@ -26553,7 +26576,7 @@ var Parser;
|
|
|
26553
26576
|
}
|
|
26554
26577
|
function nextToken() {
|
|
26555
26578
|
if (isKeyword(currentToken) && (scanner.hasUnicodeEscape() || scanner.hasExtendedUnicodeEscape())) {
|
|
26556
|
-
parseErrorAt(scanner.
|
|
26579
|
+
parseErrorAt(scanner.getTokenStart(), scanner.getTokenEnd(), Diagnostics.Keywords_cannot_contain_escape_characters);
|
|
26557
26580
|
}
|
|
26558
26581
|
return nextTokenWithoutCheck();
|
|
26559
26582
|
}
|
|
@@ -26666,7 +26689,7 @@ var Parser;
|
|
|
26666
26689
|
parseErrorForInvalidName(Diagnostics.Interface_name_cannot_be_0, Diagnostics.Interface_must_be_given_a_name, 18 /* OpenBraceToken */);
|
|
26667
26690
|
return;
|
|
26668
26691
|
case "is":
|
|
26669
|
-
parseErrorAt(pos, scanner.
|
|
26692
|
+
parseErrorAt(pos, scanner.getTokenStart(), Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods);
|
|
26670
26693
|
return;
|
|
26671
26694
|
case "module":
|
|
26672
26695
|
case "namespace":
|
|
@@ -26821,11 +26844,11 @@ var Parser;
|
|
|
26821
26844
|
}
|
|
26822
26845
|
function createNodeArray(elements, pos, end, hasTrailingComma) {
|
|
26823
26846
|
const array = factoryCreateNodeArray(elements, hasTrailingComma);
|
|
26824
|
-
setTextRangePosEnd(array, pos, end != null ? end : scanner.
|
|
26847
|
+
setTextRangePosEnd(array, pos, end != null ? end : scanner.getTokenFullStart());
|
|
26825
26848
|
return array;
|
|
26826
26849
|
}
|
|
26827
26850
|
function finishNode(node, pos, end) {
|
|
26828
|
-
setTextRangePosEnd(node, pos, end != null ? end : scanner.
|
|
26851
|
+
setTextRangePosEnd(node, pos, end != null ? end : scanner.getTokenFullStart());
|
|
26829
26852
|
if (contextFlags) {
|
|
26830
26853
|
node.flags |= contextFlags;
|
|
26831
26854
|
}
|
|
@@ -26837,7 +26860,7 @@ var Parser;
|
|
|
26837
26860
|
}
|
|
26838
26861
|
function createMissingNode(kind, reportAtCurrentPosition, diagnosticMessage, arg0) {
|
|
26839
26862
|
if (reportAtCurrentPosition) {
|
|
26840
|
-
parseErrorAtPosition(scanner.
|
|
26863
|
+
parseErrorAtPosition(scanner.getTokenFullStart(), 0, diagnosticMessage, arg0);
|
|
26841
26864
|
} else if (diagnosticMessage) {
|
|
26842
26865
|
parseErrorAtCurrentToken(diagnosticMessage, arg0);
|
|
26843
26866
|
}
|
|
@@ -27223,7 +27246,7 @@ var Parser;
|
|
|
27223
27246
|
if (!syntaxCursor || !isReusableParsingContext(parsingContext2) || parseErrorBeforeNextFinishedNode) {
|
|
27224
27247
|
return void 0;
|
|
27225
27248
|
}
|
|
27226
|
-
const node = syntaxCursor.currentNode(pos != null ? pos : scanner.
|
|
27249
|
+
const node = syntaxCursor.currentNode(pos != null ? pos : scanner.getTokenFullStart());
|
|
27227
27250
|
if (nodeIsMissing(node) || node.intersectsChange || containsParseError(node)) {
|
|
27228
27251
|
return void 0;
|
|
27229
27252
|
}
|
|
@@ -27240,7 +27263,7 @@ var Parser;
|
|
|
27240
27263
|
return node;
|
|
27241
27264
|
}
|
|
27242
27265
|
function consumeNode(node) {
|
|
27243
|
-
scanner.
|
|
27266
|
+
scanner.resetTokenState(node.end);
|
|
27244
27267
|
nextToken();
|
|
27245
27268
|
return node;
|
|
27246
27269
|
}
|
|
@@ -27454,14 +27477,14 @@ var Parser;
|
|
|
27454
27477
|
/*inErrorRecovery*/
|
|
27455
27478
|
false
|
|
27456
27479
|
)) {
|
|
27457
|
-
const startPos = scanner.
|
|
27480
|
+
const startPos = scanner.getTokenFullStart();
|
|
27458
27481
|
const result = parseListElement(kind, parseElement);
|
|
27459
27482
|
if (!result) {
|
|
27460
27483
|
parsingContext = saveParsingContext;
|
|
27461
27484
|
return void 0;
|
|
27462
27485
|
}
|
|
27463
27486
|
list.push(result);
|
|
27464
|
-
commaStart = scanner.
|
|
27487
|
+
commaStart = scanner.getTokenStart();
|
|
27465
27488
|
if (parseOptional(27 /* CommaToken */)) {
|
|
27466
27489
|
continue;
|
|
27467
27490
|
}
|
|
@@ -27473,7 +27496,7 @@ var Parser;
|
|
|
27473
27496
|
if (considerSemicolonAsDelimiter && token() === 26 /* SemicolonToken */ && !scanner.hasPrecedingLineBreak()) {
|
|
27474
27497
|
nextToken();
|
|
27475
27498
|
}
|
|
27476
|
-
if (startPos === scanner.
|
|
27499
|
+
if (startPos === scanner.getTokenFullStart()) {
|
|
27477
27500
|
nextToken();
|
|
27478
27501
|
}
|
|
27479
27502
|
continue;
|
|
@@ -28302,7 +28325,7 @@ var Parser;
|
|
|
28302
28325
|
}
|
|
28303
28326
|
function parseImportTypeAssertions() {
|
|
28304
28327
|
const pos = getNodePos();
|
|
28305
|
-
const openBracePosition = scanner.
|
|
28328
|
+
const openBracePosition = scanner.getTokenStart();
|
|
28306
28329
|
parseExpected(18 /* OpenBraceToken */);
|
|
28307
28330
|
const multiLine = scanner.hasPrecedingLineBreak();
|
|
28308
28331
|
parseExpected(130 /* AssertKeyword */);
|
|
@@ -28976,7 +28999,7 @@ var Parser;
|
|
|
28976
28999
|
}
|
|
28977
29000
|
}
|
|
28978
29001
|
function parsePossibleParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) {
|
|
28979
|
-
const tokenPos = scanner.
|
|
29002
|
+
const tokenPos = scanner.getTokenStart();
|
|
28980
29003
|
if (notParenthesizedArrow == null ? void 0 : notParenthesizedArrow.has(tokenPos)) {
|
|
28981
29004
|
return void 0;
|
|
28982
29005
|
}
|
|
@@ -29875,7 +29898,7 @@ var Parser;
|
|
|
29875
29898
|
}
|
|
29876
29899
|
function parseArrayLiteralExpression() {
|
|
29877
29900
|
const pos = getNodePos();
|
|
29878
|
-
const openBracketPosition = scanner.
|
|
29901
|
+
const openBracketPosition = scanner.getTokenStart();
|
|
29879
29902
|
const openBracketParsed = parseExpected(22 /* OpenBracketToken */);
|
|
29880
29903
|
const multiLine = scanner.hasPrecedingLineBreak();
|
|
29881
29904
|
const elements = parseDelimitedList(15 /* ArrayLiteralMembers */, parseArgumentOrArrayLiteralElement);
|
|
@@ -29935,7 +29958,7 @@ var Parser;
|
|
|
29935
29958
|
}
|
|
29936
29959
|
function parseObjectLiteralExpression() {
|
|
29937
29960
|
const pos = getNodePos();
|
|
29938
|
-
const openBracePosition = scanner.
|
|
29961
|
+
const openBracePosition = scanner.getTokenStart();
|
|
29939
29962
|
const openBraceParsed = parseExpected(18 /* OpenBraceToken */);
|
|
29940
29963
|
const multiLine = scanner.hasPrecedingLineBreak();
|
|
29941
29964
|
const properties = parseDelimitedList(
|
|
@@ -30007,7 +30030,7 @@ var Parser;
|
|
|
30007
30030
|
function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) {
|
|
30008
30031
|
const pos = getNodePos();
|
|
30009
30032
|
const hasJSDoc = hasPrecedingJSDocComment();
|
|
30010
|
-
const openBracePosition = scanner.
|
|
30033
|
+
const openBracePosition = scanner.getTokenStart();
|
|
30011
30034
|
const openBraceParsed = parseExpected(18 /* OpenBraceToken */, diagnosticMessage);
|
|
30012
30035
|
if (openBraceParsed || ignoreMissingOpenBrace) {
|
|
30013
30036
|
const multiLine = scanner.hasPrecedingLineBreak();
|
|
@@ -30064,7 +30087,7 @@ var Parser;
|
|
|
30064
30087
|
const pos = getNodePos();
|
|
30065
30088
|
const hasJSDoc = hasPrecedingJSDocComment();
|
|
30066
30089
|
parseExpected(99 /* IfKeyword */);
|
|
30067
|
-
const openParenPosition = scanner.
|
|
30090
|
+
const openParenPosition = scanner.getTokenStart();
|
|
30068
30091
|
const openParenParsed = parseExpected(20 /* OpenParenToken */);
|
|
30069
30092
|
const expression = allowInAnd(parseExpression);
|
|
30070
30093
|
parseExpectedMatchingBrackets(20 /* OpenParenToken */, 21 /* CloseParenToken */, openParenParsed, openParenPosition);
|
|
@@ -30078,7 +30101,7 @@ var Parser;
|
|
|
30078
30101
|
parseExpected(90 /* DoKeyword */);
|
|
30079
30102
|
const statement = parseStatement();
|
|
30080
30103
|
parseExpected(115 /* WhileKeyword */);
|
|
30081
|
-
const openParenPosition = scanner.
|
|
30104
|
+
const openParenPosition = scanner.getTokenStart();
|
|
30082
30105
|
const openParenParsed = parseExpected(20 /* OpenParenToken */);
|
|
30083
30106
|
const expression = allowInAnd(parseExpression);
|
|
30084
30107
|
parseExpectedMatchingBrackets(20 /* OpenParenToken */, 21 /* CloseParenToken */, openParenParsed, openParenPosition);
|
|
@@ -30089,7 +30112,7 @@ var Parser;
|
|
|
30089
30112
|
const pos = getNodePos();
|
|
30090
30113
|
const hasJSDoc = hasPrecedingJSDocComment();
|
|
30091
30114
|
parseExpected(115 /* WhileKeyword */);
|
|
30092
|
-
const openParenPosition = scanner.
|
|
30115
|
+
const openParenPosition = scanner.getTokenStart();
|
|
30093
30116
|
const openParenParsed = parseExpected(20 /* OpenParenToken */);
|
|
30094
30117
|
const expression = allowInAnd(parseExpression);
|
|
30095
30118
|
parseExpectedMatchingBrackets(20 /* OpenParenToken */, 21 /* CloseParenToken */, openParenParsed, openParenPosition);
|
|
@@ -30156,7 +30179,7 @@ var Parser;
|
|
|
30156
30179
|
const pos = getNodePos();
|
|
30157
30180
|
const hasJSDoc = hasPrecedingJSDocComment();
|
|
30158
30181
|
parseExpected(116 /* WithKeyword */);
|
|
30159
|
-
const openParenPosition = scanner.
|
|
30182
|
+
const openParenPosition = scanner.getTokenStart();
|
|
30160
30183
|
const openParenParsed = parseExpected(20 /* OpenParenToken */);
|
|
30161
30184
|
const expression = allowInAnd(parseExpression);
|
|
30162
30185
|
parseExpectedMatchingBrackets(20 /* OpenParenToken */, 21 /* CloseParenToken */, openParenParsed, openParenPosition);
|
|
@@ -31252,7 +31275,7 @@ var Parser;
|
|
|
31252
31275
|
}
|
|
31253
31276
|
function parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, modifiers) {
|
|
31254
31277
|
parseExpected(100 /* ImportKeyword */);
|
|
31255
|
-
const afterImportPos = scanner.
|
|
31278
|
+
const afterImportPos = scanner.getTokenFullStart();
|
|
31256
31279
|
let identifier;
|
|
31257
31280
|
if (isIdentifier2()) {
|
|
31258
31281
|
identifier = parseIdentifier();
|
|
@@ -31296,7 +31319,7 @@ var Parser;
|
|
|
31296
31319
|
if (!skipAssertKeyword) {
|
|
31297
31320
|
parseExpected(130 /* AssertKeyword */);
|
|
31298
31321
|
}
|
|
31299
|
-
const openBracePosition = scanner.
|
|
31322
|
+
const openBracePosition = scanner.getTokenStart();
|
|
31300
31323
|
if (parseExpected(18 /* OpenBraceToken */)) {
|
|
31301
31324
|
const multiLine = scanner.hasPrecedingLineBreak();
|
|
31302
31325
|
const elements = parseDelimitedList(
|
|
@@ -31397,8 +31420,8 @@ var Parser;
|
|
|
31397
31420
|
function parseImportOrExportSpecifier(kind) {
|
|
31398
31421
|
const pos = getNodePos();
|
|
31399
31422
|
let checkIdentifierIsKeyword = isKeyword(token()) && !isIdentifier2();
|
|
31400
|
-
let checkIdentifierStart = scanner.
|
|
31401
|
-
let checkIdentifierEnd = scanner.
|
|
31423
|
+
let checkIdentifierStart = scanner.getTokenStart();
|
|
31424
|
+
let checkIdentifierEnd = scanner.getTokenEnd();
|
|
31402
31425
|
let isTypeOnly = false;
|
|
31403
31426
|
let propertyName;
|
|
31404
31427
|
let canParseAsKeyword = true;
|
|
@@ -31443,8 +31466,8 @@ var Parser;
|
|
|
31443
31466
|
return finishNode(node, pos);
|
|
31444
31467
|
function parseNameWithKeywordCheck() {
|
|
31445
31468
|
checkIdentifierIsKeyword = isKeyword(token()) && !isIdentifier2();
|
|
31446
|
-
checkIdentifierStart = scanner.
|
|
31447
|
-
checkIdentifierEnd = scanner.
|
|
31469
|
+
checkIdentifierStart = scanner.getTokenStart();
|
|
31470
|
+
checkIdentifierEnd = scanner.getTokenEnd();
|
|
31448
31471
|
return parseIdentifierName();
|
|
31449
31472
|
}
|
|
31450
31473
|
}
|
|
@@ -31730,8 +31753,8 @@ var Parser;
|
|
|
31730
31753
|
break loop;
|
|
31731
31754
|
case 18 /* OpenBraceToken */:
|
|
31732
31755
|
state = 2 /* SavingComments */;
|
|
31733
|
-
const commentEnd = scanner.
|
|
31734
|
-
const linkStart = scanner.
|
|
31756
|
+
const commentEnd = scanner.getTokenFullStart();
|
|
31757
|
+
const linkStart = scanner.getTokenEnd() - 1;
|
|
31735
31758
|
const link = parseJSDocLink(linkStart);
|
|
31736
31759
|
if (link) {
|
|
31737
31760
|
if (!linkEnd) {
|
|
@@ -31740,7 +31763,7 @@ var Parser;
|
|
|
31740
31763
|
parts.push(finishNode(factory2.createJSDocText(comments.join("")), linkEnd != null ? linkEnd : start, commentEnd));
|
|
31741
31764
|
parts.push(link);
|
|
31742
31765
|
comments = [];
|
|
31743
|
-
linkEnd = scanner.
|
|
31766
|
+
linkEnd = scanner.getTokenEnd();
|
|
31744
31767
|
break;
|
|
31745
31768
|
}
|
|
31746
31769
|
default:
|
|
@@ -31814,7 +31837,7 @@ var Parser;
|
|
|
31814
31837
|
}
|
|
31815
31838
|
function parseTag(margin) {
|
|
31816
31839
|
Debug.assert(token() === 59 /* AtToken */);
|
|
31817
|
-
const start2 = scanner.
|
|
31840
|
+
const start2 = scanner.getTokenStart();
|
|
31818
31841
|
nextTokenJSDoc();
|
|
31819
31842
|
const tagName = parseJSDocIdentifierName(
|
|
31820
31843
|
/*message*/
|
|
@@ -31942,7 +31965,7 @@ var Parser;
|
|
|
31942
31965
|
comments2.push(scanner.getTokenText());
|
|
31943
31966
|
break;
|
|
31944
31967
|
}
|
|
31945
|
-
scanner.
|
|
31968
|
+
scanner.resetTokenState(scanner.getTokenEnd() - 1);
|
|
31946
31969
|
case 1 /* EndOfFileToken */:
|
|
31947
31970
|
break loop;
|
|
31948
31971
|
case 5 /* WhitespaceTrivia */:
|
|
@@ -31958,14 +31981,14 @@ var Parser;
|
|
|
31958
31981
|
break;
|
|
31959
31982
|
case 18 /* OpenBraceToken */:
|
|
31960
31983
|
state = 2 /* SavingComments */;
|
|
31961
|
-
const commentEnd = scanner.
|
|
31962
|
-
const linkStart = scanner.
|
|
31984
|
+
const commentEnd = scanner.getTokenFullStart();
|
|
31985
|
+
const linkStart = scanner.getTokenEnd() - 1;
|
|
31963
31986
|
const link = parseJSDocLink(linkStart);
|
|
31964
31987
|
if (link) {
|
|
31965
31988
|
parts2.push(finishNode(factory2.createJSDocText(comments2.join("")), linkEnd2 != null ? linkEnd2 : commentsPos2, commentEnd));
|
|
31966
31989
|
parts2.push(link);
|
|
31967
31990
|
comments2 = [];
|
|
31968
|
-
linkEnd2 = scanner.
|
|
31991
|
+
linkEnd2 = scanner.getTokenEnd();
|
|
31969
31992
|
} else {
|
|
31970
31993
|
pushComment(scanner.getTokenText());
|
|
31971
31994
|
}
|
|
@@ -32000,7 +32023,7 @@ var Parser;
|
|
|
32000
32023
|
if (comments2.length) {
|
|
32001
32024
|
parts2.push(finishNode(factory2.createJSDocText(comments2.join("")), linkEnd2 != null ? linkEnd2 : commentsPos2));
|
|
32002
32025
|
}
|
|
32003
|
-
return createNodeArray(parts2, commentsPos2, scanner.
|
|
32026
|
+
return createNodeArray(parts2, commentsPos2, scanner.getTokenEnd());
|
|
32004
32027
|
} else if (comments2.length) {
|
|
32005
32028
|
return comments2.join("");
|
|
32006
32029
|
}
|
|
@@ -32034,7 +32057,7 @@ var Parser;
|
|
|
32034
32057
|
nextTokenJSDoc();
|
|
32035
32058
|
}
|
|
32036
32059
|
const create = linkType === "link" ? factory2.createJSDocLink : linkType === "linkcode" ? factory2.createJSDocLinkCode : factory2.createJSDocLinkPlain;
|
|
32037
|
-
return finishNode(create(name, text.join("")), start2, scanner.
|
|
32060
|
+
return finishNode(create(name, text.join("")), start2, scanner.getTokenEnd());
|
|
32038
32061
|
}
|
|
32039
32062
|
function parseJSDocLinkPrefix() {
|
|
32040
32063
|
skipWhitespaceOrAsterisk();
|
|
@@ -32131,14 +32154,14 @@ var Parser;
|
|
|
32131
32154
|
}
|
|
32132
32155
|
function parseReturnTag(start2, tagName, indent2, indentText) {
|
|
32133
32156
|
if (some(tags, isJSDocReturnTag)) {
|
|
32134
|
-
parseErrorAt(tagName.pos, scanner.
|
|
32157
|
+
parseErrorAt(tagName.pos, scanner.getTokenStart(), Diagnostics._0_tag_already_specified, tagName.escapedText);
|
|
32135
32158
|
}
|
|
32136
32159
|
const typeExpression = tryParseTypeExpression();
|
|
32137
32160
|
return finishNode(factory2.createJSDocReturnTag(tagName, typeExpression, parseTrailingTagComments(start2, getNodePos(), indent2, indentText)), start2);
|
|
32138
32161
|
}
|
|
32139
32162
|
function parseTypeTag(start2, tagName, indent2, indentText) {
|
|
32140
32163
|
if (some(tags, isJSDocTypeTag)) {
|
|
32141
|
-
parseErrorAt(tagName.pos, scanner.
|
|
32164
|
+
parseErrorAt(tagName.pos, scanner.getTokenStart(), Diagnostics._0_tag_already_specified, tagName.escapedText);
|
|
32142
32165
|
}
|
|
32143
32166
|
const typeExpression = parseJSDocTypeExpression(
|
|
32144
32167
|
/*mayOmitBraces*/
|
|
@@ -32161,10 +32184,10 @@ var Parser;
|
|
|
32161
32184
|
function parseAuthorTag(start2, tagName, indent2, indentText) {
|
|
32162
32185
|
const commentStart = getNodePos();
|
|
32163
32186
|
const textOnly = parseAuthorNameAndEmail();
|
|
32164
|
-
let commentEnd = scanner.
|
|
32187
|
+
let commentEnd = scanner.getTokenFullStart();
|
|
32165
32188
|
const comments2 = parseTrailingTagComments(start2, commentEnd, indent2, indentText);
|
|
32166
32189
|
if (!comments2) {
|
|
32167
|
-
commentEnd = scanner.
|
|
32190
|
+
commentEnd = scanner.getTokenFullStart();
|
|
32168
32191
|
}
|
|
32169
32192
|
const allParts = typeof comments2 !== "string" ? createNodeArray(concatenate([finishNode(textOnly, commentStart, commentEnd)], comments2), commentStart) : textOnly.text + comments2;
|
|
32170
32193
|
return finishNode(factory2.createJSDocAuthorTag(tagName, allParts), start2);
|
|
@@ -32180,7 +32203,7 @@ var Parser;
|
|
|
32180
32203
|
break;
|
|
32181
32204
|
} else if (token2 === 31 /* GreaterThanToken */ && inEmail) {
|
|
32182
32205
|
comments2.push(scanner.getTokenText());
|
|
32183
|
-
scanner.
|
|
32206
|
+
scanner.resetTokenState(scanner.getTokenEnd());
|
|
32184
32207
|
break;
|
|
32185
32208
|
}
|
|
32186
32209
|
comments2.push(scanner.getTokenText());
|
|
@@ -32288,7 +32311,7 @@ var Parser;
|
|
|
32288
32311
|
return finishNode(typedefTag, start2, end2);
|
|
32289
32312
|
}
|
|
32290
32313
|
function parseJSDocTypeNameWithNamespace(nested) {
|
|
32291
|
-
const
|
|
32314
|
+
const start2 = scanner.getTokenStart();
|
|
32292
32315
|
if (!tokenIsIdentifierOrKeyword(token())) {
|
|
32293
32316
|
return void 0;
|
|
32294
32317
|
}
|
|
@@ -32305,7 +32328,7 @@ var Parser;
|
|
|
32305
32328
|
body,
|
|
32306
32329
|
nested ? 4 /* NestedNamespace */ : void 0
|
|
32307
32330
|
);
|
|
32308
|
-
return finishNode(jsDocNamespaceNode,
|
|
32331
|
+
return finishNode(jsDocNamespaceNode, start2);
|
|
32309
32332
|
}
|
|
32310
32333
|
if (nested) {
|
|
32311
32334
|
typeNameOrNamespaceName.flags |= 2048 /* IdentifierIsInJSDocNamespace */;
|
|
@@ -32408,7 +32431,7 @@ var Parser;
|
|
|
32408
32431
|
}
|
|
32409
32432
|
function tryParseChildTag(target, indent2) {
|
|
32410
32433
|
Debug.assert(token() === 59 /* AtToken */);
|
|
32411
|
-
const start2 = scanner.
|
|
32434
|
+
const start2 = scanner.getTokenFullStart();
|
|
32412
32435
|
nextTokenJSDoc();
|
|
32413
32436
|
const tagName = parseJSDocIdentifierName();
|
|
32414
32437
|
skipWhitespace();
|
|
@@ -32508,11 +32531,11 @@ var Parser;
|
|
|
32508
32531
|
);
|
|
32509
32532
|
}
|
|
32510
32533
|
identifierCount++;
|
|
32511
|
-
const
|
|
32512
|
-
const end2 = scanner.
|
|
32534
|
+
const start2 = scanner.getTokenStart();
|
|
32535
|
+
const end2 = scanner.getTokenEnd();
|
|
32513
32536
|
const originalKeywordKind = token();
|
|
32514
32537
|
const text = internIdentifier(scanner.getTokenValue());
|
|
32515
|
-
const result = finishNode(factoryCreateIdentifier(text, originalKeywordKind),
|
|
32538
|
+
const result = finishNode(factoryCreateIdentifier(text, originalKeywordKind), start2, end2);
|
|
32516
32539
|
nextTokenJSDoc();
|
|
32517
32540
|
return result;
|
|
32518
32541
|
}
|
|
@@ -38833,7 +38856,7 @@ function initFlowNode(node) {
|
|
|
38833
38856
|
Debug.attachFlowNodeDebugInfo(node);
|
|
38834
38857
|
return node;
|
|
38835
38858
|
}
|
|
38836
|
-
var binder = createBinder();
|
|
38859
|
+
var binder = /* @__PURE__ */ createBinder();
|
|
38837
38860
|
function bindSourceFile(file, options) {
|
|
38838
38861
|
mark("beforeBind");
|
|
38839
38862
|
perfLogger.logStartBindFile("" + file.fileName);
|
|
@@ -42902,7 +42925,10 @@ function createTypeChecker(host) {
|
|
|
42902
42925
|
createIndexInfo,
|
|
42903
42926
|
getAnyType: () => anyType,
|
|
42904
42927
|
getStringType: () => stringType,
|
|
42928
|
+
getStringLiteralType,
|
|
42905
42929
|
getNumberType: () => numberType,
|
|
42930
|
+
getNumberLiteralType,
|
|
42931
|
+
getBigIntType: () => bigintType,
|
|
42906
42932
|
createPromiseType,
|
|
42907
42933
|
createArrayType,
|
|
42908
42934
|
getElementTypeOfArrayType,
|
|
@@ -52309,9 +52335,14 @@ function createTypeChecker(host) {
|
|
|
52309
52335
|
return result;
|
|
52310
52336
|
}
|
|
52311
52337
|
function addInheritedMembers(symbols, baseSymbols) {
|
|
52312
|
-
for (const
|
|
52313
|
-
if (
|
|
52314
|
-
|
|
52338
|
+
for (const base of baseSymbols) {
|
|
52339
|
+
if (isStaticPrivateIdentifierProperty(base)) {
|
|
52340
|
+
continue;
|
|
52341
|
+
}
|
|
52342
|
+
const derived = symbols.get(base.escapedName);
|
|
52343
|
+
if (!derived || derived.valueDeclaration && isBinaryExpression(derived.valueDeclaration) && !isConstructorDeclaredProperty(derived) && !getContainingClassStaticBlock(derived.valueDeclaration)) {
|
|
52344
|
+
symbols.set(base.escapedName, base);
|
|
52345
|
+
symbols.set(base.escapedName, base);
|
|
52315
52346
|
}
|
|
52316
52347
|
}
|
|
52317
52348
|
}
|
|
@@ -56234,12 +56265,15 @@ function createTypeChecker(host) {
|
|
|
56234
56265
|
function getConstituentCountOfTypes(types) {
|
|
56235
56266
|
return reduceLeft(types, (n, t) => n + getConstituentCount(t), 0);
|
|
56236
56267
|
}
|
|
56268
|
+
function areIntersectedTypesAvoidingPrimitiveReduction(t1, t2) {
|
|
56269
|
+
return !!(t1.flags & (4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) && t2 === emptyTypeLiteralType;
|
|
56270
|
+
}
|
|
56237
56271
|
function getTypeFromIntersectionTypeNode(node) {
|
|
56238
56272
|
const links = getNodeLinks(node);
|
|
56239
56273
|
if (!links.resolvedType) {
|
|
56240
56274
|
const aliasSymbol = getAliasSymbolForTypeNode(node);
|
|
56241
56275
|
const types = map(node.types, getTypeFromTypeNode);
|
|
56242
|
-
const noSupertypeReduction = types.length === 2 &&
|
|
56276
|
+
const noSupertypeReduction = types.length === 2 && (areIntersectedTypesAvoidingPrimitiveReduction(types[0], types[1]) || areIntersectedTypesAvoidingPrimitiveReduction(types[1], types[0]));
|
|
56243
56277
|
links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction);
|
|
56244
56278
|
}
|
|
56245
56279
|
return links.resolvedType;
|
|
@@ -59612,8 +59646,8 @@ function createTypeChecker(host) {
|
|
|
59612
59646
|
if (prop.valueDeclaration && findAncestor(prop.valueDeclaration, (d) => d === objectLiteralDeclaration) && getSourceFileOfNode(objectLiteralDeclaration) === getSourceFileOfNode(errorNode)) {
|
|
59613
59647
|
const propDeclaration = prop.valueDeclaration;
|
|
59614
59648
|
Debug.assertNode(propDeclaration, isObjectLiteralElementLike);
|
|
59615
|
-
errorNode = propDeclaration;
|
|
59616
59649
|
const name = propDeclaration.name;
|
|
59650
|
+
errorNode = name;
|
|
59617
59651
|
if (isIdentifier(name)) {
|
|
59618
59652
|
suggestion = getSuggestionForNonexistentProperty(name, errorTarget);
|
|
59619
59653
|
}
|
|
@@ -67199,13 +67233,14 @@ function createTypeChecker(host) {
|
|
|
67199
67233
|
const elementFlags = [];
|
|
67200
67234
|
pushCachedContextualType(node);
|
|
67201
67235
|
const inDestructuringPattern = isAssignmentTarget(node);
|
|
67202
|
-
const
|
|
67236
|
+
const isSpreadIntoCallOrNew = isSpreadElement(node.parent) && isCallOrNewExpression(node.parent.parent);
|
|
67237
|
+
const inConstContext = isSpreadIntoCallOrNew || isConstContext(node);
|
|
67203
67238
|
const contextualType = getApparentTypeOfContextualType(
|
|
67204
67239
|
node,
|
|
67205
67240
|
/*contextFlags*/
|
|
67206
67241
|
void 0
|
|
67207
67242
|
);
|
|
67208
|
-
const inTupleContext = !!contextualType && someType(contextualType, isTupleLikeType);
|
|
67243
|
+
const inTupleContext = isSpreadIntoCallOrNew || !!contextualType && someType(contextualType, isTupleLikeType);
|
|
67209
67244
|
let hasOmittedExpression = false;
|
|
67210
67245
|
for (let i = 0; i < elementCount; i++) {
|
|
67211
67246
|
const e = elements[i];
|
|
@@ -72028,7 +72063,7 @@ function createTypeChecker(host) {
|
|
|
72028
72063
|
function checkAllCodePathsInNonVoidFunctionReturnOrThrowDiagnostics() {
|
|
72029
72064
|
const functionFlags = getFunctionFlags(func);
|
|
72030
72065
|
const type = returnType && unwrapReturnType(returnType, functionFlags);
|
|
72031
|
-
if (type && maybeTypeOfKind(type,
|
|
72066
|
+
if (type && maybeTypeOfKind(type, 1 /* Any */ | 16384 /* Void */)) {
|
|
72032
72067
|
return;
|
|
72033
72068
|
}
|
|
72034
72069
|
if (func.kind === 170 /* MethodSignature */ || nodeIsMissing(func.body) || func.body.kind !== 238 /* Block */ || !functionHasImplicitReturn(func)) {
|
|
@@ -74376,7 +74411,7 @@ function createTypeChecker(host) {
|
|
|
74376
74411
|
return !!forEachChild(node, nodeImmediatelyReferencesSuperOrThis);
|
|
74377
74412
|
}
|
|
74378
74413
|
function checkAccessorDeclaration(node) {
|
|
74379
|
-
if (isIdentifier(node.name) && idText(node.name) === "constructor") {
|
|
74414
|
+
if (isIdentifier(node.name) && idText(node.name) === "constructor" && isClassLike(node.parent)) {
|
|
74380
74415
|
error(node.name, Diagnostics.Class_constructor_may_not_be_an_accessor);
|
|
74381
74416
|
}
|
|
74382
74417
|
addLazyDiagnostic(checkAccessorDeclarationDiagnostics);
|
|
@@ -112947,6 +112982,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
112947
112982
|
const createProgramOptions = isArray(rootNamesOrOptions) ? createCreateProgramOptions(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : rootNamesOrOptions;
|
|
112948
112983
|
const { rootNames, options, configFileParsingDiagnostics, projectReferences, typeScriptVersion: typeScriptVersion2 } = createProgramOptions;
|
|
112949
112984
|
let { oldProgram } = createProgramOptions;
|
|
112985
|
+
const reportInvalidIgnoreDeprecations = memoize(() => createOptionValueDiagnostic("ignoreDeprecations", Diagnostics.Invalid_value_for_ignoreDeprecations));
|
|
112950
112986
|
let processingDefaultLibFiles;
|
|
112951
112987
|
let processingOtherFiles;
|
|
112952
112988
|
let files;
|
|
@@ -115373,127 +115409,131 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
115373
115409
|
}
|
|
115374
115410
|
}
|
|
115375
115411
|
}
|
|
115376
|
-
function
|
|
115377
|
-
const version2 = typeScriptVersion2 || versionMajorMinor;
|
|
115412
|
+
function getIgnoreDeprecationsVersion() {
|
|
115378
115413
|
const ignoreDeprecations = options.ignoreDeprecations;
|
|
115379
115414
|
if (ignoreDeprecations) {
|
|
115380
|
-
if (ignoreDeprecations === "5.0"
|
|
115381
|
-
return;
|
|
115382
|
-
}
|
|
115383
|
-
|
|
115384
|
-
|
|
115415
|
+
if (ignoreDeprecations === "5.0") {
|
|
115416
|
+
return new Version(ignoreDeprecations);
|
|
115417
|
+
}
|
|
115418
|
+
reportInvalidIgnoreDeprecations();
|
|
115419
|
+
}
|
|
115420
|
+
return Version.zero;
|
|
115421
|
+
}
|
|
115422
|
+
function checkDeprecations(deprecatedIn, removedIn, createDiagnostic, fn) {
|
|
115423
|
+
const deprecatedInVersion = new Version(deprecatedIn);
|
|
115424
|
+
const removedInVersion = new Version(removedIn);
|
|
115425
|
+
const typescriptVersion = new Version(typeScriptVersion2 || versionMajorMinor);
|
|
115426
|
+
const ignoreDeprecationsVersion = getIgnoreDeprecationsVersion();
|
|
115427
|
+
const mustBeRemoved = !(removedInVersion.compareTo(typescriptVersion) === 1 /* GreaterThan */);
|
|
115428
|
+
const canBeSilenced = !mustBeRemoved && ignoreDeprecationsVersion.compareTo(deprecatedInVersion) === -1 /* LessThan */;
|
|
115429
|
+
if (mustBeRemoved || canBeSilenced) {
|
|
115430
|
+
fn((name, value, useInstead) => {
|
|
115431
|
+
if (mustBeRemoved) {
|
|
115432
|
+
if (value === void 0) {
|
|
115433
|
+
createDiagnostic(name, value, useInstead, Diagnostics.Option_0_has_been_removed_Please_remove_it_from_your_configuration, name);
|
|
115434
|
+
} else {
|
|
115435
|
+
createDiagnostic(name, value, useInstead, Diagnostics.Option_0_1_has_been_removed_Please_remove_it_from_your_configuration, name, value);
|
|
115436
|
+
}
|
|
115437
|
+
} else {
|
|
115438
|
+
if (value === void 0) {
|
|
115439
|
+
createDiagnostic(name, value, useInstead, Diagnostics.Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error, name, removedIn, deprecatedIn);
|
|
115440
|
+
} else {
|
|
115441
|
+
createDiagnostic(name, value, useInstead, Diagnostics.Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error, name, value, removedIn, deprecatedIn);
|
|
115442
|
+
}
|
|
115443
|
+
}
|
|
115444
|
+
});
|
|
115385
115445
|
}
|
|
115386
|
-
return version2;
|
|
115387
115446
|
}
|
|
115388
115447
|
function verifyDeprecatedCompilerOptions() {
|
|
115389
|
-
|
|
115390
|
-
|
|
115391
|
-
|
|
115392
|
-
|
|
115393
|
-
|
|
115394
|
-
|
|
115395
|
-
|
|
115396
|
-
|
|
115397
|
-
|
|
115398
|
-
|
|
115399
|
-
|
|
115400
|
-
|
|
115401
|
-
|
|
115402
|
-
|
|
115403
|
-
|
|
115404
|
-
|
|
115405
|
-
|
|
115406
|
-
|
|
115407
|
-
|
|
115408
|
-
|
|
115409
|
-
|
|
115410
|
-
|
|
115411
|
-
|
|
115412
|
-
|
|
115413
|
-
|
|
115414
|
-
|
|
115415
|
-
|
|
115416
|
-
|
|
115417
|
-
|
|
115418
|
-
}
|
|
115419
|
-
if (options.importsNotUsedAsValues) {
|
|
115420
|
-
createDeprecatedDiagnosticForOption(
|
|
115421
|
-
version2,
|
|
115422
|
-
"importsNotUsedAsValues",
|
|
115423
|
-
/*value*/
|
|
115424
|
-
void 0,
|
|
115425
|
-
"verbatimModuleSyntax"
|
|
115426
|
-
);
|
|
115427
|
-
}
|
|
115428
|
-
if (options.preserveValueImports) {
|
|
115429
|
-
createDeprecatedDiagnosticForOption(
|
|
115430
|
-
version2,
|
|
115431
|
-
"preserveValueImports",
|
|
115432
|
-
/*value*/
|
|
115433
|
-
void 0,
|
|
115434
|
-
"verbatimModuleSyntax"
|
|
115435
|
-
);
|
|
115436
|
-
}
|
|
115437
|
-
}
|
|
115438
|
-
function verifyDeprecatedProjectReference(ref, parentFile, index) {
|
|
115439
|
-
if (ref.prepend) {
|
|
115440
|
-
const version2 = getVersionForDeprecationDiagnostics(
|
|
115441
|
-
/*reportInvalidIgnoreDeprecations*/
|
|
115442
|
-
false
|
|
115443
|
-
);
|
|
115444
|
-
if (version2) {
|
|
115445
|
-
createDeprecatedOptionForVersionDiagnostic(
|
|
115446
|
-
version2,
|
|
115447
|
-
(message, arg0, arg1, arg2) => createDiagnosticForReference(parentFile, index, message, arg0, arg1, arg2),
|
|
115448
|
-
"prepend"
|
|
115448
|
+
function createDiagnostic(name, value, useInstead, message, arg0, arg1, arg2, arg3) {
|
|
115449
|
+
if (useInstead) {
|
|
115450
|
+
const details = chainDiagnosticMessages(
|
|
115451
|
+
/*details*/
|
|
115452
|
+
void 0,
|
|
115453
|
+
Diagnostics.Use_0_instead,
|
|
115454
|
+
useInstead
|
|
115455
|
+
);
|
|
115456
|
+
const chain = chainDiagnosticMessages(details, message, arg0, arg1, arg2, arg3);
|
|
115457
|
+
createDiagnosticForOption(
|
|
115458
|
+
/*onKey*/
|
|
115459
|
+
!value,
|
|
115460
|
+
name,
|
|
115461
|
+
/*option2*/
|
|
115462
|
+
void 0,
|
|
115463
|
+
chain
|
|
115464
|
+
);
|
|
115465
|
+
} else {
|
|
115466
|
+
createDiagnosticForOption(
|
|
115467
|
+
/*onKey*/
|
|
115468
|
+
!value,
|
|
115469
|
+
name,
|
|
115470
|
+
/*option2*/
|
|
115471
|
+
void 0,
|
|
115472
|
+
message,
|
|
115473
|
+
arg0,
|
|
115474
|
+
arg1,
|
|
115475
|
+
arg2,
|
|
115476
|
+
arg3
|
|
115449
115477
|
);
|
|
115450
115478
|
}
|
|
115451
115479
|
}
|
|
115480
|
+
checkDeprecations("5.0", "5.5", createDiagnostic, (createDeprecatedDiagnostic) => {
|
|
115481
|
+
if (options.target === 0 /* ES3 */) {
|
|
115482
|
+
createDeprecatedDiagnostic("target", "ES3");
|
|
115483
|
+
}
|
|
115484
|
+
if (options.noImplicitUseStrict) {
|
|
115485
|
+
createDeprecatedDiagnostic("noImplicitUseStrict");
|
|
115486
|
+
}
|
|
115487
|
+
if (options.keyofStringsOnly) {
|
|
115488
|
+
createDeprecatedDiagnostic("keyofStringsOnly");
|
|
115489
|
+
}
|
|
115490
|
+
if (options.suppressExcessPropertyErrors) {
|
|
115491
|
+
createDeprecatedDiagnostic("suppressExcessPropertyErrors");
|
|
115492
|
+
}
|
|
115493
|
+
if (options.suppressImplicitAnyIndexErrors) {
|
|
115494
|
+
createDeprecatedDiagnostic("suppressImplicitAnyIndexErrors");
|
|
115495
|
+
}
|
|
115496
|
+
if (options.noStrictGenericChecks) {
|
|
115497
|
+
createDeprecatedDiagnostic("noStrictGenericChecks");
|
|
115498
|
+
}
|
|
115499
|
+
if (options.charset) {
|
|
115500
|
+
createDeprecatedDiagnostic("charset");
|
|
115501
|
+
}
|
|
115502
|
+
if (options.out) {
|
|
115503
|
+
createDeprecatedDiagnostic(
|
|
115504
|
+
"out",
|
|
115505
|
+
/*value*/
|
|
115506
|
+
void 0,
|
|
115507
|
+
"outFile"
|
|
115508
|
+
);
|
|
115509
|
+
}
|
|
115510
|
+
if (options.importsNotUsedAsValues) {
|
|
115511
|
+
createDeprecatedDiagnostic(
|
|
115512
|
+
"importsNotUsedAsValues",
|
|
115513
|
+
/*value*/
|
|
115514
|
+
void 0,
|
|
115515
|
+
"verbatimModuleSyntax"
|
|
115516
|
+
);
|
|
115517
|
+
}
|
|
115518
|
+
if (options.preserveValueImports) {
|
|
115519
|
+
createDeprecatedDiagnostic(
|
|
115520
|
+
"preserveValueImports",
|
|
115521
|
+
/*value*/
|
|
115522
|
+
void 0,
|
|
115523
|
+
"verbatimModuleSyntax"
|
|
115524
|
+
);
|
|
115525
|
+
}
|
|
115526
|
+
});
|
|
115452
115527
|
}
|
|
115453
|
-
function
|
|
115454
|
-
|
|
115455
|
-
|
|
115456
|
-
(message, arg0, arg1, arg2) => {
|
|
115457
|
-
if (useInstead) {
|
|
115458
|
-
const details = chainDiagnosticMessages(
|
|
115459
|
-
/*details*/
|
|
115460
|
-
void 0,
|
|
115461
|
-
Diagnostics.Use_0_instead,
|
|
115462
|
-
useInstead
|
|
115463
|
-
);
|
|
115464
|
-
const chain = chainDiagnosticMessages(details, message, arg0, arg1, arg2);
|
|
115465
|
-
createDiagnosticForOption(
|
|
115466
|
-
/*onKey*/
|
|
115467
|
-
!value,
|
|
115468
|
-
name,
|
|
115469
|
-
/*option2*/
|
|
115470
|
-
void 0,
|
|
115471
|
-
chain
|
|
115472
|
-
);
|
|
115473
|
-
} else {
|
|
115474
|
-
createDiagnosticForOption(
|
|
115475
|
-
/*onKey*/
|
|
115476
|
-
!value,
|
|
115477
|
-
name,
|
|
115478
|
-
/*option2*/
|
|
115479
|
-
void 0,
|
|
115480
|
-
message,
|
|
115481
|
-
arg0,
|
|
115482
|
-
arg1,
|
|
115483
|
-
arg2
|
|
115484
|
-
);
|
|
115485
|
-
}
|
|
115486
|
-
},
|
|
115487
|
-
name,
|
|
115488
|
-
value
|
|
115489
|
-
);
|
|
115490
|
-
}
|
|
115491
|
-
function createDeprecatedOptionForVersionDiagnostic(version2, createDiagnostic, name, value) {
|
|
115492
|
-
if (version2 === "6.0" /* v6_0 */) {
|
|
115493
|
-
createDiagnostic(Diagnostics.Flag_0_is_deprecated_Please_remove_it_from_your_configuration, value || name);
|
|
115494
|
-
} else {
|
|
115495
|
-
createDiagnostic(Diagnostics.Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error, value || name, "5.5" /* v5_5 */, "5.0" /* v5_0 */);
|
|
115528
|
+
function verifyDeprecatedProjectReference(ref, parentFile, index) {
|
|
115529
|
+
function createDiagnostic(_name, _value, _useInstead, message, arg0, arg1, arg2, arg3) {
|
|
115530
|
+
createDiagnosticForReference(parentFile, index, message, arg0, arg1, arg2, arg3);
|
|
115496
115531
|
}
|
|
115532
|
+
checkDeprecations("5.0", "5.5", createDiagnostic, (createDeprecatedDiagnostic) => {
|
|
115533
|
+
if (ref.prepend) {
|
|
115534
|
+
createDeprecatedDiagnostic("prepend");
|
|
115535
|
+
}
|
|
115536
|
+
});
|
|
115497
115537
|
}
|
|
115498
115538
|
function createDiagnosticExplainingFile(file, fileProcessingReason, diagnostic, args) {
|
|
115499
115539
|
var _a3;
|
|
@@ -115746,25 +115786,25 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
115746
115786
|
arg1
|
|
115747
115787
|
);
|
|
115748
115788
|
}
|
|
115749
|
-
function createDiagnosticForReference(sourceFile, index, message, arg0, arg1, arg2) {
|
|
115789
|
+
function createDiagnosticForReference(sourceFile, index, message, arg0, arg1, arg2, arg3) {
|
|
115750
115790
|
const referencesSyntax = firstDefined(
|
|
115751
115791
|
getTsConfigPropArray(sourceFile || options.configFile, "references"),
|
|
115752
115792
|
(property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0
|
|
115753
115793
|
);
|
|
115754
115794
|
if (referencesSyntax && referencesSyntax.elements.length > index) {
|
|
115755
|
-
programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, arg0, arg1, arg2));
|
|
115795
|
+
programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, arg0, arg1, arg2, arg3));
|
|
115756
115796
|
} else {
|
|
115757
|
-
programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2));
|
|
115797
|
+
programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2, arg3));
|
|
115758
115798
|
}
|
|
115759
115799
|
}
|
|
115760
|
-
function createDiagnosticForOption(onKey, option1, option2, message, arg0, arg1, arg2) {
|
|
115800
|
+
function createDiagnosticForOption(onKey, option1, option2, message, arg0, arg1, arg2, arg3) {
|
|
115761
115801
|
const compilerOptionsObjectLiteralSyntax = getCompilerOptionsObjectLiteralSyntax();
|
|
115762
|
-
const needCompilerDiagnostic = !compilerOptionsObjectLiteralSyntax || !createOptionDiagnosticInObjectLiteralSyntax(compilerOptionsObjectLiteralSyntax, onKey, option1, option2, message, arg0, arg1, arg2);
|
|
115802
|
+
const needCompilerDiagnostic = !compilerOptionsObjectLiteralSyntax || !createOptionDiagnosticInObjectLiteralSyntax(compilerOptionsObjectLiteralSyntax, onKey, option1, option2, message, arg0, arg1, arg2, arg3);
|
|
115763
115803
|
if (needCompilerDiagnostic) {
|
|
115764
115804
|
if ("messageText" in message) {
|
|
115765
115805
|
programDiagnostics.add(createCompilerDiagnosticFromMessageChain(message));
|
|
115766
115806
|
} else {
|
|
115767
|
-
programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2));
|
|
115807
|
+
programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2, arg3));
|
|
115768
115808
|
}
|
|
115769
115809
|
}
|
|
115770
115810
|
}
|
|
@@ -115783,13 +115823,13 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
115783
115823
|
}
|
|
115784
115824
|
return _compilerOptionsObjectLiteralSyntax || void 0;
|
|
115785
115825
|
}
|
|
115786
|
-
function createOptionDiagnosticInObjectLiteralSyntax(objectLiteral, onKey, key1, key2, message, arg0, arg1, arg2) {
|
|
115826
|
+
function createOptionDiagnosticInObjectLiteralSyntax(objectLiteral, onKey, key1, key2, message, arg0, arg1, arg2, arg3) {
|
|
115787
115827
|
const props = getPropertyAssignment(objectLiteral, key1, key2);
|
|
115788
115828
|
for (const prop of props) {
|
|
115789
115829
|
if ("messageText" in message) {
|
|
115790
115830
|
programDiagnostics.add(createDiagnosticForNodeFromMessageChain(options.configFile, onKey ? prop.name : prop.initializer, message));
|
|
115791
115831
|
} else {
|
|
115792
|
-
programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile, onKey ? prop.name : prop.initializer, message, arg0, arg1, arg2));
|
|
115832
|
+
programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile, onKey ? prop.name : prop.initializer, message, arg0, arg1, arg2, arg3));
|
|
115793
115833
|
}
|
|
115794
115834
|
}
|
|
115795
115835
|
return !!props.length;
|