typescript 4.8.0-dev.20220617 → 4.8.0-dev.20220620
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/cs/diagnosticMessages.generated.json +5 -1
- package/lib/de/diagnosticMessages.generated.json +10 -1
- package/lib/es/diagnosticMessages.generated.json +10 -1
- package/lib/fr/diagnosticMessages.generated.json +5 -1
- package/lib/it/diagnosticMessages.generated.json +10 -1
- package/lib/ja/diagnosticMessages.generated.json +5 -1
- package/lib/ko/diagnosticMessages.generated.json +10 -1
- package/lib/lib.dom.d.ts +128 -183
- package/lib/lib.dom.iterable.d.ts +1 -11
- package/lib/lib.webworker.d.ts +54 -27
- package/lib/lib.webworker.iterable.d.ts +1 -1
- package/lib/pl/diagnosticMessages.generated.json +5 -1
- package/lib/protocol.d.ts +1 -0
- package/lib/pt-br/diagnosticMessages.generated.json +5 -1
- package/lib/ru/diagnosticMessages.generated.json +10 -1
- package/lib/tr/diagnosticMessages.generated.json +10 -1
- package/lib/tsc.js +69 -35
- package/lib/tsserver.js +115 -51
- package/lib/tsserverlibrary.d.ts +2 -0
- package/lib/tsserverlibrary.js +115 -51
- package/lib/typescript.d.ts +1 -0
- package/lib/typescript.js +115 -51
- package/lib/typescriptServices.d.ts +1 -0
- package/lib/typescriptServices.js +115 -51
- package/lib/typingsInstaller.js +90 -35
- package/lib/zh-cn/diagnosticMessages.generated.json +5 -1
- package/lib/zh-tw/diagnosticMessages.generated.json +5 -1
- package/package.json +3 -2
package/lib/tsc.js
CHANGED
|
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
var ts;
|
|
70
70
|
(function (ts) {
|
|
71
71
|
ts.versionMajorMinor = "4.8";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220620";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -7103,6 +7103,9 @@ var ts;
|
|
|
7103
7103
|
For_await_loops_cannot_be_used_inside_a_class_static_block: diag(18038, ts.DiagnosticCategory.Error, "For_await_loops_cannot_be_used_inside_a_class_static_block_18038", "'For await' loops cannot be used inside a class static block."),
|
|
7104
7104
|
Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block: diag(18039, ts.DiagnosticCategory.Error, "Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block_18039", "Invalid use of '{0}'. It cannot be used inside a class static block."),
|
|
7105
7105
|
A_return_statement_cannot_be_used_inside_a_class_static_block: diag(18041, ts.DiagnosticCategory.Error, "A_return_statement_cannot_be_used_inside_a_class_static_block_18041", "A 'return' statement cannot be used inside a class static block."),
|
|
7106
|
+
_0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation: diag(18042, ts.DiagnosticCategory.Error, "_0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation_18042", "'{0}' is a type and cannot be imported in JavaScript files. Use '{1}' in a JSDoc type annotation."),
|
|
7107
|
+
Types_cannot_appear_in_export_declarations_in_JavaScript_files: diag(18043, ts.DiagnosticCategory.Error, "Types_cannot_appear_in_export_declarations_in_JavaScript_files_18043", "Types cannot appear in export declarations in JavaScript files."),
|
|
7108
|
+
_0_is_automatically_exported_here: diag(18044, ts.DiagnosticCategory.Message, "_0_is_automatically_exported_here_18044", "'{0}' is automatically exported here."),
|
|
7106
7109
|
};
|
|
7107
7110
|
})(ts || (ts = {}));
|
|
7108
7111
|
var ts;
|
|
@@ -27908,10 +27911,10 @@ var ts;
|
|
|
27908
27911
|
setDecoratorContext(false);
|
|
27909
27912
|
}
|
|
27910
27913
|
var pos = getNodePos();
|
|
27911
|
-
var expr = parseAssignmentExpressionOrHigher();
|
|
27914
|
+
var expr = parseAssignmentExpressionOrHigher(true);
|
|
27912
27915
|
var operatorToken;
|
|
27913
27916
|
while ((operatorToken = parseOptionalToken(27))) {
|
|
27914
|
-
expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher(), pos);
|
|
27917
|
+
expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher(true), pos);
|
|
27915
27918
|
}
|
|
27916
27919
|
if (saveDecoratorContext) {
|
|
27917
27920
|
setDecoratorContext(true);
|
|
@@ -27919,25 +27922,25 @@ var ts;
|
|
|
27919
27922
|
return expr;
|
|
27920
27923
|
}
|
|
27921
27924
|
function parseInitializer() {
|
|
27922
|
-
return parseOptional(63) ? parseAssignmentExpressionOrHigher() : undefined;
|
|
27925
|
+
return parseOptional(63) ? parseAssignmentExpressionOrHigher(true) : undefined;
|
|
27923
27926
|
}
|
|
27924
|
-
function parseAssignmentExpressionOrHigher() {
|
|
27927
|
+
function parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction) {
|
|
27925
27928
|
if (isYieldExpression()) {
|
|
27926
27929
|
return parseYieldExpression();
|
|
27927
27930
|
}
|
|
27928
|
-
var arrowExpression = tryParseParenthesizedArrowFunctionExpression() || tryParseAsyncSimpleArrowFunctionExpression();
|
|
27931
|
+
var arrowExpression = tryParseParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) || tryParseAsyncSimpleArrowFunctionExpression(allowReturnTypeInArrowFunction);
|
|
27929
27932
|
if (arrowExpression) {
|
|
27930
27933
|
return arrowExpression;
|
|
27931
27934
|
}
|
|
27932
27935
|
var pos = getNodePos();
|
|
27933
27936
|
var expr = parseBinaryExpressionOrHigher(0);
|
|
27934
27937
|
if (expr.kind === 79 && token() === 38) {
|
|
27935
|
-
return parseSimpleArrowFunctionExpression(pos, expr, undefined);
|
|
27938
|
+
return parseSimpleArrowFunctionExpression(pos, expr, allowReturnTypeInArrowFunction, undefined);
|
|
27936
27939
|
}
|
|
27937
27940
|
if (ts.isLeftHandSideExpression(expr) && ts.isAssignmentOperator(reScanGreaterToken())) {
|
|
27938
|
-
return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher(), pos);
|
|
27941
|
+
return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction), pos);
|
|
27939
27942
|
}
|
|
27940
|
-
return parseConditionalExpressionRest(expr, pos);
|
|
27943
|
+
return parseConditionalExpressionRest(expr, pos, allowReturnTypeInArrowFunction);
|
|
27941
27944
|
}
|
|
27942
27945
|
function isYieldExpression() {
|
|
27943
27946
|
if (token() === 125) {
|
|
@@ -27957,30 +27960,30 @@ var ts;
|
|
|
27957
27960
|
nextToken();
|
|
27958
27961
|
if (!scanner.hasPrecedingLineBreak() &&
|
|
27959
27962
|
(token() === 41 || isStartOfExpression())) {
|
|
27960
|
-
return finishNode(factory.createYieldExpression(parseOptionalToken(41), parseAssignmentExpressionOrHigher()), pos);
|
|
27963
|
+
return finishNode(factory.createYieldExpression(parseOptionalToken(41), parseAssignmentExpressionOrHigher(true)), pos);
|
|
27961
27964
|
}
|
|
27962
27965
|
else {
|
|
27963
27966
|
return finishNode(factory.createYieldExpression(undefined, undefined), pos);
|
|
27964
27967
|
}
|
|
27965
27968
|
}
|
|
27966
|
-
function parseSimpleArrowFunctionExpression(pos, identifier, asyncModifier) {
|
|
27969
|
+
function parseSimpleArrowFunctionExpression(pos, identifier, allowReturnTypeInArrowFunction, asyncModifier) {
|
|
27967
27970
|
ts.Debug.assert(token() === 38, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
|
|
27968
27971
|
var parameter = factory.createParameterDeclaration(undefined, undefined, identifier, undefined, undefined, undefined);
|
|
27969
27972
|
finishNode(parameter, identifier.pos);
|
|
27970
27973
|
var parameters = createNodeArray([parameter], parameter.pos, parameter.end);
|
|
27971
27974
|
var equalsGreaterThanToken = parseExpectedToken(38);
|
|
27972
|
-
var body = parseArrowFunctionExpressionBody(!!asyncModifier);
|
|
27975
|
+
var body = parseArrowFunctionExpressionBody(!!asyncModifier, allowReturnTypeInArrowFunction);
|
|
27973
27976
|
var node = factory.createArrowFunction(asyncModifier, undefined, parameters, undefined, equalsGreaterThanToken, body);
|
|
27974
27977
|
return addJSDocComment(finishNode(node, pos));
|
|
27975
27978
|
}
|
|
27976
|
-
function tryParseParenthesizedArrowFunctionExpression() {
|
|
27979
|
+
function tryParseParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) {
|
|
27977
27980
|
var triState = isParenthesizedArrowFunctionExpression();
|
|
27978
27981
|
if (triState === 0) {
|
|
27979
27982
|
return undefined;
|
|
27980
27983
|
}
|
|
27981
27984
|
return triState === 1 ?
|
|
27982
|
-
parseParenthesizedArrowFunctionExpression(true) :
|
|
27983
|
-
tryParse(parsePossibleParenthesizedArrowFunctionExpression);
|
|
27985
|
+
parseParenthesizedArrowFunctionExpression(true, true) :
|
|
27986
|
+
tryParse(function () { return parsePossibleParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction); });
|
|
27984
27987
|
}
|
|
27985
27988
|
function isParenthesizedArrowFunctionExpression() {
|
|
27986
27989
|
if (token() === 20 || token() === 29 || token() === 131) {
|
|
@@ -28077,24 +28080,24 @@ var ts;
|
|
|
28077
28080
|
return 2;
|
|
28078
28081
|
}
|
|
28079
28082
|
}
|
|
28080
|
-
function parsePossibleParenthesizedArrowFunctionExpression() {
|
|
28083
|
+
function parsePossibleParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) {
|
|
28081
28084
|
var tokenPos = scanner.getTokenPos();
|
|
28082
28085
|
if (notParenthesizedArrow === null || notParenthesizedArrow === void 0 ? void 0 : notParenthesizedArrow.has(tokenPos)) {
|
|
28083
28086
|
return undefined;
|
|
28084
28087
|
}
|
|
28085
|
-
var result = parseParenthesizedArrowFunctionExpression(false);
|
|
28088
|
+
var result = parseParenthesizedArrowFunctionExpression(false, allowReturnTypeInArrowFunction);
|
|
28086
28089
|
if (!result) {
|
|
28087
28090
|
(notParenthesizedArrow || (notParenthesizedArrow = new ts.Set())).add(tokenPos);
|
|
28088
28091
|
}
|
|
28089
28092
|
return result;
|
|
28090
28093
|
}
|
|
28091
|
-
function tryParseAsyncSimpleArrowFunctionExpression() {
|
|
28094
|
+
function tryParseAsyncSimpleArrowFunctionExpression(allowReturnTypeInArrowFunction) {
|
|
28092
28095
|
if (token() === 131) {
|
|
28093
28096
|
if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === 1) {
|
|
28094
28097
|
var pos = getNodePos();
|
|
28095
28098
|
var asyncModifier = parseModifiersForArrowFunction();
|
|
28096
28099
|
var expr = parseBinaryExpressionOrHigher(0);
|
|
28097
|
-
return parseSimpleArrowFunctionExpression(pos, expr, asyncModifier);
|
|
28100
|
+
return parseSimpleArrowFunctionExpression(pos, expr, allowReturnTypeInArrowFunction, asyncModifier);
|
|
28098
28101
|
}
|
|
28099
28102
|
}
|
|
28100
28103
|
return undefined;
|
|
@@ -28112,7 +28115,7 @@ var ts;
|
|
|
28112
28115
|
}
|
|
28113
28116
|
return 0;
|
|
28114
28117
|
}
|
|
28115
|
-
function parseParenthesizedArrowFunctionExpression(allowAmbiguity) {
|
|
28118
|
+
function parseParenthesizedArrowFunctionExpression(allowAmbiguity, allowReturnTypeInArrowFunction) {
|
|
28116
28119
|
var pos = getNodePos();
|
|
28117
28120
|
var hasJSDoc = hasPrecedingJSDocComment();
|
|
28118
28121
|
var modifiers = parseModifiersForArrowFunction();
|
|
@@ -28140,6 +28143,7 @@ var ts;
|
|
|
28140
28143
|
return undefined;
|
|
28141
28144
|
}
|
|
28142
28145
|
}
|
|
28146
|
+
var hasReturnColon = token() === 58;
|
|
28143
28147
|
var type = parseReturnType(58, false);
|
|
28144
28148
|
if (type && !allowAmbiguity && typeHasArrowFunctionBlockingParseError(type)) {
|
|
28145
28149
|
return undefined;
|
|
@@ -28155,12 +28159,17 @@ var ts;
|
|
|
28155
28159
|
var lastToken = token();
|
|
28156
28160
|
var equalsGreaterThanToken = parseExpectedToken(38);
|
|
28157
28161
|
var body = (lastToken === 38 || lastToken === 18)
|
|
28158
|
-
? parseArrowFunctionExpressionBody(ts.some(modifiers, ts.isAsyncModifier))
|
|
28162
|
+
? parseArrowFunctionExpressionBody(ts.some(modifiers, ts.isAsyncModifier), allowReturnTypeInArrowFunction)
|
|
28159
28163
|
: parseIdentifier();
|
|
28164
|
+
if (!allowReturnTypeInArrowFunction && hasReturnColon) {
|
|
28165
|
+
if (token() !== 58) {
|
|
28166
|
+
return undefined;
|
|
28167
|
+
}
|
|
28168
|
+
}
|
|
28160
28169
|
var node = factory.createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body);
|
|
28161
28170
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
28162
28171
|
}
|
|
28163
|
-
function parseArrowFunctionExpressionBody(isAsync) {
|
|
28172
|
+
function parseArrowFunctionExpressionBody(isAsync, allowReturnTypeInArrowFunction) {
|
|
28164
28173
|
if (token() === 18) {
|
|
28165
28174
|
return parseFunctionBlock(isAsync ? 2 : 0);
|
|
28166
28175
|
}
|
|
@@ -28174,19 +28183,19 @@ var ts;
|
|
|
28174
28183
|
var savedTopLevel = topLevel;
|
|
28175
28184
|
topLevel = false;
|
|
28176
28185
|
var node = isAsync
|
|
28177
|
-
? doInAwaitContext(parseAssignmentExpressionOrHigher)
|
|
28178
|
-
: doOutsideOfAwaitContext(parseAssignmentExpressionOrHigher);
|
|
28186
|
+
? doInAwaitContext(function () { return parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction); })
|
|
28187
|
+
: doOutsideOfAwaitContext(function () { return parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction); });
|
|
28179
28188
|
topLevel = savedTopLevel;
|
|
28180
28189
|
return node;
|
|
28181
28190
|
}
|
|
28182
|
-
function parseConditionalExpressionRest(leftOperand, pos) {
|
|
28191
|
+
function parseConditionalExpressionRest(leftOperand, pos, allowReturnTypeInArrowFunction) {
|
|
28183
28192
|
var questionToken = parseOptionalToken(57);
|
|
28184
28193
|
if (!questionToken) {
|
|
28185
28194
|
return leftOperand;
|
|
28186
28195
|
}
|
|
28187
28196
|
var colonToken;
|
|
28188
|
-
return finishNode(factory.createConditionalExpression(leftOperand, questionToken, doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher), colonToken = parseExpectedToken(58), ts.nodeIsPresent(colonToken)
|
|
28189
|
-
? parseAssignmentExpressionOrHigher()
|
|
28197
|
+
return finishNode(factory.createConditionalExpression(leftOperand, questionToken, doOutsideOfContext(disallowInAndDecoratorContext, function () { return parseAssignmentExpressionOrHigher(false); }), colonToken = parseExpectedToken(58), ts.nodeIsPresent(colonToken)
|
|
28198
|
+
? parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction)
|
|
28190
28199
|
: createMissingNode(79, false, ts.Diagnostics._0_expected, ts.tokenToString(58))), pos);
|
|
28191
28200
|
}
|
|
28192
28201
|
function parseBinaryExpressionOrHigher(precedence) {
|
|
@@ -28856,13 +28865,13 @@ var ts;
|
|
|
28856
28865
|
function parseSpreadElement() {
|
|
28857
28866
|
var pos = getNodePos();
|
|
28858
28867
|
parseExpected(25);
|
|
28859
|
-
var expression = parseAssignmentExpressionOrHigher();
|
|
28868
|
+
var expression = parseAssignmentExpressionOrHigher(true);
|
|
28860
28869
|
return finishNode(factory.createSpreadElement(expression), pos);
|
|
28861
28870
|
}
|
|
28862
28871
|
function parseArgumentOrArrayLiteralElement() {
|
|
28863
28872
|
return token() === 25 ? parseSpreadElement() :
|
|
28864
28873
|
token() === 27 ? finishNode(factory.createOmittedExpression(), getNodePos()) :
|
|
28865
|
-
parseAssignmentExpressionOrHigher();
|
|
28874
|
+
parseAssignmentExpressionOrHigher(true);
|
|
28866
28875
|
}
|
|
28867
28876
|
function parseArgumentExpression() {
|
|
28868
28877
|
return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement);
|
|
@@ -28880,7 +28889,7 @@ var ts;
|
|
|
28880
28889
|
var pos = getNodePos();
|
|
28881
28890
|
var hasJSDoc = hasPrecedingJSDocComment();
|
|
28882
28891
|
if (parseOptionalToken(25)) {
|
|
28883
|
-
var expression = parseAssignmentExpressionOrHigher();
|
|
28892
|
+
var expression = parseAssignmentExpressionOrHigher(true);
|
|
28884
28893
|
return withJSDoc(finishNode(factory.createSpreadAssignment(expression), pos), hasJSDoc);
|
|
28885
28894
|
}
|
|
28886
28895
|
var decorators = parseDecorators();
|
|
@@ -28903,13 +28912,13 @@ var ts;
|
|
|
28903
28912
|
var isShorthandPropertyAssignment = tokenIsIdentifier && (token() !== 58);
|
|
28904
28913
|
if (isShorthandPropertyAssignment) {
|
|
28905
28914
|
var equalsToken = parseOptionalToken(63);
|
|
28906
|
-
var objectAssignmentInitializer = equalsToken ? allowInAnd(parseAssignmentExpressionOrHigher) : undefined;
|
|
28915
|
+
var objectAssignmentInitializer = equalsToken ? allowInAnd(function () { return parseAssignmentExpressionOrHigher(true); }) : undefined;
|
|
28907
28916
|
node = factory.createShorthandPropertyAssignment(name, objectAssignmentInitializer);
|
|
28908
28917
|
node.equalsToken = equalsToken;
|
|
28909
28918
|
}
|
|
28910
28919
|
else {
|
|
28911
28920
|
parseExpected(58);
|
|
28912
|
-
var initializer = allowInAnd(parseAssignmentExpressionOrHigher);
|
|
28921
|
+
var initializer = allowInAnd(function () { return parseAssignmentExpressionOrHigher(true); });
|
|
28913
28922
|
node = factory.createPropertyAssignment(name, initializer);
|
|
28914
28923
|
}
|
|
28915
28924
|
node.decorators = decorators;
|
|
@@ -29072,7 +29081,7 @@ var ts;
|
|
|
29072
29081
|
}
|
|
29073
29082
|
var node;
|
|
29074
29083
|
if (awaitToken ? parseExpected(160) : parseOptional(160)) {
|
|
29075
|
-
var expression = allowInAnd(parseAssignmentExpressionOrHigher);
|
|
29084
|
+
var expression = allowInAnd(function () { return parseAssignmentExpressionOrHigher(true); });
|
|
29076
29085
|
parseExpected(21);
|
|
29077
29086
|
node = factory.createForOfStatement(awaitToken, initializer, expression, parseStatement());
|
|
29078
29087
|
}
|
|
@@ -30130,7 +30139,7 @@ var ts;
|
|
|
30130
30139
|
var pos = getNodePos();
|
|
30131
30140
|
var name = ts.tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode(10);
|
|
30132
30141
|
parseExpected(58);
|
|
30133
|
-
var value = parseAssignmentExpressionOrHigher();
|
|
30142
|
+
var value = parseAssignmentExpressionOrHigher(true);
|
|
30134
30143
|
return finishNode(factory.createAssertEntry(name, value), pos);
|
|
30135
30144
|
}
|
|
30136
30145
|
function parseAssertClause(skipAssertKeyword) {
|
|
@@ -30326,7 +30335,7 @@ var ts;
|
|
|
30326
30335
|
else {
|
|
30327
30336
|
parseExpected(88);
|
|
30328
30337
|
}
|
|
30329
|
-
var expression = parseAssignmentExpressionOrHigher();
|
|
30338
|
+
var expression = parseAssignmentExpressionOrHigher(true);
|
|
30330
30339
|
parseSemicolon();
|
|
30331
30340
|
setAwaitContext(savedAwaitContext);
|
|
30332
30341
|
var node = factory.createExportAssignment(modifiers, isExportEquals, expression);
|
|
@@ -71880,10 +71889,35 @@ var ts;
|
|
|
71880
71889
|
return true;
|
|
71881
71890
|
}
|
|
71882
71891
|
function checkAliasSymbol(node) {
|
|
71892
|
+
var _a, _b, _c, _d, _e;
|
|
71883
71893
|
var symbol = getSymbolOfNode(node);
|
|
71884
71894
|
var target = resolveAlias(symbol);
|
|
71885
71895
|
if (target !== unknownSymbol) {
|
|
71886
71896
|
symbol = getMergedSymbol(symbol.exportSymbol || symbol);
|
|
71897
|
+
if (ts.isInJSFile(node) && !(target.flags & 111551) && !ts.isTypeOnlyImportOrExportDeclaration(node)) {
|
|
71898
|
+
var errorNode = ts.isImportOrExportSpecifier(node) ? node.propertyName || node.name :
|
|
71899
|
+
ts.isNamedDeclaration(node) ? node.name :
|
|
71900
|
+
node;
|
|
71901
|
+
ts.Debug.assert(node.kind !== 274);
|
|
71902
|
+
if (node.kind === 275) {
|
|
71903
|
+
var diag = error(errorNode, ts.Diagnostics.Types_cannot_appear_in_export_declarations_in_JavaScript_files);
|
|
71904
|
+
var alreadyExportedSymbol = (_b = (_a = ts.getSourceFileOfNode(node).symbol) === null || _a === void 0 ? void 0 : _a.exports) === null || _b === void 0 ? void 0 : _b.get((node.propertyName || node.name).escapedText);
|
|
71905
|
+
if (alreadyExportedSymbol === target) {
|
|
71906
|
+
var exportingDeclaration = (_c = alreadyExportedSymbol.declarations) === null || _c === void 0 ? void 0 : _c.find(ts.isJSDocNode);
|
|
71907
|
+
if (exportingDeclaration) {
|
|
71908
|
+
ts.addRelatedInfo(diag, ts.createDiagnosticForNode(exportingDeclaration, ts.Diagnostics._0_is_automatically_exported_here, ts.unescapeLeadingUnderscores(alreadyExportedSymbol.escapedName)));
|
|
71909
|
+
}
|
|
71910
|
+
}
|
|
71911
|
+
}
|
|
71912
|
+
else {
|
|
71913
|
+
ts.Debug.assert(node.kind !== 254);
|
|
71914
|
+
var importDeclaration = ts.findAncestor(node, ts.or(ts.isImportDeclaration, ts.isImportEqualsDeclaration));
|
|
71915
|
+
var moduleSpecifier = (_e = (importDeclaration && ((_d = ts.tryGetModuleSpecifierFromDeclaration(importDeclaration)) === null || _d === void 0 ? void 0 : _d.text))) !== null && _e !== void 0 ? _e : "...";
|
|
71916
|
+
var importedIdentifier = ts.unescapeLeadingUnderscores(ts.isIdentifier(errorNode) ? errorNode.escapedText : symbol.escapedName);
|
|
71917
|
+
error(errorNode, ts.Diagnostics._0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation, importedIdentifier, "import(\"" + moduleSpecifier + "\")." + importedIdentifier);
|
|
71918
|
+
}
|
|
71919
|
+
return;
|
|
71920
|
+
}
|
|
71887
71921
|
var excludedMeanings = (symbol.flags & (111551 | 1048576) ? 111551 : 0) |
|
|
71888
71922
|
(symbol.flags & 788968 ? 788968 : 0) |
|
|
71889
71923
|
(symbol.flags & 1920 ? 1920 : 0);
|