typescript 4.3.1-rc → 4.3.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 +94 -92
- package/lib/tsserver.js +161 -128
- package/lib/tsserverlibrary.d.ts +1 -0
- package/lib/tsserverlibrary.js +158 -122
- package/lib/typescript.d.ts +1 -0
- package/lib/typescript.js +157 -119
- package/lib/typescriptServices.d.ts +1 -0
- package/lib/typescriptServices.js +157 -119
- package/lib/typingsInstaller.js +113 -93
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -65,7 +65,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
65
65
|
var ts;
|
|
66
66
|
(function (ts) {
|
|
67
67
|
ts.versionMajorMinor = "4.3";
|
|
68
|
-
ts.version = "4.3.
|
|
68
|
+
ts.version = "4.3.5";
|
|
69
69
|
var NativeCollections;
|
|
70
70
|
(function (NativeCollections) {
|
|
71
71
|
function tryGetNativeMap() {
|
|
@@ -4987,7 +4987,7 @@ var ts;
|
|
|
4987
4987
|
Identifier_expected: diag(1003, ts.DiagnosticCategory.Error, "Identifier_expected_1003", "Identifier expected."),
|
|
4988
4988
|
_0_expected: diag(1005, ts.DiagnosticCategory.Error, "_0_expected_1005", "'{0}' expected."),
|
|
4989
4989
|
A_file_cannot_have_a_reference_to_itself: diag(1006, ts.DiagnosticCategory.Error, "A_file_cannot_have_a_reference_to_itself_1006", "A file cannot have a reference to itself."),
|
|
4990
|
-
|
|
4990
|
+
The_parser_expected_to_find_a_to_match_the_token_here: diag(1007, ts.DiagnosticCategory.Error, "The_parser_expected_to_find_a_to_match_the_token_here_1007", "The parser expected to find a '}' to match the '{' token here."),
|
|
4991
4991
|
Trailing_comma_not_allowed: diag(1009, ts.DiagnosticCategory.Error, "Trailing_comma_not_allowed_1009", "Trailing comma not allowed."),
|
|
4992
4992
|
Asterisk_Slash_expected: diag(1010, ts.DiagnosticCategory.Error, "Asterisk_Slash_expected_1010", "'*/' expected."),
|
|
4993
4993
|
An_element_access_expression_should_take_an_argument: diag(1011, ts.DiagnosticCategory.Error, "An_element_access_expression_should_take_an_argument_1011", "An element access expression should take an argument."),
|
|
@@ -13497,56 +13497,43 @@ var ts;
|
|
|
13497
13497
|
}
|
|
13498
13498
|
return __assign(__assign({}, writer), { writeTrailingSemicolon: function () {
|
|
13499
13499
|
pendingTrailingSemicolon = true;
|
|
13500
|
-
},
|
|
13501
|
-
writeLiteral: function (s) {
|
|
13500
|
+
}, writeLiteral: function (s) {
|
|
13502
13501
|
commitPendingTrailingSemicolon();
|
|
13503
13502
|
writer.writeLiteral(s);
|
|
13504
|
-
},
|
|
13505
|
-
writeStringLiteral: function (s) {
|
|
13503
|
+
}, writeStringLiteral: function (s) {
|
|
13506
13504
|
commitPendingTrailingSemicolon();
|
|
13507
13505
|
writer.writeStringLiteral(s);
|
|
13508
|
-
},
|
|
13509
|
-
writeSymbol: function (s, sym) {
|
|
13506
|
+
}, writeSymbol: function (s, sym) {
|
|
13510
13507
|
commitPendingTrailingSemicolon();
|
|
13511
13508
|
writer.writeSymbol(s, sym);
|
|
13512
|
-
},
|
|
13513
|
-
writePunctuation: function (s) {
|
|
13509
|
+
}, writePunctuation: function (s) {
|
|
13514
13510
|
commitPendingTrailingSemicolon();
|
|
13515
13511
|
writer.writePunctuation(s);
|
|
13516
|
-
},
|
|
13517
|
-
writeKeyword: function (s) {
|
|
13512
|
+
}, writeKeyword: function (s) {
|
|
13518
13513
|
commitPendingTrailingSemicolon();
|
|
13519
13514
|
writer.writeKeyword(s);
|
|
13520
|
-
},
|
|
13521
|
-
writeOperator: function (s) {
|
|
13515
|
+
}, writeOperator: function (s) {
|
|
13522
13516
|
commitPendingTrailingSemicolon();
|
|
13523
13517
|
writer.writeOperator(s);
|
|
13524
|
-
},
|
|
13525
|
-
writeParameter: function (s) {
|
|
13518
|
+
}, writeParameter: function (s) {
|
|
13526
13519
|
commitPendingTrailingSemicolon();
|
|
13527
13520
|
writer.writeParameter(s);
|
|
13528
|
-
},
|
|
13529
|
-
writeSpace: function (s) {
|
|
13521
|
+
}, writeSpace: function (s) {
|
|
13530
13522
|
commitPendingTrailingSemicolon();
|
|
13531
13523
|
writer.writeSpace(s);
|
|
13532
|
-
},
|
|
13533
|
-
writeProperty: function (s) {
|
|
13524
|
+
}, writeProperty: function (s) {
|
|
13534
13525
|
commitPendingTrailingSemicolon();
|
|
13535
13526
|
writer.writeProperty(s);
|
|
13536
|
-
},
|
|
13537
|
-
writeComment: function (s) {
|
|
13527
|
+
}, writeComment: function (s) {
|
|
13538
13528
|
commitPendingTrailingSemicolon();
|
|
13539
13529
|
writer.writeComment(s);
|
|
13540
|
-
},
|
|
13541
|
-
writeLine: function () {
|
|
13530
|
+
}, writeLine: function () {
|
|
13542
13531
|
commitPendingTrailingSemicolon();
|
|
13543
13532
|
writer.writeLine();
|
|
13544
|
-
},
|
|
13545
|
-
increaseIndent: function () {
|
|
13533
|
+
}, increaseIndent: function () {
|
|
13546
13534
|
commitPendingTrailingSemicolon();
|
|
13547
13535
|
writer.increaseIndent();
|
|
13548
|
-
},
|
|
13549
|
-
decreaseIndent: function () {
|
|
13536
|
+
}, decreaseIndent: function () {
|
|
13550
13537
|
commitPendingTrailingSemicolon();
|
|
13551
13538
|
writer.decreaseIndent();
|
|
13552
13539
|
} });
|
|
@@ -23614,8 +23601,8 @@ var ts;
|
|
|
23614
23601
|
visitNode(cbNode, node.typeExpression) ||
|
|
23615
23602
|
(typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment))
|
|
23616
23603
|
: visitNode(cbNode, node.typeExpression) ||
|
|
23617
|
-
visitNode(cbNode, node.name)
|
|
23618
|
-
|
|
23604
|
+
visitNode(cbNode, node.name) ||
|
|
23605
|
+
(typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment)));
|
|
23619
23606
|
case 320:
|
|
23620
23607
|
return visitNode(cbNode, node.tagName) ||
|
|
23621
23608
|
(typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment));
|
|
@@ -24209,20 +24196,17 @@ var ts;
|
|
|
24209
24196
|
return inContext(32768);
|
|
24210
24197
|
}
|
|
24211
24198
|
function parseErrorAtCurrentToken(message, arg0) {
|
|
24212
|
-
|
|
24199
|
+
parseErrorAt(scanner.getTokenPos(), scanner.getTextPos(), message, arg0);
|
|
24213
24200
|
}
|
|
24214
24201
|
function parseErrorAtPosition(start, length, message, arg0) {
|
|
24215
24202
|
var lastError = ts.lastOrUndefined(parseDiagnostics);
|
|
24216
|
-
var result;
|
|
24217
24203
|
if (!lastError || start !== lastError.start) {
|
|
24218
|
-
|
|
24219
|
-
parseDiagnostics.push(result);
|
|
24204
|
+
parseDiagnostics.push(ts.createDetachedDiagnostic(fileName, start, length, message, arg0));
|
|
24220
24205
|
}
|
|
24221
24206
|
parseErrorBeforeNextFinishedNode = true;
|
|
24222
|
-
return result;
|
|
24223
24207
|
}
|
|
24224
24208
|
function parseErrorAt(start, end, message, arg0) {
|
|
24225
|
-
|
|
24209
|
+
parseErrorAtPosition(start, end - start, message, arg0);
|
|
24226
24210
|
}
|
|
24227
24211
|
function parseErrorAtRange(range, message, arg0) {
|
|
24228
24212
|
parseErrorAt(range.pos, range.end, message, arg0);
|
|
@@ -24345,16 +24329,6 @@ var ts;
|
|
|
24345
24329
|
parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(kind));
|
|
24346
24330
|
return false;
|
|
24347
24331
|
}
|
|
24348
|
-
function parseExpectedMatchingBrackets(openKind, closeKind, openPosition) {
|
|
24349
|
-
if (token() === closeKind) {
|
|
24350
|
-
nextToken();
|
|
24351
|
-
return;
|
|
24352
|
-
}
|
|
24353
|
-
var lastError = parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(closeKind));
|
|
24354
|
-
if (lastError) {
|
|
24355
|
-
ts.addRelatedInfo(lastError, ts.createDetachedDiagnostic(fileName, openPosition, 1, ts.Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, ts.tokenToString(openKind), ts.tokenToString(closeKind)));
|
|
24356
|
-
}
|
|
24357
|
-
}
|
|
24358
24332
|
function parseOptional(t) {
|
|
24359
24333
|
if (token() === t) {
|
|
24360
24334
|
nextToken();
|
|
@@ -26976,11 +26950,10 @@ var ts;
|
|
|
26976
26950
|
}
|
|
26977
26951
|
function parseArrayLiteralExpression() {
|
|
26978
26952
|
var pos = getNodePos();
|
|
26979
|
-
var openBracketPosition = scanner.getTokenPos();
|
|
26980
26953
|
parseExpected(22);
|
|
26981
26954
|
var multiLine = scanner.hasPrecedingLineBreak();
|
|
26982
26955
|
var elements = parseDelimitedList(15, parseArgumentOrArrayLiteralElement);
|
|
26983
|
-
|
|
26956
|
+
parseExpected(23);
|
|
26984
26957
|
return finishNode(factory.createArrayLiteralExpression(elements, multiLine), pos);
|
|
26985
26958
|
}
|
|
26986
26959
|
function parseObjectLiteralElement() {
|
|
@@ -27031,7 +27004,12 @@ var ts;
|
|
|
27031
27004
|
parseExpected(18);
|
|
27032
27005
|
var multiLine = scanner.hasPrecedingLineBreak();
|
|
27033
27006
|
var properties = parseDelimitedList(12, parseObjectLiteralElement, true);
|
|
27034
|
-
|
|
27007
|
+
if (!parseExpected(19)) {
|
|
27008
|
+
var lastError = ts.lastOrUndefined(parseDiagnostics);
|
|
27009
|
+
if (lastError && lastError.code === ts.Diagnostics._0_expected.code) {
|
|
27010
|
+
ts.addRelatedInfo(lastError, ts.createDetachedDiagnostic(fileName, openBracePosition, 1, ts.Diagnostics.The_parser_expected_to_find_a_to_match_the_token_here));
|
|
27011
|
+
}
|
|
27012
|
+
}
|
|
27035
27013
|
return finishNode(factory.createObjectLiteralExpression(properties, multiLine), pos);
|
|
27036
27014
|
}
|
|
27037
27015
|
function parseFunctionExpression() {
|
|
@@ -27099,7 +27077,12 @@ var ts;
|
|
|
27099
27077
|
if (parseExpected(18, diagnosticMessage) || ignoreMissingOpenBrace) {
|
|
27100
27078
|
var multiLine = scanner.hasPrecedingLineBreak();
|
|
27101
27079
|
var statements = parseList(1, parseStatement);
|
|
27102
|
-
|
|
27080
|
+
if (!parseExpected(19)) {
|
|
27081
|
+
var lastError = ts.lastOrUndefined(parseDiagnostics);
|
|
27082
|
+
if (lastError && lastError.code === ts.Diagnostics._0_expected.code) {
|
|
27083
|
+
ts.addRelatedInfo(lastError, ts.createDetachedDiagnostic(fileName, openBracePosition, 1, ts.Diagnostics.The_parser_expected_to_find_a_to_match_the_token_here));
|
|
27084
|
+
}
|
|
27085
|
+
}
|
|
27103
27086
|
var result = withJSDoc(finishNode(factory.createBlock(statements, multiLine), pos), hasJSDoc);
|
|
27104
27087
|
if (token() === 62) {
|
|
27105
27088
|
parseErrorAtCurrentToken(ts.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_the_whole_assignment_in_parentheses);
|
|
@@ -27142,10 +27125,9 @@ var ts;
|
|
|
27142
27125
|
var pos = getNodePos();
|
|
27143
27126
|
var hasJSDoc = hasPrecedingJSDocComment();
|
|
27144
27127
|
parseExpected(98);
|
|
27145
|
-
var openParenPosition = scanner.getTokenPos();
|
|
27146
27128
|
parseExpected(20);
|
|
27147
27129
|
var expression = allowInAnd(parseExpression);
|
|
27148
|
-
|
|
27130
|
+
parseExpected(21);
|
|
27149
27131
|
var thenStatement = parseStatement();
|
|
27150
27132
|
var elseStatement = parseOptional(90) ? parseStatement() : undefined;
|
|
27151
27133
|
return withJSDoc(finishNode(factory.createIfStatement(expression, thenStatement, elseStatement), pos), hasJSDoc);
|
|
@@ -27156,10 +27138,9 @@ var ts;
|
|
|
27156
27138
|
parseExpected(89);
|
|
27157
27139
|
var statement = parseStatement();
|
|
27158
27140
|
parseExpected(114);
|
|
27159
|
-
var openParenPosition = scanner.getTokenPos();
|
|
27160
27141
|
parseExpected(20);
|
|
27161
27142
|
var expression = allowInAnd(parseExpression);
|
|
27162
|
-
|
|
27143
|
+
parseExpected(21);
|
|
27163
27144
|
parseOptional(26);
|
|
27164
27145
|
return withJSDoc(finishNode(factory.createDoStatement(statement, expression), pos), hasJSDoc);
|
|
27165
27146
|
}
|
|
@@ -27167,10 +27148,9 @@ var ts;
|
|
|
27167
27148
|
var pos = getNodePos();
|
|
27168
27149
|
var hasJSDoc = hasPrecedingJSDocComment();
|
|
27169
27150
|
parseExpected(114);
|
|
27170
|
-
var openParenPosition = scanner.getTokenPos();
|
|
27171
27151
|
parseExpected(20);
|
|
27172
27152
|
var expression = allowInAnd(parseExpression);
|
|
27173
|
-
|
|
27153
|
+
parseExpected(21);
|
|
27174
27154
|
var statement = parseStatement();
|
|
27175
27155
|
return withJSDoc(finishNode(factory.createWhileStatement(expression, statement), pos), hasJSDoc);
|
|
27176
27156
|
}
|
|
@@ -27237,10 +27217,9 @@ var ts;
|
|
|
27237
27217
|
var pos = getNodePos();
|
|
27238
27218
|
var hasJSDoc = hasPrecedingJSDocComment();
|
|
27239
27219
|
parseExpected(115);
|
|
27240
|
-
var openParenPosition = scanner.getTokenPos();
|
|
27241
27220
|
parseExpected(20);
|
|
27242
27221
|
var expression = allowInAnd(parseExpression);
|
|
27243
|
-
|
|
27222
|
+
parseExpected(21);
|
|
27244
27223
|
var statement = doInsideOfContext(16777216, parseStatement);
|
|
27245
27224
|
return withJSDoc(finishNode(factory.createWithStatement(expression, statement), pos), hasJSDoc);
|
|
27246
27225
|
}
|
|
@@ -28988,7 +28967,8 @@ var ts;
|
|
|
28988
28967
|
hasChildren = true;
|
|
28989
28968
|
if (child.kind === 333) {
|
|
28990
28969
|
if (childTypeTag) {
|
|
28991
|
-
|
|
28970
|
+
parseErrorAtCurrentToken(ts.Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);
|
|
28971
|
+
var lastError = ts.lastOrUndefined(parseDiagnostics);
|
|
28992
28972
|
if (lastError) {
|
|
28993
28973
|
ts.addRelatedInfo(lastError, ts.createDetachedDiagnostic(fileName, 0, 0, ts.Diagnostics.The_tag_was_first_specified_here));
|
|
28994
28974
|
}
|
|
@@ -32864,9 +32844,7 @@ var ts;
|
|
|
32864
32844
|
var preDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap || (directoryToModuleNameMap = createCacheWithRedirects(options)));
|
|
32865
32845
|
moduleNameToDirectoryMap || (moduleNameToDirectoryMap = createCacheWithRedirects(options));
|
|
32866
32846
|
var packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName);
|
|
32867
|
-
return __assign(__assign(__assign({}, packageJsonInfoCache), preDirectoryResolutionCache), { getOrCreateCacheForModuleName: getOrCreateCacheForModuleName,
|
|
32868
|
-
clear: clear,
|
|
32869
|
-
update: update, getPackageJsonInfoCache: function () { return packageJsonInfoCache; } });
|
|
32847
|
+
return __assign(__assign(__assign({}, packageJsonInfoCache), preDirectoryResolutionCache), { getOrCreateCacheForModuleName: getOrCreateCacheForModuleName, clear: clear, update: update, getPackageJsonInfoCache: function () { return packageJsonInfoCache; } });
|
|
32870
32848
|
function clear() {
|
|
32871
32849
|
preDirectoryResolutionCache.clear();
|
|
32872
32850
|
moduleNameToDirectoryMap.clear();
|
|
@@ -46288,6 +46266,10 @@ var ts;
|
|
|
46288
46266
|
var indexSymbol = symbol && getIndexSymbol(symbol);
|
|
46289
46267
|
return indexSymbol && getIndexDeclarationOfIndexSymbol(indexSymbol, kind);
|
|
46290
46268
|
}
|
|
46269
|
+
function getIndexDeclarationOfSymbolTable(symbolTable, kind) {
|
|
46270
|
+
var indexSymbol = symbolTable && getIndexSymbolFromSymbolTable(symbolTable);
|
|
46271
|
+
return indexSymbol && getIndexDeclarationOfIndexSymbol(indexSymbol, kind);
|
|
46272
|
+
}
|
|
46291
46273
|
function getIndexDeclarationOfIndexSymbol(indexSymbol, kind) {
|
|
46292
46274
|
var syntaxKind = kind === 1 ? 144 : 147;
|
|
46293
46275
|
if (indexSymbol === null || indexSymbol === void 0 ? void 0 : indexSymbol.declarations) {
|
|
@@ -49125,8 +49107,7 @@ var ts;
|
|
|
49125
49107
|
return type;
|
|
49126
49108
|
}
|
|
49127
49109
|
function maybeTypeParameterReference(node) {
|
|
49128
|
-
return !(node.kind ===
|
|
49129
|
-
node.parent.kind === 174 && node.parent.typeArguments && node === node.parent.typeName ||
|
|
49110
|
+
return !(node.parent.kind === 174 && node.parent.typeArguments && node === node.parent.typeName ||
|
|
49130
49111
|
node.parent.kind === 196 && node.parent.typeArguments && node === node.parent.qualifier);
|
|
49131
49112
|
}
|
|
49132
49113
|
function isTypeParameterPossiblyReferenced(tp, node) {
|
|
@@ -49151,7 +49132,10 @@ var ts;
|
|
|
49151
49132
|
return true;
|
|
49152
49133
|
case 166:
|
|
49153
49134
|
case 165:
|
|
49154
|
-
return
|
|
49135
|
+
return !node.type && !!node.body ||
|
|
49136
|
+
ts.some(node.typeParameters, containsReference) ||
|
|
49137
|
+
ts.some(node.parameters, containsReference) ||
|
|
49138
|
+
!!node.type && containsReference(node.type);
|
|
49155
49139
|
}
|
|
49156
49140
|
return !!ts.forEachChild(node, containsReference);
|
|
49157
49141
|
}
|
|
@@ -52621,13 +52605,13 @@ var ts;
|
|
|
52621
52605
|
return type.flags & 32768 ? type : getUnionType([type, undefinedType]);
|
|
52622
52606
|
}
|
|
52623
52607
|
function getGlobalNonNullableTypeInstantiation(type) {
|
|
52608
|
+
var reducedType = getTypeWithFacts(type, 2097152);
|
|
52624
52609
|
if (!deferredGlobalNonNullableTypeAlias) {
|
|
52625
52610
|
deferredGlobalNonNullableTypeAlias = getGlobalSymbol("NonNullable", 524288, undefined) || unknownSymbol;
|
|
52626
52611
|
}
|
|
52627
|
-
|
|
52628
|
-
|
|
52629
|
-
|
|
52630
|
-
return getTypeWithFacts(type, 2097152);
|
|
52612
|
+
return deferredGlobalNonNullableTypeAlias !== unknownSymbol ?
|
|
52613
|
+
getTypeAliasInstantiation(deferredGlobalNonNullableTypeAlias, [reducedType]) :
|
|
52614
|
+
reducedType;
|
|
52631
52615
|
}
|
|
52632
52616
|
function getNonNullableType(type) {
|
|
52633
52617
|
return strictNullChecks ? getGlobalNonNullableTypeInstantiation(type) : type;
|
|
@@ -53782,12 +53766,13 @@ var ts;
|
|
|
53782
53766
|
applyToReturnTypes(source, target, inferFromTypes);
|
|
53783
53767
|
}
|
|
53784
53768
|
function inferFromIndexTypes(source, target) {
|
|
53769
|
+
var priority = (ts.getObjectFlags(source) & ts.getObjectFlags(target) & 32) ? 8 : 0;
|
|
53785
53770
|
var targetStringIndexType = getIndexTypeOfType(target, 0);
|
|
53786
53771
|
if (targetStringIndexType) {
|
|
53787
53772
|
var sourceIndexType = getIndexTypeOfType(source, 0) ||
|
|
53788
53773
|
getImplicitIndexTypeOfType(source, 0);
|
|
53789
53774
|
if (sourceIndexType) {
|
|
53790
|
-
|
|
53775
|
+
inferWithPriority(sourceIndexType, targetStringIndexType, priority);
|
|
53791
53776
|
}
|
|
53792
53777
|
}
|
|
53793
53778
|
var targetNumberIndexType = getIndexTypeOfType(target, 1);
|
|
@@ -53796,7 +53781,7 @@ var ts;
|
|
|
53796
53781
|
getIndexTypeOfType(source, 0) ||
|
|
53797
53782
|
getImplicitIndexTypeOfType(source, 1);
|
|
53798
53783
|
if (sourceIndexType) {
|
|
53799
|
-
|
|
53784
|
+
inferWithPriority(sourceIndexType, targetNumberIndexType, priority);
|
|
53800
53785
|
}
|
|
53801
53786
|
}
|
|
53802
53787
|
}
|
|
@@ -55764,7 +55749,7 @@ var ts;
|
|
|
55764
55749
|
!isGenericIndexType(getTypeOfExpression(parent.argumentExpression));
|
|
55765
55750
|
}
|
|
55766
55751
|
function isGenericTypeWithUnionConstraint(type) {
|
|
55767
|
-
return !!(type.flags & 465829888 && getBaseConstraintOrType(type).flags & 1048576);
|
|
55752
|
+
return !!(type.flags & 465829888 && getBaseConstraintOrType(type).flags & (98304 | 1048576));
|
|
55768
55753
|
}
|
|
55769
55754
|
function containsGenericType(type) {
|
|
55770
55755
|
return !!(type.flags & 465829888 || type.flags & 3145728 && ts.some(type.types, containsGenericType));
|
|
@@ -65466,21 +65451,24 @@ var ts;
|
|
|
65466
65451
|
checkBlock(node.finallyBlock);
|
|
65467
65452
|
}
|
|
65468
65453
|
}
|
|
65469
|
-
function checkIndexConstraints(type) {
|
|
65470
|
-
var
|
|
65471
|
-
var
|
|
65454
|
+
function checkIndexConstraints(type, isStatic) {
|
|
65455
|
+
var _a, _b, _c, _d;
|
|
65456
|
+
var declaredNumberIndexer = getIndexDeclarationOfSymbolTable(isStatic ? (_a = type.symbol) === null || _a === void 0 ? void 0 : _a.exports : (_b = type.symbol) === null || _b === void 0 ? void 0 : _b.members, 1);
|
|
65457
|
+
var declaredStringIndexer = getIndexDeclarationOfSymbolTable(isStatic ? (_c = type.symbol) === null || _c === void 0 ? void 0 : _c.exports : (_d = type.symbol) === null || _d === void 0 ? void 0 : _d.members, 0);
|
|
65472
65458
|
var stringIndexType = getIndexTypeOfType(type, 0);
|
|
65473
65459
|
var numberIndexType = getIndexTypeOfType(type, 1);
|
|
65474
65460
|
if (stringIndexType || numberIndexType) {
|
|
65475
65461
|
ts.forEach(getPropertiesOfObjectType(type), function (prop) {
|
|
65462
|
+
if (isStatic && prop.flags & 4194304)
|
|
65463
|
+
return;
|
|
65476
65464
|
var propType = getTypeOfSymbol(prop);
|
|
65477
65465
|
checkIndexConstraintForProperty(prop, propType, type, declaredStringIndexer, stringIndexType, 0);
|
|
65478
65466
|
checkIndexConstraintForProperty(prop, propType, type, declaredNumberIndexer, numberIndexType, 1);
|
|
65479
65467
|
});
|
|
65480
65468
|
var classDeclaration = type.symbol.valueDeclaration;
|
|
65481
65469
|
if (ts.getObjectFlags(type) & 1 && classDeclaration && ts.isClassLike(classDeclaration)) {
|
|
65482
|
-
for (var _i = 0,
|
|
65483
|
-
var member =
|
|
65470
|
+
for (var _i = 0, _e = classDeclaration.members; _i < _e.length; _i++) {
|
|
65471
|
+
var member = _e[_i];
|
|
65484
65472
|
if (!ts.hasSyntacticModifier(member, 32) && !hasBindableName(member)) {
|
|
65485
65473
|
var symbol = getSymbolOfNode(member);
|
|
65486
65474
|
var propType = getTypeOfSymbol(symbol);
|
|
@@ -65774,7 +65762,7 @@ var ts;
|
|
|
65774
65762
|
}
|
|
65775
65763
|
if (produceDiagnostics) {
|
|
65776
65764
|
checkIndexConstraints(type);
|
|
65777
|
-
checkIndexConstraints(staticType);
|
|
65765
|
+
checkIndexConstraints(staticType, true);
|
|
65778
65766
|
checkTypeForDuplicateIndexSignatures(node);
|
|
65779
65767
|
checkPropertyInitialization(node);
|
|
65780
65768
|
}
|
|
@@ -72176,6 +72164,7 @@ var ts;
|
|
|
72176
72164
|
case 120:
|
|
72177
72165
|
case 121:
|
|
72178
72166
|
case 125:
|
|
72167
|
+
case 156:
|
|
72179
72168
|
case 84:
|
|
72180
72169
|
case 133:
|
|
72181
72170
|
case 142:
|
|
@@ -73991,16 +73980,20 @@ var ts;
|
|
|
73991
73980
|
return ts.visitEachChild(node, visitor, context);
|
|
73992
73981
|
}
|
|
73993
73982
|
var staticProperties = ts.getProperties(node, false, true);
|
|
73983
|
+
var pendingPrivateStateAssignment;
|
|
73994
73984
|
if (shouldTransformPrivateElements && ts.some(node.members, function (m) { return ts.hasStaticModifier(m) && !!m.name && ts.isPrivateIdentifier(m.name); })) {
|
|
73995
73985
|
var temp = factory.createTempVariable(hoistVariableDeclaration, true);
|
|
73996
73986
|
getPrivateIdentifierEnvironment().classConstructor = factory.cloneNode(temp);
|
|
73997
|
-
|
|
73987
|
+
pendingPrivateStateAssignment = factory.createAssignment(temp, factory.getInternalName(node));
|
|
73998
73988
|
}
|
|
73999
73989
|
var extendsClauseElement = ts.getEffectiveBaseTypeNode(node);
|
|
74000
73990
|
var isDerivedClass = !!(extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 103);
|
|
74001
73991
|
var statements = [
|
|
74002
73992
|
factory.updateClassDeclaration(node, undefined, node.modifiers, node.name, undefined, ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), transformClassMembers(node, isDerivedClass))
|
|
74003
73993
|
];
|
|
73994
|
+
if (pendingPrivateStateAssignment) {
|
|
73995
|
+
getPendingExpressions().unshift(pendingPrivateStateAssignment);
|
|
73996
|
+
}
|
|
74004
73997
|
if (ts.some(pendingExpressions)) {
|
|
74005
73998
|
statements.push(factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions)));
|
|
74006
73999
|
}
|
|
@@ -87987,11 +87980,14 @@ var ts;
|
|
|
87987
87980
|
if (nextNode.kind === 11) {
|
|
87988
87981
|
return 0;
|
|
87989
87982
|
}
|
|
87990
|
-
else if (
|
|
87991
|
-
|
|
87992
|
-
|
|
87993
|
-
|
|
87994
|
-
|
|
87983
|
+
else if (!ts.nodeIsSynthesized(previousNode) && !ts.nodeIsSynthesized(nextNode)) {
|
|
87984
|
+
if (preserveSourceNewlines && siblingNodePositionsAreComparable(previousNode, nextNode)) {
|
|
87985
|
+
return getEffectiveLines(function (includeComments) { return ts.getLinesBetweenRangeEndAndRangeStart(previousNode, nextNode, currentSourceFile, includeComments); });
|
|
87986
|
+
}
|
|
87987
|
+
else if (!preserveSourceNewlines && originalNodesHaveSameParent(previousNode, nextNode)) {
|
|
87988
|
+
return ts.rangeEndIsOnSameLineAsRangeStart(previousNode, nextNode, currentSourceFile) ? 0 : 1;
|
|
87989
|
+
}
|
|
87990
|
+
return format & 65536 ? 1 : 0;
|
|
87995
87991
|
}
|
|
87996
87992
|
else if (synthesizedNodeStartsOnNewLine(previousNode, format) || synthesizedNodeStartsOnNewLine(nextNode, format)) {
|
|
87997
87993
|
return 1;
|
|
@@ -88537,10 +88533,11 @@ var ts;
|
|
|
88537
88533
|
}
|
|
88538
88534
|
exitComment();
|
|
88539
88535
|
}
|
|
88536
|
+
function originalNodesHaveSameParent(nodeA, nodeB) {
|
|
88537
|
+
nodeA = ts.getOriginalNode(nodeA);
|
|
88538
|
+
return nodeA.parent && nodeA.parent === ts.getOriginalNode(nodeB).parent;
|
|
88539
|
+
}
|
|
88540
88540
|
function siblingNodePositionsAreComparable(previousNode, nextNode) {
|
|
88541
|
-
if (ts.nodeIsSynthesized(previousNode) || ts.nodeIsSynthesized(nextNode)) {
|
|
88542
|
-
return false;
|
|
88543
|
-
}
|
|
88544
88541
|
if (nextNode.pos < previousNode.end) {
|
|
88545
88542
|
return false;
|
|
88546
88543
|
}
|
|
@@ -93176,8 +93173,11 @@ var ts;
|
|
|
93176
93173
|
var optionsNameMap = ts.getOptionsNameMap().optionsNameMap;
|
|
93177
93174
|
for (var _i = 0, _a = ts.getOwnKeys(options).sort(ts.compareStringsCaseSensitive); _i < _a.length; _i++) {
|
|
93178
93175
|
var name = _a[_i];
|
|
93179
|
-
var
|
|
93180
|
-
|
|
93176
|
+
var optionKey = name.toLowerCase();
|
|
93177
|
+
var optionInfo = optionsNameMap.get(optionKey);
|
|
93178
|
+
if ((optionInfo === null || optionInfo === void 0 ? void 0 : optionInfo.affectsEmit) || (optionInfo === null || optionInfo === void 0 ? void 0 : optionInfo.affectsSemanticDiagnostics) ||
|
|
93179
|
+
optionKey === "strict" ||
|
|
93180
|
+
optionKey === "skiplibcheck" || optionKey === "skipdefaultlibcheck") {
|
|
93181
93181
|
(result || (result = {}))[name] = convertToReusableCompilerOptionValue(optionInfo, options[name], relativeToBuildInfo);
|
|
93182
93182
|
}
|
|
93183
93183
|
}
|
|
@@ -96292,7 +96292,7 @@ var ts;
|
|
|
96292
96292
|
},
|
|
96293
96293
|
emit: function (targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) {
|
|
96294
96294
|
if (targetSourceFile || emitOnlyDtsFiles) {
|
|
96295
|
-
return withProgramOrUndefined(function (program) { return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); });
|
|
96295
|
+
return withProgramOrUndefined(function (program) { var _a, _b; return program.emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project))); });
|
|
96296
96296
|
}
|
|
96297
96297
|
executeSteps(BuildStep.SemanticDiagnostics, cancellationToken);
|
|
96298
96298
|
if (step === BuildStep.EmitBuildInfo) {
|
|
@@ -96374,13 +96374,14 @@ var ts;
|
|
|
96374
96374
|
}
|
|
96375
96375
|
function emit(writeFileCallback, cancellationToken, customTransformers) {
|
|
96376
96376
|
var _a;
|
|
96377
|
+
var _b, _c;
|
|
96377
96378
|
ts.Debug.assertIsDefined(program);
|
|
96378
96379
|
ts.Debug.assert(step === BuildStep.Emit);
|
|
96379
96380
|
program.backupState();
|
|
96380
96381
|
var declDiagnostics;
|
|
96381
96382
|
var reportDeclarationDiagnostics = function (d) { return (declDiagnostics || (declDiagnostics = [])).push(d); };
|
|
96382
96383
|
var outputFiles = [];
|
|
96383
|
-
var emitResult = ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics, undefined, undefined, function (name, text, writeByteOrderMark) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }, cancellationToken, false, customTransformers).emitResult;
|
|
96384
|
+
var emitResult = ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics, undefined, undefined, function (name, text, writeByteOrderMark) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark }); }, cancellationToken, false, customTransformers || ((_c = (_b = state.host).getCustomTransformers) === null || _c === void 0 ? void 0 : _c.call(_b, project))).emitResult;
|
|
96384
96385
|
if (declDiagnostics) {
|
|
96385
96386
|
program.restoreState();
|
|
96386
96387
|
(_a = buildErrors(state, projectPath, program, config, declDiagnostics, BuildResultFlags.DeclarationEmitErrors, "Declaration file"), buildResult = _a.buildResult, step = _a.step);
|
|
@@ -96457,6 +96458,7 @@ var ts;
|
|
|
96457
96458
|
return emitDiagnostics;
|
|
96458
96459
|
}
|
|
96459
96460
|
function emitBundle(writeFileCallback, customTransformers) {
|
|
96461
|
+
var _a, _b;
|
|
96460
96462
|
ts.Debug.assert(kind === InvalidatedProjectKind.UpdateBundle);
|
|
96461
96463
|
if (state.options.dry) {
|
|
96462
96464
|
reportStatus(state, ts.Diagnostics.A_non_dry_build_would_update_output_of_project_0, project);
|
|
@@ -96471,7 +96473,7 @@ var ts;
|
|
|
96471
96473
|
var outputFiles = ts.emitUsingBuildInfo(config, compilerHost, function (ref) {
|
|
96472
96474
|
var refName = resolveProjectName(state, ref.path);
|
|
96473
96475
|
return parseConfigFile(state, refName, toResolvedConfigFilePath(state, refName));
|
|
96474
|
-
}, customTransformers);
|
|
96476
|
+
}, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project)));
|
|
96475
96477
|
if (ts.isString(outputFiles)) {
|
|
96476
96478
|
reportStatus(state, ts.Diagnostics.Cannot_update_output_of_project_0_because_there_was_error_reading_file_1, project, relName(state, outputFiles));
|
|
96477
96479
|
step = BuildStep.BuildInvalidatedProjectOfBundle;
|