@typescript-deploys/pr-build 5.0.0-pr-52899-9 → 5.0.0-pr-49226-5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +90 -61
- package/lib/tsserver.js +91 -91
- package/lib/tsserverlibrary.js +91 -91
- package/lib/typescript.js +91 -91
- package/lib/typingsInstaller.js +81 -50
- package/package.json +1 -1
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.0";
|
|
26
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
26
|
+
var version = `${versionMajorMinor}.0-insiders.20230225`;
|
|
27
27
|
|
|
28
28
|
// src/compiler/core.ts
|
|
29
29
|
var emptyArray = [];
|
|
@@ -6890,12 +6890,10 @@ var Diagnostics = {
|
|
|
6890
6890
|
The_root_value_of_a_0_file_must_be_an_object: diag(5092, 1 /* Error */, "The_root_value_of_a_0_file_must_be_an_object_5092", "The root value of a '{0}' file must be an object."),
|
|
6891
6891
|
Compiler_option_0_may_only_be_used_with_build: diag(5093, 1 /* Error */, "Compiler_option_0_may_only_be_used_with_build_5093", "Compiler option '--{0}' may only be used with '--build'."),
|
|
6892
6892
|
Compiler_option_0_may_not_be_used_with_build: diag(5094, 1 /* Error */, "Compiler_option_0_may_not_be_used_with_build_5094", "Compiler option '--{0}' may not be used with '--build'."),
|
|
6893
|
-
|
|
6893
|
+
Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later: diag(5095, 1 /* Error */, "Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later_5095", "Option '{0}' can only be used when 'module' is set to 'es2015' or later."),
|
|
6894
6894
|
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."),
|
|
6895
6895
|
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."),
|
|
6896
6896
|
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'."),
|
|
6897
|
-
Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead: diag(5099, 1 /* Error */, "Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Aster_5099", `Import assignment is not allowed when 'moduleResolution' is set to 'bundler'. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.`),
|
|
6898
|
-
Export_assignment_cannot_be_used_when_moduleResolution_is_set_to_bundler_Consider_using_export_default_or_another_module_format_instead: diag(5100, 1 /* Error */, "Export_assignment_cannot_be_used_when_moduleResolution_is_set_to_bundler_Consider_using_export_defau_5100", "Export assignment cannot be used when 'moduleResolution' is set to 'bundler'. Consider using 'export default' or another module format instead."),
|
|
6899
6897
|
Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecat_5101", `Flag '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '"ignoreDeprecations": "{2}"' to silence this error.`),
|
|
6900
6898
|
Flag_0_is_deprecated_Please_remove_it_from_your_configuration: diag(5102, 1 /* Error */, "Flag_0_is_deprecated_Please_remove_it_from_your_configuration_5102", "Flag '{0}' is deprecated. Please remove it from your configuration."),
|
|
6901
6899
|
Invalid_value_for_ignoreDeprecations: diag(5103, 1 /* Error */, "Invalid_value_for_ignoreDeprecations_5103", "Invalid value for '--ignoreDeprecations'."),
|
|
@@ -7825,8 +7823,7 @@ var Diagnostics = {
|
|
|
7825
7823
|
_0_is_possibly_undefined: diag(18048, 1 /* Error */, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."),
|
|
7826
7824
|
_0_is_possibly_null_or_undefined: diag(18049, 1 /* Error */, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."),
|
|
7827
7825
|
The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."),
|
|
7828
|
-
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string.")
|
|
7829
|
-
Add_missing_comma_for_an_object_member_completion_0: diag(18052, 3 /* Message */, "Add_missing_comma_for_an_object_member_completion_0_18052", "Add missing comma for an object member completion '{0}'.")
|
|
7826
|
+
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string.")
|
|
7830
7827
|
};
|
|
7831
7828
|
|
|
7832
7829
|
// src/compiler/scanner.ts
|
|
@@ -26061,6 +26058,34 @@ var Parser;
|
|
|
26061
26058
|
))
|
|
26062
26059
|
};
|
|
26063
26060
|
var factory2 = createNodeFactory(1 /* NoParenthesizerRules */ | 2 /* NoNodeConverters */ | 8 /* NoOriginalNode */, baseNodeFactory);
|
|
26061
|
+
var {
|
|
26062
|
+
createNodeArray: factoryCreateNodeArray,
|
|
26063
|
+
createNumericLiteral: factoryCreateNumericLiteral,
|
|
26064
|
+
createStringLiteral: factoryCreateStringLiteral,
|
|
26065
|
+
createLiteralLikeNode: factoryCreateLiteralLikeNode,
|
|
26066
|
+
createIdentifier: factoryCreateIdentifier,
|
|
26067
|
+
createPrivateIdentifier: factoryCreatePrivateIdentifier,
|
|
26068
|
+
createToken: factoryCreateToken,
|
|
26069
|
+
createArrayLiteralExpression: factoryCreateArrayLiteralExpression,
|
|
26070
|
+
createObjectLiteralExpression: factoryCreateObjectLiteralExpression,
|
|
26071
|
+
createPropertyAccessExpression: factoryCreatePropertyAccessExpression,
|
|
26072
|
+
createPropertyAccessChain: factoryCreatePropertyAccessChain,
|
|
26073
|
+
createElementAccessExpression: factoryCreateElementAccessExpression,
|
|
26074
|
+
createElementAccessChain: factoryCreateElementAccessChain,
|
|
26075
|
+
createCallExpression: factoryCreateCallExpression,
|
|
26076
|
+
createCallChain: factoryCreateCallChain,
|
|
26077
|
+
createNewExpression: factoryCreateNewExpression,
|
|
26078
|
+
createParenthesizedExpression: factoryCreateParenthesizedExpression,
|
|
26079
|
+
createBlock: factoryCreateBlock,
|
|
26080
|
+
createVariableStatement: factoryCreateVariableStatement,
|
|
26081
|
+
createExpressionStatement: factoryCreateExpressionStatement,
|
|
26082
|
+
createIfStatement: factoryCreateIfStatement,
|
|
26083
|
+
createWhileStatement: factoryCreateWhileStatement,
|
|
26084
|
+
createForStatement: factoryCreateForStatement,
|
|
26085
|
+
createForOfStatement: factoryCreateForOfStatement,
|
|
26086
|
+
createVariableDeclaration: factoryCreateVariableDeclaration,
|
|
26087
|
+
createVariableDeclarationList: factoryCreateVariableDeclarationList
|
|
26088
|
+
} = factory2;
|
|
26064
26089
|
var fileName;
|
|
26065
26090
|
var sourceFlags;
|
|
26066
26091
|
var sourceText;
|
|
@@ -26178,8 +26203,8 @@ var Parser;
|
|
|
26178
26203
|
}
|
|
26179
26204
|
}
|
|
26180
26205
|
}
|
|
26181
|
-
const expression = isArray(expressions) ? finishNode(
|
|
26182
|
-
const statement =
|
|
26206
|
+
const expression = isArray(expressions) ? finishNode(factoryCreateArrayLiteralExpression(expressions), pos) : Debug.checkDefined(expressions);
|
|
26207
|
+
const statement = factoryCreateExpressionStatement(expression);
|
|
26183
26208
|
finishNode(statement, pos);
|
|
26184
26209
|
statements = createNodeArray([statement], pos);
|
|
26185
26210
|
endOfFileToken = parseExpectedToken(1 /* EndOfFileToken */, Diagnostics.Unexpected_token);
|
|
@@ -26362,7 +26387,7 @@ var Parser;
|
|
|
26362
26387
|
}
|
|
26363
26388
|
}
|
|
26364
26389
|
syntaxCursor = savedSyntaxCursor;
|
|
26365
|
-
return factory2.updateSourceFile(sourceFile, setTextRange(
|
|
26390
|
+
return factory2.updateSourceFile(sourceFile, setTextRange(factoryCreateNodeArray(statements), sourceFile.statements));
|
|
26366
26391
|
function containsPossibleTopLevelAwait(node) {
|
|
26367
26392
|
return !(node.flags & 32768 /* AwaitContext */) && !!(node.transformFlags & 67108864 /* ContainsPossibleTopLevelAwait */);
|
|
26368
26393
|
}
|
|
@@ -26803,13 +26828,13 @@ var Parser;
|
|
|
26803
26828
|
const pos = getNodePos();
|
|
26804
26829
|
const kind = token();
|
|
26805
26830
|
nextToken();
|
|
26806
|
-
return finishNode(
|
|
26831
|
+
return finishNode(factoryCreateToken(kind), pos);
|
|
26807
26832
|
}
|
|
26808
26833
|
function parseTokenNodeJSDoc() {
|
|
26809
26834
|
const pos = getNodePos();
|
|
26810
26835
|
const kind = token();
|
|
26811
26836
|
nextTokenJSDoc();
|
|
26812
|
-
return finishNode(
|
|
26837
|
+
return finishNode(factoryCreateToken(kind), pos);
|
|
26813
26838
|
}
|
|
26814
26839
|
function canParseSemicolon() {
|
|
26815
26840
|
if (token() === 26 /* SemicolonToken */) {
|
|
@@ -26830,7 +26855,7 @@ var Parser;
|
|
|
26830
26855
|
return tryParseSemicolon() || parseExpected(26 /* SemicolonToken */);
|
|
26831
26856
|
}
|
|
26832
26857
|
function createNodeArray(elements, pos, end, hasTrailingComma) {
|
|
26833
|
-
const array =
|
|
26858
|
+
const array = factoryCreateNodeArray(elements, hasTrailingComma);
|
|
26834
26859
|
setTextRangePosEnd(array, pos, end != null ? end : scanner.getStartPos());
|
|
26835
26860
|
return array;
|
|
26836
26861
|
}
|
|
@@ -26852,7 +26877,7 @@ var Parser;
|
|
|
26852
26877
|
parseErrorAtCurrentToken(diagnosticMessage, arg0);
|
|
26853
26878
|
}
|
|
26854
26879
|
const pos = getNodePos();
|
|
26855
|
-
const result = kind === 79 /* Identifier */ ?
|
|
26880
|
+
const result = kind === 79 /* Identifier */ ? factoryCreateIdentifier(
|
|
26856
26881
|
"",
|
|
26857
26882
|
/*originalKeywordKind*/
|
|
26858
26883
|
void 0
|
|
@@ -26862,15 +26887,15 @@ var Parser;
|
|
|
26862
26887
|
"",
|
|
26863
26888
|
/*templateFlags*/
|
|
26864
26889
|
void 0
|
|
26865
|
-
) : kind === 8 /* NumericLiteral */ ?
|
|
26890
|
+
) : kind === 8 /* NumericLiteral */ ? factoryCreateNumericLiteral(
|
|
26866
26891
|
"",
|
|
26867
26892
|
/*numericLiteralFlags*/
|
|
26868
26893
|
void 0
|
|
26869
|
-
) : kind === 10 /* StringLiteral */ ?
|
|
26894
|
+
) : kind === 10 /* StringLiteral */ ? factoryCreateStringLiteral(
|
|
26870
26895
|
"",
|
|
26871
26896
|
/*isSingleQuote*/
|
|
26872
26897
|
void 0
|
|
26873
|
-
) : kind === 279 /* MissingDeclaration */ ? factory2.createMissingDeclaration() :
|
|
26898
|
+
) : kind === 279 /* MissingDeclaration */ ? factory2.createMissingDeclaration() : factoryCreateToken(kind);
|
|
26874
26899
|
return finishNode(result, pos);
|
|
26875
26900
|
}
|
|
26876
26901
|
function internIdentifier(text) {
|
|
@@ -26888,7 +26913,7 @@ var Parser;
|
|
|
26888
26913
|
const text = internIdentifier(scanner.getTokenValue());
|
|
26889
26914
|
const hasExtendedUnicodeEscape = scanner.hasExtendedUnicodeEscape();
|
|
26890
26915
|
nextTokenWithoutCheck();
|
|
26891
|
-
return finishNode(
|
|
26916
|
+
return finishNode(factoryCreateIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape), pos);
|
|
26892
26917
|
}
|
|
26893
26918
|
if (token() === 80 /* PrivateIdentifier */) {
|
|
26894
26919
|
parseErrorAtCurrentToken(privateIdentifierDiagnosticMessage || Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
|
|
@@ -26959,7 +26984,7 @@ var Parser;
|
|
|
26959
26984
|
}
|
|
26960
26985
|
function parsePrivateIdentifier() {
|
|
26961
26986
|
const pos = getNodePos();
|
|
26962
|
-
const node =
|
|
26987
|
+
const node = factoryCreatePrivateIdentifier(internIdentifier(scanner.getTokenValue()));
|
|
26963
26988
|
nextToken();
|
|
26964
26989
|
return finishNode(node, pos);
|
|
26965
26990
|
}
|
|
@@ -27674,12 +27699,12 @@ var Parser;
|
|
|
27674
27699
|
// never get a token like this. Instead, we would get 00 and 9 as two separate tokens.
|
|
27675
27700
|
// We also do not need to check for negatives because any prefix operator would be part of a
|
|
27676
27701
|
// parent unary expression.
|
|
27677
|
-
kind === 8 /* NumericLiteral */ ?
|
|
27702
|
+
kind === 8 /* NumericLiteral */ ? factoryCreateNumericLiteral(scanner.getTokenValue(), scanner.getNumericLiteralFlags()) : kind === 10 /* StringLiteral */ ? factoryCreateStringLiteral(
|
|
27678
27703
|
scanner.getTokenValue(),
|
|
27679
27704
|
/*isSingleQuote*/
|
|
27680
27705
|
void 0,
|
|
27681
27706
|
scanner.hasExtendedUnicodeEscape()
|
|
27682
|
-
) : isLiteralKind(kind) ?
|
|
27707
|
+
) : isLiteralKind(kind) ? factoryCreateLiteralLikeNode(kind, scanner.getTokenValue()) : Debug.fail()
|
|
27683
27708
|
);
|
|
27684
27709
|
if (scanner.hasExtendedUnicodeEscape()) {
|
|
27685
27710
|
node.hasExtendedUnicodeEscape = true;
|
|
@@ -28270,7 +28295,7 @@ var Parser;
|
|
|
28270
28295
|
if (token() === 126 /* AbstractKeyword */) {
|
|
28271
28296
|
const pos = getNodePos();
|
|
28272
28297
|
nextToken();
|
|
28273
|
-
const modifier = finishNode(
|
|
28298
|
+
const modifier = finishNode(factoryCreateToken(126 /* AbstractKeyword */), pos);
|
|
28274
28299
|
modifiers = createNodeArray([modifier], pos);
|
|
28275
28300
|
}
|
|
28276
28301
|
return modifiers;
|
|
@@ -29327,7 +29352,7 @@ var Parser;
|
|
|
29327
29352
|
return expression;
|
|
29328
29353
|
}
|
|
29329
29354
|
parseExpectedToken(24 /* DotToken */, Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access);
|
|
29330
|
-
return finishNode(
|
|
29355
|
+
return finishNode(factoryCreatePropertyAccessExpression(expression, parseRightSideOfDot(
|
|
29331
29356
|
/*allowIdentifierNames*/
|
|
29332
29357
|
true,
|
|
29333
29358
|
/*allowPrivateIdentifiers*/
|
|
@@ -29348,7 +29373,7 @@ var Parser;
|
|
|
29348
29373
|
factory2.createJsxElement(
|
|
29349
29374
|
lastChild.openingElement,
|
|
29350
29375
|
lastChild.children,
|
|
29351
|
-
finishNode(factory2.createJsxClosingElement(finishNode(
|
|
29376
|
+
finishNode(factory2.createJsxClosingElement(finishNode(factoryCreateIdentifier(""), end, end)), end, end)
|
|
29352
29377
|
),
|
|
29353
29378
|
lastChild.openingElement.pos,
|
|
29354
29379
|
end
|
|
@@ -29491,7 +29516,7 @@ var Parser;
|
|
|
29491
29516
|
scanJsxIdentifier();
|
|
29492
29517
|
let expression = token() === 108 /* ThisKeyword */ ? parseTokenNode() : parseIdentifierName();
|
|
29493
29518
|
while (parseOptional(24 /* DotToken */)) {
|
|
29494
|
-
expression = finishNode(
|
|
29519
|
+
expression = finishNode(factoryCreatePropertyAccessExpression(expression, parseRightSideOfDot(
|
|
29495
29520
|
/*allowIdentifierNames*/
|
|
29496
29521
|
true,
|
|
29497
29522
|
/*allowPrivateIdentifiers*/
|
|
@@ -29642,7 +29667,7 @@ var Parser;
|
|
|
29642
29667
|
true
|
|
29643
29668
|
);
|
|
29644
29669
|
const isOptionalChain2 = questionDotToken || tryReparseOptionalChain(expression);
|
|
29645
|
-
const propertyAccess = isOptionalChain2 ?
|
|
29670
|
+
const propertyAccess = isOptionalChain2 ? factoryCreatePropertyAccessChain(expression, questionDotToken, name) : factoryCreatePropertyAccessExpression(expression, name);
|
|
29646
29671
|
if (isOptionalChain2 && isPrivateIdentifier(propertyAccess.name)) {
|
|
29647
29672
|
parseErrorAtRange(propertyAccess.name, Diagnostics.An_optional_chain_cannot_contain_private_identifiers);
|
|
29648
29673
|
}
|
|
@@ -29670,7 +29695,7 @@ var Parser;
|
|
|
29670
29695
|
argumentExpression = argument;
|
|
29671
29696
|
}
|
|
29672
29697
|
parseExpected(23 /* CloseBracketToken */);
|
|
29673
|
-
const indexedAccess = questionDotToken || tryReparseOptionalChain(expression) ?
|
|
29698
|
+
const indexedAccess = questionDotToken || tryReparseOptionalChain(expression) ? factoryCreateElementAccessChain(expression, questionDotToken, argumentExpression) : factoryCreateElementAccessExpression(expression, argumentExpression);
|
|
29674
29699
|
return finishNode(indexedAccess, pos);
|
|
29675
29700
|
}
|
|
29676
29701
|
function parseMemberExpressionRest(pos, expression, allowOptionalChain) {
|
|
@@ -29757,7 +29782,7 @@ var Parser;
|
|
|
29757
29782
|
expression = expression.expression;
|
|
29758
29783
|
}
|
|
29759
29784
|
const argumentList = parseArgumentList();
|
|
29760
|
-
const callExpr = questionDotToken || tryReparseOptionalChain(expression) ?
|
|
29785
|
+
const callExpr = questionDotToken || tryReparseOptionalChain(expression) ? factoryCreateCallChain(expression, questionDotToken, typeArguments, argumentList) : factoryCreateCallExpression(expression, typeArguments, argumentList);
|
|
29761
29786
|
expression = finishNode(callExpr, pos);
|
|
29762
29787
|
continue;
|
|
29763
29788
|
}
|
|
@@ -29768,7 +29793,7 @@ var Parser;
|
|
|
29768
29793
|
false,
|
|
29769
29794
|
Diagnostics.Identifier_expected
|
|
29770
29795
|
);
|
|
29771
|
-
expression = finishNode(
|
|
29796
|
+
expression = finishNode(factoryCreatePropertyAccessChain(expression, questionDotToken, name), pos);
|
|
29772
29797
|
}
|
|
29773
29798
|
break;
|
|
29774
29799
|
}
|
|
@@ -29863,7 +29888,7 @@ var Parser;
|
|
|
29863
29888
|
parseExpected(20 /* OpenParenToken */);
|
|
29864
29889
|
const expression = allowInAnd(parseExpression);
|
|
29865
29890
|
parseExpected(21 /* CloseParenToken */);
|
|
29866
|
-
return withJSDoc(finishNode(
|
|
29891
|
+
return withJSDoc(finishNode(factoryCreateParenthesizedExpression(expression), pos), hasJSDoc);
|
|
29867
29892
|
}
|
|
29868
29893
|
function parseSpreadElement() {
|
|
29869
29894
|
const pos = getNodePos();
|
|
@@ -29890,7 +29915,7 @@ var Parser;
|
|
|
29890
29915
|
const multiLine = scanner.hasPrecedingLineBreak();
|
|
29891
29916
|
const elements = parseDelimitedList(15 /* ArrayLiteralMembers */, parseArgumentOrArrayLiteralElement);
|
|
29892
29917
|
parseExpectedMatchingBrackets(22 /* OpenBracketToken */, 23 /* CloseBracketToken */, openBracketParsed, openBracketPosition);
|
|
29893
|
-
return finishNode(
|
|
29918
|
+
return finishNode(factoryCreateArrayLiteralExpression(elements, multiLine), pos);
|
|
29894
29919
|
}
|
|
29895
29920
|
function parseObjectLiteralElement() {
|
|
29896
29921
|
const pos = getNodePos();
|
|
@@ -29955,7 +29980,7 @@ var Parser;
|
|
|
29955
29980
|
true
|
|
29956
29981
|
);
|
|
29957
29982
|
parseExpectedMatchingBrackets(18 /* OpenBraceToken */, 19 /* CloseBraceToken */, openBraceParsed, openBracePosition);
|
|
29958
|
-
return finishNode(
|
|
29983
|
+
return finishNode(factoryCreateObjectLiteralExpression(properties, multiLine), pos);
|
|
29959
29984
|
}
|
|
29960
29985
|
function parseFunctionExpression() {
|
|
29961
29986
|
const savedDecoratorContext = inDecoratorContext();
|
|
@@ -30012,7 +30037,7 @@ var Parser;
|
|
|
30012
30037
|
parseErrorAtCurrentToken(Diagnostics.Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0, getTextOfNodeFromSourceText(sourceText, expression));
|
|
30013
30038
|
}
|
|
30014
30039
|
const argumentList = token() === 20 /* OpenParenToken */ ? parseArgumentList() : void 0;
|
|
30015
|
-
return finishNode(
|
|
30040
|
+
return finishNode(factoryCreateNewExpression(expression, typeArguments, argumentList), pos);
|
|
30016
30041
|
}
|
|
30017
30042
|
function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) {
|
|
30018
30043
|
const pos = getNodePos();
|
|
@@ -30023,7 +30048,7 @@ var Parser;
|
|
|
30023
30048
|
const multiLine = scanner.hasPrecedingLineBreak();
|
|
30024
30049
|
const statements = parseList(1 /* BlockStatements */, parseStatement);
|
|
30025
30050
|
parseExpectedMatchingBrackets(18 /* OpenBraceToken */, 19 /* CloseBraceToken */, openBraceParsed, openBracePosition);
|
|
30026
|
-
const result = withJSDoc(finishNode(
|
|
30051
|
+
const result = withJSDoc(finishNode(factoryCreateBlock(statements, multiLine), pos), hasJSDoc);
|
|
30027
30052
|
if (token() === 63 /* EqualsToken */) {
|
|
30028
30053
|
parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses);
|
|
30029
30054
|
nextToken();
|
|
@@ -30031,7 +30056,7 @@ var Parser;
|
|
|
30031
30056
|
return result;
|
|
30032
30057
|
} else {
|
|
30033
30058
|
const statements = createMissingList();
|
|
30034
|
-
return withJSDoc(finishNode(
|
|
30059
|
+
return withJSDoc(finishNode(factoryCreateBlock(
|
|
30035
30060
|
statements,
|
|
30036
30061
|
/*multiLine*/
|
|
30037
30062
|
void 0
|
|
@@ -30080,7 +30105,7 @@ var Parser;
|
|
|
30080
30105
|
parseExpectedMatchingBrackets(20 /* OpenParenToken */, 21 /* CloseParenToken */, openParenParsed, openParenPosition);
|
|
30081
30106
|
const thenStatement = parseStatement();
|
|
30082
30107
|
const elseStatement = parseOptional(91 /* ElseKeyword */) ? parseStatement() : void 0;
|
|
30083
|
-
return withJSDoc(finishNode(
|
|
30108
|
+
return withJSDoc(finishNode(factoryCreateIfStatement(expression, thenStatement, elseStatement), pos), hasJSDoc);
|
|
30084
30109
|
}
|
|
30085
30110
|
function parseDoStatement() {
|
|
30086
30111
|
const pos = getNodePos();
|
|
@@ -30104,7 +30129,7 @@ var Parser;
|
|
|
30104
30129
|
const expression = allowInAnd(parseExpression);
|
|
30105
30130
|
parseExpectedMatchingBrackets(20 /* OpenParenToken */, 21 /* CloseParenToken */, openParenParsed, openParenPosition);
|
|
30106
30131
|
const statement = parseStatement();
|
|
30107
|
-
return withJSDoc(finishNode(
|
|
30132
|
+
return withJSDoc(finishNode(factoryCreateWhileStatement(expression, statement), pos), hasJSDoc);
|
|
30108
30133
|
}
|
|
30109
30134
|
function parseForOrForInOrForOfStatement() {
|
|
30110
30135
|
const pos = getNodePos();
|
|
@@ -30130,7 +30155,7 @@ var Parser;
|
|
|
30130
30155
|
true
|
|
30131
30156
|
));
|
|
30132
30157
|
parseExpected(21 /* CloseParenToken */);
|
|
30133
|
-
node =
|
|
30158
|
+
node = factoryCreateForOfStatement(awaitToken, initializer, expression, parseStatement());
|
|
30134
30159
|
} else if (parseOptional(101 /* InKeyword */)) {
|
|
30135
30160
|
const expression = allowInAnd(parseExpression);
|
|
30136
30161
|
parseExpected(21 /* CloseParenToken */);
|
|
@@ -30141,7 +30166,7 @@ var Parser;
|
|
|
30141
30166
|
parseExpected(26 /* SemicolonToken */);
|
|
30142
30167
|
const incrementor = token() !== 21 /* CloseParenToken */ ? allowInAnd(parseExpression) : void 0;
|
|
30143
30168
|
parseExpected(21 /* CloseParenToken */);
|
|
30144
|
-
node =
|
|
30169
|
+
node = factoryCreateForStatement(initializer, condition, incrementor, parseStatement());
|
|
30145
30170
|
}
|
|
30146
30171
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
30147
30172
|
}
|
|
@@ -30216,7 +30241,7 @@ var Parser;
|
|
|
30216
30241
|
let expression = scanner.hasPrecedingLineBreak() ? void 0 : allowInAnd(parseExpression);
|
|
30217
30242
|
if (expression === void 0) {
|
|
30218
30243
|
identifierCount++;
|
|
30219
|
-
expression = finishNode(
|
|
30244
|
+
expression = finishNode(factoryCreateIdentifier(""), getNodePos());
|
|
30220
30245
|
}
|
|
30221
30246
|
if (!tryParseSemicolon()) {
|
|
30222
30247
|
parseErrorForMissingSemicolonAfter(expression);
|
|
@@ -30277,7 +30302,7 @@ var Parser;
|
|
|
30277
30302
|
if (!tryParseSemicolon()) {
|
|
30278
30303
|
parseErrorForMissingSemicolonAfter(expression);
|
|
30279
30304
|
}
|
|
30280
|
-
node =
|
|
30305
|
+
node = factoryCreateExpressionStatement(expression);
|
|
30281
30306
|
if (hasParen) {
|
|
30282
30307
|
hasJSDoc = false;
|
|
30283
30308
|
}
|
|
@@ -30675,7 +30700,7 @@ var Parser;
|
|
|
30675
30700
|
}
|
|
30676
30701
|
const type = parseTypeAnnotation();
|
|
30677
30702
|
const initializer = isInOrOfKeyword(token()) ? void 0 : parseInitializer();
|
|
30678
|
-
const node =
|
|
30703
|
+
const node = factoryCreateVariableDeclaration(name, exclamationToken, type, initializer);
|
|
30679
30704
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
30680
30705
|
}
|
|
30681
30706
|
function parseVariableDeclarationList(inForStatementInitializer) {
|
|
@@ -30706,7 +30731,7 @@ var Parser;
|
|
|
30706
30731
|
);
|
|
30707
30732
|
setDisallowInContext(savedDisallowIn);
|
|
30708
30733
|
}
|
|
30709
|
-
return finishNode(
|
|
30734
|
+
return finishNode(factoryCreateVariableDeclarationList(declarations, flags), pos);
|
|
30710
30735
|
}
|
|
30711
30736
|
function canFollowContextualOfKeyword() {
|
|
30712
30737
|
return nextTokenIsIdentifier() && nextToken() === 21 /* CloseParenToken */;
|
|
@@ -30717,7 +30742,7 @@ var Parser;
|
|
|
30717
30742
|
false
|
|
30718
30743
|
);
|
|
30719
30744
|
parseSemicolon();
|
|
30720
|
-
const node =
|
|
30745
|
+
const node = factoryCreateVariableStatement(modifiers, declarationList);
|
|
30721
30746
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
30722
30747
|
}
|
|
30723
30748
|
function parseFunctionDeclaration(pos, hasJSDoc, modifiers) {
|
|
@@ -30946,7 +30971,7 @@ var Parser;
|
|
|
30946
30971
|
return void 0;
|
|
30947
30972
|
}
|
|
30948
30973
|
}
|
|
30949
|
-
return finishNode(
|
|
30974
|
+
return finishNode(factoryCreateToken(kind), pos);
|
|
30950
30975
|
}
|
|
30951
30976
|
function parseModifiers(allowDecorators, permitConstAsModifier, stopOnStartOfClassStaticBlock) {
|
|
30952
30977
|
const pos = getNodePos();
|
|
@@ -30983,7 +31008,7 @@ var Parser;
|
|
|
30983
31008
|
if (token() === 132 /* AsyncKeyword */) {
|
|
30984
31009
|
const pos = getNodePos();
|
|
30985
31010
|
nextToken();
|
|
30986
|
-
const modifier = finishNode(
|
|
31011
|
+
const modifier = finishNode(factoryCreateToken(132 /* AsyncKeyword */), pos);
|
|
30987
31012
|
modifiers = createNodeArray([modifier], pos);
|
|
30988
31013
|
}
|
|
30989
31014
|
return modifiers;
|
|
@@ -31570,7 +31595,7 @@ var Parser;
|
|
|
31570
31595
|
/*isDeclarationFile*/
|
|
31571
31596
|
false,
|
|
31572
31597
|
[],
|
|
31573
|
-
|
|
31598
|
+
factoryCreateToken(1 /* EndOfFileToken */),
|
|
31574
31599
|
0 /* None */,
|
|
31575
31600
|
noop
|
|
31576
31601
|
);
|
|
@@ -32231,7 +32256,7 @@ var Parser;
|
|
|
32231
32256
|
let node = parseJSDocIdentifierName();
|
|
32232
32257
|
while (parseOptional(24 /* DotToken */)) {
|
|
32233
32258
|
const name = parseJSDocIdentifierName();
|
|
32234
|
-
node = finishNode(
|
|
32259
|
+
node = finishNode(factoryCreatePropertyAccessExpression(node, name), pos);
|
|
32235
32260
|
}
|
|
32236
32261
|
return node;
|
|
32237
32262
|
}
|
|
@@ -32522,7 +32547,7 @@ var Parser;
|
|
|
32522
32547
|
const end2 = scanner.getTextPos();
|
|
32523
32548
|
const originalKeywordKind = token();
|
|
32524
32549
|
const text = internIdentifier(scanner.getTokenValue());
|
|
32525
|
-
const result = finishNode(
|
|
32550
|
+
const result = finishNode(factoryCreateIdentifier(text, originalKeywordKind), pos, end2);
|
|
32526
32551
|
nextTokenJSDoc();
|
|
32527
32552
|
return result;
|
|
32528
32553
|
}
|
|
@@ -36752,10 +36777,13 @@ function getNodeResolutionFeatures(options) {
|
|
|
36752
36777
|
return features;
|
|
36753
36778
|
}
|
|
36754
36779
|
function getConditions(options, esmMode) {
|
|
36755
|
-
const conditions = esmMode || getEmitModuleResolutionKind(options) === 100 /* Bundler */ ? ["
|
|
36780
|
+
const conditions = esmMode || getEmitModuleResolutionKind(options) === 100 /* Bundler */ ? ["import"] : ["require"];
|
|
36756
36781
|
if (!options.noDtsResolution) {
|
|
36757
36782
|
conditions.push("types");
|
|
36758
36783
|
}
|
|
36784
|
+
if (getEmitModuleResolutionKind(options) !== 100 /* Bundler */) {
|
|
36785
|
+
conditions.push("node");
|
|
36786
|
+
}
|
|
36759
36787
|
return concatenate(conditions, options.customConditions);
|
|
36760
36788
|
}
|
|
36761
36789
|
function getAutomaticTypeDirectiveNames(options, host) {
|
|
@@ -37444,7 +37472,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
37444
37472
|
isConfigLookup,
|
|
37445
37473
|
candidateIsFromPackageJsonField: false
|
|
37446
37474
|
};
|
|
37447
|
-
if (traceEnabled &&
|
|
37475
|
+
if (traceEnabled && moduleResolutionSupportsPackageJsonExportsAndImports(getEmitModuleResolutionKind(compilerOptions))) {
|
|
37448
37476
|
trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", "));
|
|
37449
37477
|
}
|
|
37450
37478
|
let result;
|
|
@@ -45803,7 +45831,9 @@ function createTypeChecker(host) {
|
|
|
45803
45831
|
function getSuggestedImportSource(tsExtension) {
|
|
45804
45832
|
const importSourceWithoutExtension = removeExtension(moduleReference, tsExtension);
|
|
45805
45833
|
if (emitModuleKindIsNonNodeESM(moduleKind) || mode === 99 /* ESNext */) {
|
|
45806
|
-
|
|
45834
|
+
const preferTs = isDeclarationFileName(moduleReference) && shouldAllowImportingTsExtension(compilerOptions);
|
|
45835
|
+
const ext = tsExtension === ".mts" /* Mts */ || tsExtension === ".d.mts" /* Dmts */ ? preferTs ? ".mts" : ".mjs" : tsExtension === ".cts" /* Cts */ || tsExtension === ".d.mts" /* Dmts */ ? preferTs ? ".cts" : ".cjs" : preferTs ? ".ts" : ".js";
|
|
45836
|
+
return importSourceWithoutExtension + ext;
|
|
45807
45837
|
}
|
|
45808
45838
|
return importSourceWithoutExtension;
|
|
45809
45839
|
}
|
|
@@ -61627,7 +61657,7 @@ function createTypeChecker(host) {
|
|
|
61627
61657
|
return type.symbol;
|
|
61628
61658
|
}
|
|
61629
61659
|
if (isTupleType(type)) {
|
|
61630
|
-
return type
|
|
61660
|
+
return type;
|
|
61631
61661
|
}
|
|
61632
61662
|
}
|
|
61633
61663
|
if (type.flags & 262144 /* TypeParameter */) {
|
|
@@ -78796,8 +78826,6 @@ function createTypeChecker(host) {
|
|
|
78796
78826
|
} else {
|
|
78797
78827
|
if (moduleKind >= 5 /* ES2015 */ && getSourceFileOfNode(node).impliedNodeFormat === void 0 && !node.isTypeOnly && !(node.flags & 16777216 /* Ambient */)) {
|
|
78798
78828
|
grammarErrorOnNode(node, Diagnostics.Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead);
|
|
78799
|
-
} else if (!(node.flags & 16777216 /* Ambient */) && getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */) {
|
|
78800
|
-
grammarErrorOnNode(node, Diagnostics.Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead);
|
|
78801
78829
|
}
|
|
78802
78830
|
}
|
|
78803
78831
|
}
|
|
@@ -79004,8 +79032,6 @@ function createTypeChecker(host) {
|
|
|
79004
79032
|
grammarErrorOnNode(node, Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead);
|
|
79005
79033
|
} else if (moduleKind === 4 /* System */ && !(node.flags & 16777216 /* Ambient */)) {
|
|
79006
79034
|
grammarErrorOnNode(node, Diagnostics.Export_assignment_is_not_supported_when_module_flag_is_system);
|
|
79007
|
-
} else if (getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */ && !(node.flags & 16777216 /* Ambient */)) {
|
|
79008
|
-
grammarErrorOnNode(node, Diagnostics.Export_assignment_cannot_be_used_when_moduleResolution_is_set_to_bundler_Consider_using_export_default_or_another_module_format_instead);
|
|
79009
79035
|
}
|
|
79010
79036
|
}
|
|
79011
79037
|
}
|
|
@@ -115244,10 +115270,10 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
115244
115270
|
}
|
|
115245
115271
|
}
|
|
115246
115272
|
if (options.preserveValueImports && getEmitModuleKind(options) < 5 /* ES2015 */) {
|
|
115247
|
-
createDiagnosticForOptionName(Diagnostics.
|
|
115273
|
+
createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later, "preserveValueImports");
|
|
115248
115274
|
}
|
|
115275
|
+
const moduleKind = getEmitModuleKind(options);
|
|
115249
115276
|
if (options.verbatimModuleSyntax) {
|
|
115250
|
-
const moduleKind = getEmitModuleKind(options);
|
|
115251
115277
|
if (moduleKind === 2 /* AMD */ || moduleKind === 3 /* UMD */ || moduleKind === 4 /* System */) {
|
|
115252
115278
|
createDiagnosticForOptionName(Diagnostics.Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System, "verbatimModuleSyntax");
|
|
115253
115279
|
}
|
|
@@ -115266,13 +115292,16 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
115266
115292
|
}
|
|
115267
115293
|
const moduleResolution = getEmitModuleResolutionKind(options);
|
|
115268
115294
|
if (options.resolvePackageJsonExports && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
|
|
115269
|
-
|
|
115295
|
+
createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "resolvePackageJsonExports");
|
|
115270
115296
|
}
|
|
115271
115297
|
if (options.resolvePackageJsonImports && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
|
|
115272
|
-
|
|
115298
|
+
createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "resolvePackageJsonImports");
|
|
115273
115299
|
}
|
|
115274
115300
|
if (options.customConditions && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
|
|
115275
|
-
|
|
115301
|
+
createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "customConditions");
|
|
115302
|
+
}
|
|
115303
|
+
if (moduleResolution === 100 /* Bundler */ && !emitModuleKindIsNonNodeESM(moduleKind)) {
|
|
115304
|
+
createOptionValueDiagnostic("moduleResolution", Diagnostics.Option_0_can_only_be_used_when_module_is_set_to_es2015_or_later, "bundler");
|
|
115276
115305
|
}
|
|
115277
115306
|
if (!options.noEmit && !options.suppressOutputPathCheck) {
|
|
115278
115307
|
const emitHost = getEmitHost();
|