typescript 5.6.0-dev.20240807 → 5.6.0-dev.20240809
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 +122 -90
- package/lib/typescript.js +186 -125
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.6";
|
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20240809`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -21271,7 +21271,11 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
21271
21271
|
node.modifiers = asNodeArray(modifiers);
|
|
21272
21272
|
node.parameters = createNodeArray(parameters);
|
|
21273
21273
|
node.body = body;
|
|
21274
|
-
|
|
21274
|
+
if (!node.body) {
|
|
21275
|
+
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
21276
|
+
} else {
|
|
21277
|
+
node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | 1024 /* ContainsES2015 */;
|
|
21278
|
+
}
|
|
21275
21279
|
node.typeParameters = void 0;
|
|
21276
21280
|
node.type = void 0;
|
|
21277
21281
|
node.typeArguments = void 0;
|
|
@@ -25405,7 +25409,7 @@ var asyncGeneratorHelper = {
|
|
|
25405
25409
|
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
|
25406
25410
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
25407
25411
|
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
25408
|
-
return i =
|
|
25412
|
+
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
25409
25413
|
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
|
|
25410
25414
|
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
|
|
25411
25415
|
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
@@ -25587,8 +25591,8 @@ var generatorHelper = {
|
|
|
25587
25591
|
priority: 6,
|
|
25588
25592
|
text: `
|
|
25589
25593
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
25590
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
25591
|
-
return g =
|
|
25594
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
25595
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25592
25596
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25593
25597
|
function step(op) {
|
|
25594
25598
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -49357,6 +49361,7 @@ function createTypeChecker(host) {
|
|
|
49357
49361
|
}
|
|
49358
49362
|
function symbolToString(symbol, enclosingDeclaration, meaning, flags = 4 /* AllowAnyNodeKind */, writer) {
|
|
49359
49363
|
let nodeFlags = 70221824 /* IgnoreErrors */;
|
|
49364
|
+
let internalNodeFlags = 0 /* None */;
|
|
49360
49365
|
if (flags & 2 /* UseOnlyExternalAliasing */) {
|
|
49361
49366
|
nodeFlags |= 128 /* UseOnlyExternalAliasing */;
|
|
49362
49367
|
}
|
|
@@ -49367,15 +49372,15 @@ function createTypeChecker(host) {
|
|
|
49367
49372
|
nodeFlags |= 16384 /* UseAliasDefinedOutsideCurrentScope */;
|
|
49368
49373
|
}
|
|
49369
49374
|
if (flags & 32 /* DoNotIncludeSymbolChain */) {
|
|
49370
|
-
|
|
49375
|
+
internalNodeFlags |= 4 /* DoNotIncludeSymbolChain */;
|
|
49371
49376
|
}
|
|
49372
49377
|
if (flags & 16 /* WriteComputedProps */) {
|
|
49373
|
-
|
|
49378
|
+
internalNodeFlags |= 1 /* WriteComputedProps */;
|
|
49374
49379
|
}
|
|
49375
49380
|
const builder = flags & 4 /* AllowAnyNodeKind */ ? nodeBuilder.symbolToNode : nodeBuilder.symbolToEntityName;
|
|
49376
49381
|
return writer ? symbolToStringWorker(writer).getText() : usingSingleLineStringWriter(symbolToStringWorker);
|
|
49377
49382
|
function symbolToStringWorker(writer2) {
|
|
49378
|
-
const entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags);
|
|
49383
|
+
const entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags, internalNodeFlags);
|
|
49379
49384
|
const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 307 /* SourceFile */ ? createPrinterWithRemoveCommentsNeverAsciiEscape() : createPrinterWithRemoveComments();
|
|
49380
49385
|
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
49381
49386
|
printer.writeNode(
|
|
@@ -49412,7 +49417,13 @@ function createTypeChecker(host) {
|
|
|
49412
49417
|
}
|
|
49413
49418
|
function typeToString(type, enclosingDeclaration, flags = 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */, writer = createTextWriter("")) {
|
|
49414
49419
|
const noTruncation = compilerOptions.noErrorTruncation || flags & 1 /* NoTruncation */;
|
|
49415
|
-
const typeNode = nodeBuilder.typeToTypeNode(
|
|
49420
|
+
const typeNode = nodeBuilder.typeToTypeNode(
|
|
49421
|
+
type,
|
|
49422
|
+
enclosingDeclaration,
|
|
49423
|
+
toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0 /* None */),
|
|
49424
|
+
/*internalFlags*/
|
|
49425
|
+
void 0
|
|
49426
|
+
);
|
|
49416
49427
|
if (typeNode === void 0) return Debug.fail("should always get typenode");
|
|
49417
49428
|
const printer = type !== unresolvedType ? createPrinterWithRemoveComments() : createPrinterWithDefaults();
|
|
49418
49429
|
const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
|
|
@@ -49461,31 +49472,31 @@ function createTypeChecker(host) {
|
|
|
49461
49472
|
}
|
|
49462
49473
|
function createNodeBuilder() {
|
|
49463
49474
|
return {
|
|
49464
|
-
typeToTypeNode: (type, enclosingDeclaration, flags, tracker) => withContext(enclosingDeclaration, flags, tracker, (context) => typeToTypeNodeHelper(type, context)),
|
|
49465
|
-
typePredicateToTypePredicateNode: (typePredicate, enclosingDeclaration, flags, tracker) => withContext(enclosingDeclaration, flags, tracker, (context) => typePredicateToTypePredicateNodeHelper(typePredicate, context)),
|
|
49466
|
-
expressionOrTypeToTypeNode: (expr, type, addUndefined, enclosingDeclaration, flags, tracker) => withContext(enclosingDeclaration, flags, tracker, (context) => expressionOrTypeToTypeNode(context, expr, type, addUndefined)),
|
|
49467
|
-
serializeTypeForDeclaration: (declaration, type, symbol, enclosingDeclaration, flags, tracker) => withContext(enclosingDeclaration, flags, tracker, (context) => serializeTypeForDeclaration(context, declaration, type, symbol)),
|
|
49468
|
-
serializeReturnTypeForSignature: (signature, enclosingDeclaration, flags, tracker) => withContext(enclosingDeclaration, flags, tracker, (context) => serializeReturnTypeForSignature(context, signature)),
|
|
49469
|
-
indexInfoToIndexSignatureDeclaration: (indexInfo, enclosingDeclaration, flags, tracker) => withContext(enclosingDeclaration, flags, tracker, (context) => indexInfoToIndexSignatureDeclarationHelper(
|
|
49475
|
+
typeToTypeNode: (type, enclosingDeclaration, flags, internalFlags, tracker) => withContext(enclosingDeclaration, flags, internalFlags, tracker, (context) => typeToTypeNodeHelper(type, context)),
|
|
49476
|
+
typePredicateToTypePredicateNode: (typePredicate, enclosingDeclaration, flags, internalFlags, tracker) => withContext(enclosingDeclaration, flags, internalFlags, tracker, (context) => typePredicateToTypePredicateNodeHelper(typePredicate, context)),
|
|
49477
|
+
expressionOrTypeToTypeNode: (expr, type, addUndefined, enclosingDeclaration, flags, internalFlags, tracker) => withContext(enclosingDeclaration, flags, internalFlags, tracker, (context) => expressionOrTypeToTypeNode(context, expr, type, addUndefined)),
|
|
49478
|
+
serializeTypeForDeclaration: (declaration, type, symbol, enclosingDeclaration, flags, internalFlags, tracker) => withContext(enclosingDeclaration, flags, internalFlags, tracker, (context) => serializeTypeForDeclaration(context, declaration, type, symbol)),
|
|
49479
|
+
serializeReturnTypeForSignature: (signature, enclosingDeclaration, flags, internalFlags, tracker) => withContext(enclosingDeclaration, flags, internalFlags, tracker, (context) => serializeReturnTypeForSignature(context, signature)),
|
|
49480
|
+
indexInfoToIndexSignatureDeclaration: (indexInfo, enclosingDeclaration, flags, internalFlags, tracker) => withContext(enclosingDeclaration, flags, internalFlags, tracker, (context) => indexInfoToIndexSignatureDeclarationHelper(
|
|
49470
49481
|
indexInfo,
|
|
49471
49482
|
context,
|
|
49472
49483
|
/*typeNode*/
|
|
49473
49484
|
void 0
|
|
49474
49485
|
)),
|
|
49475
|
-
signatureToSignatureDeclaration: (signature, kind, enclosingDeclaration, flags, tracker) => withContext(enclosingDeclaration, flags, tracker, (context) => signatureToSignatureDeclarationHelper(signature, kind, context)),
|
|
49476
|
-
symbolToEntityName: (symbol, meaning, enclosingDeclaration, flags, tracker) => withContext(enclosingDeclaration, flags, tracker, (context) => symbolToName(
|
|
49486
|
+
signatureToSignatureDeclaration: (signature, kind, enclosingDeclaration, flags, internalFlags, tracker) => withContext(enclosingDeclaration, flags, internalFlags, tracker, (context) => signatureToSignatureDeclarationHelper(signature, kind, context)),
|
|
49487
|
+
symbolToEntityName: (symbol, meaning, enclosingDeclaration, flags, internalFlags, tracker) => withContext(enclosingDeclaration, flags, internalFlags, tracker, (context) => symbolToName(
|
|
49477
49488
|
symbol,
|
|
49478
49489
|
context,
|
|
49479
49490
|
meaning,
|
|
49480
49491
|
/*expectsIdentifier*/
|
|
49481
49492
|
false
|
|
49482
49493
|
)),
|
|
49483
|
-
symbolToExpression: (symbol, meaning, enclosingDeclaration, flags, tracker) => withContext(enclosingDeclaration, flags, tracker, (context) => symbolToExpression(symbol, context, meaning)),
|
|
49484
|
-
symbolToTypeParameterDeclarations: (symbol, enclosingDeclaration, flags, tracker) => withContext(enclosingDeclaration, flags, tracker, (context) => typeParametersToTypeParameterDeclarations(symbol, context)),
|
|
49485
|
-
symbolToParameterDeclaration: (symbol, enclosingDeclaration, flags, tracker) => withContext(enclosingDeclaration, flags, tracker, (context) => symbolToParameterDeclaration(symbol, context)),
|
|
49486
|
-
typeParameterToDeclaration: (parameter, enclosingDeclaration, flags, tracker) => withContext(enclosingDeclaration, flags, tracker, (context) => typeParameterToDeclaration(parameter, context)),
|
|
49487
|
-
symbolTableToDeclarationStatements: (symbolTable, enclosingDeclaration, flags, tracker) => withContext(enclosingDeclaration, flags, tracker, (context) => symbolTableToDeclarationStatements(symbolTable, context)),
|
|
49488
|
-
symbolToNode: (symbol, meaning, enclosingDeclaration, flags, tracker) => withContext(enclosingDeclaration, flags, tracker, (context) => symbolToNode(symbol, context, meaning))
|
|
49494
|
+
symbolToExpression: (symbol, meaning, enclosingDeclaration, flags, internalFlags, tracker) => withContext(enclosingDeclaration, flags, internalFlags, tracker, (context) => symbolToExpression(symbol, context, meaning)),
|
|
49495
|
+
symbolToTypeParameterDeclarations: (symbol, enclosingDeclaration, flags, internalFlags, tracker) => withContext(enclosingDeclaration, flags, internalFlags, tracker, (context) => typeParametersToTypeParameterDeclarations(symbol, context)),
|
|
49496
|
+
symbolToParameterDeclaration: (symbol, enclosingDeclaration, flags, internalFlags, tracker) => withContext(enclosingDeclaration, flags, internalFlags, tracker, (context) => symbolToParameterDeclaration(symbol, context)),
|
|
49497
|
+
typeParameterToDeclaration: (parameter, enclosingDeclaration, flags, internalFlags, tracker) => withContext(enclosingDeclaration, flags, internalFlags, tracker, (context) => typeParameterToDeclaration(parameter, context)),
|
|
49498
|
+
symbolTableToDeclarationStatements: (symbolTable, enclosingDeclaration, flags, internalFlags, tracker) => withContext(enclosingDeclaration, flags, internalFlags, tracker, (context) => symbolTableToDeclarationStatements(symbolTable, context)),
|
|
49499
|
+
symbolToNode: (symbol, meaning, enclosingDeclaration, flags, internalFlags, tracker) => withContext(enclosingDeclaration, flags, internalFlags, tracker, (context) => symbolToNode(symbol, context, meaning))
|
|
49489
49500
|
};
|
|
49490
49501
|
function getTypeFromTypeNode2(context, node, noMappedTypes) {
|
|
49491
49502
|
const type = getTypeFromTypeNodeWithoutContext(node);
|
|
@@ -49507,13 +49518,13 @@ function createTypeChecker(host) {
|
|
|
49507
49518
|
return setTextRange(setOriginalNode(range, location), location);
|
|
49508
49519
|
}
|
|
49509
49520
|
function expressionOrTypeToTypeNode(context, expr, type, addUndefined) {
|
|
49510
|
-
const
|
|
49511
|
-
if (expr && !(context.
|
|
49521
|
+
const restoreFlags = saveRestoreFlags(context);
|
|
49522
|
+
if (expr && !(context.internalFlags & 2 /* NoSyntacticPrinter */)) {
|
|
49512
49523
|
syntacticNodeBuilder.serializeTypeOfExpression(expr, context, addUndefined);
|
|
49513
49524
|
}
|
|
49514
|
-
context.
|
|
49525
|
+
context.internalFlags |= 2 /* NoSyntacticPrinter */;
|
|
49515
49526
|
const result = expressionOrTypeToTypeNodeHelper(context, expr, type, addUndefined);
|
|
49516
|
-
|
|
49527
|
+
restoreFlags();
|
|
49517
49528
|
return result;
|
|
49518
49529
|
}
|
|
49519
49530
|
function expressionOrTypeToTypeNodeHelper(context, expr, type, addUndefined) {
|
|
@@ -49566,7 +49577,7 @@ function createTypeChecker(host) {
|
|
|
49566
49577
|
return void 0;
|
|
49567
49578
|
}
|
|
49568
49579
|
function symbolToNode(symbol, context, meaning) {
|
|
49569
|
-
if (context.
|
|
49580
|
+
if (context.internalFlags & 1 /* WriteComputedProps */) {
|
|
49570
49581
|
if (symbol.valueDeclaration) {
|
|
49571
49582
|
const name = getNameOfDeclaration(symbol.valueDeclaration);
|
|
49572
49583
|
if (name && isComputedPropertyName(name)) return name;
|
|
@@ -49579,12 +49590,13 @@ function createTypeChecker(host) {
|
|
|
49579
49590
|
}
|
|
49580
49591
|
return symbolToExpression(symbol, context, meaning);
|
|
49581
49592
|
}
|
|
49582
|
-
function withContext(enclosingDeclaration, flags, tracker, cb) {
|
|
49583
|
-
const moduleResolverHost = (tracker == null ? void 0 : tracker.trackSymbol) ? tracker.moduleResolverHost :
|
|
49593
|
+
function withContext(enclosingDeclaration, flags, internalFlags, tracker, cb) {
|
|
49594
|
+
const moduleResolverHost = (tracker == null ? void 0 : tracker.trackSymbol) ? tracker.moduleResolverHost : (internalFlags || 0 /* None */) & 4 /* DoNotIncludeSymbolChain */ ? createBasicNodeBuilderModuleSpecifierResolutionHost(host) : void 0;
|
|
49584
49595
|
const context = {
|
|
49585
49596
|
enclosingDeclaration,
|
|
49586
49597
|
enclosingFile: enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration),
|
|
49587
49598
|
flags: flags || 0 /* None */,
|
|
49599
|
+
internalFlags: internalFlags || 0 /* None */,
|
|
49588
49600
|
tracker: void 0,
|
|
49589
49601
|
encounteredError: false,
|
|
49590
49602
|
reportedDiagnostic: false,
|
|
@@ -49614,14 +49626,23 @@ function createTypeChecker(host) {
|
|
|
49614
49626
|
}
|
|
49615
49627
|
return context.encounteredError ? void 0 : resultingNode;
|
|
49616
49628
|
}
|
|
49629
|
+
function saveRestoreFlags(context) {
|
|
49630
|
+
const flags = context.flags;
|
|
49631
|
+
const internalFlags = context.internalFlags;
|
|
49632
|
+
return restore;
|
|
49633
|
+
function restore() {
|
|
49634
|
+
context.flags = flags;
|
|
49635
|
+
context.internalFlags = internalFlags;
|
|
49636
|
+
}
|
|
49637
|
+
}
|
|
49617
49638
|
function checkTruncationLength(context) {
|
|
49618
49639
|
if (context.truncating) return context.truncating;
|
|
49619
49640
|
return context.truncating = context.approximateLength > (context.flags & 1 /* NoTruncation */ ? noTruncationMaximumTruncationLength : defaultMaximumTruncationLength);
|
|
49620
49641
|
}
|
|
49621
49642
|
function typeToTypeNodeHelper(type, context) {
|
|
49622
|
-
const
|
|
49643
|
+
const restoreFlags = saveRestoreFlags(context);
|
|
49623
49644
|
const typeNode = typeToTypeNodeWorker(type, context);
|
|
49624
|
-
|
|
49645
|
+
restoreFlags();
|
|
49625
49646
|
return typeNode;
|
|
49626
49647
|
}
|
|
49627
49648
|
function typeToTypeNodeWorker(type, context) {
|
|
@@ -50075,7 +50096,7 @@ function createTypeChecker(host) {
|
|
|
50075
50096
|
context.symbolDepth = /* @__PURE__ */ new Map();
|
|
50076
50097
|
}
|
|
50077
50098
|
const links = context.enclosingDeclaration && getNodeLinks(context.enclosingDeclaration);
|
|
50078
|
-
const key = `${getTypeId(type2)}|${context.flags}`;
|
|
50099
|
+
const key = `${getTypeId(type2)}|${context.flags}|${context.internalFlags}`;
|
|
50079
50100
|
if (links) {
|
|
50080
50101
|
links.serializedTypes || (links.serializedTypes = /* @__PURE__ */ new Map());
|
|
50081
50102
|
}
|
|
@@ -50181,10 +50202,10 @@ function createTypeChecker(host) {
|
|
|
50181
50202
|
}
|
|
50182
50203
|
return typeToTypeNodeHelper(getIntersectionType(types), context);
|
|
50183
50204
|
}
|
|
50184
|
-
const
|
|
50205
|
+
const restoreFlags = saveRestoreFlags(context);
|
|
50185
50206
|
context.flags |= 4194304 /* InObjectTypeLiteral */;
|
|
50186
50207
|
const members = createTypeNodesFromResolvedType(resolved);
|
|
50187
|
-
|
|
50208
|
+
restoreFlags();
|
|
50188
50209
|
const typeLiteralNode = factory.createTypeLiteralNode(members);
|
|
50189
50210
|
context.approximateLength += 2;
|
|
50190
50211
|
setEmitFlags(typeLiteralNode, context.flags & 1024 /* MultilineObjectLiterals */ ? 0 : 1 /* SingleLine */);
|
|
@@ -50247,10 +50268,10 @@ function createTypeChecker(host) {
|
|
|
50247
50268
|
} while (i < length2 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent);
|
|
50248
50269
|
if (!rangeEquals(outerTypeParameters, typeArguments, start, i)) {
|
|
50249
50270
|
const typeArgumentSlice = mapToTypeNodes(typeArguments.slice(start, i), context);
|
|
50250
|
-
const
|
|
50271
|
+
const restoreFlags2 = saveRestoreFlags(context);
|
|
50251
50272
|
context.flags |= 16 /* ForbidIndexedAccessSymbolReferences */;
|
|
50252
50273
|
const ref = symbolToTypeNode(parent, context, 788968 /* Type */, typeArgumentSlice);
|
|
50253
|
-
|
|
50274
|
+
restoreFlags2();
|
|
50254
50275
|
resultType = !resultType ? ref : appendReferenceToType(resultType, ref);
|
|
50255
50276
|
}
|
|
50256
50277
|
}
|
|
@@ -50288,10 +50309,10 @@ function createTypeChecker(host) {
|
|
|
50288
50309
|
}
|
|
50289
50310
|
typeArgumentNodes = mapToTypeNodes(typeArguments.slice(i, typeParameterCount), context);
|
|
50290
50311
|
}
|
|
50291
|
-
const
|
|
50312
|
+
const restoreFlags = saveRestoreFlags(context);
|
|
50292
50313
|
context.flags |= 16 /* ForbidIndexedAccessSymbolReferences */;
|
|
50293
50314
|
const finalRef = symbolToTypeNode(type2.symbol, context, 788968 /* Type */, typeArgumentNodes);
|
|
50294
|
-
|
|
50315
|
+
restoreFlags();
|
|
50295
50316
|
return !resultType ? finalRef : appendReferenceToType(resultType, finalRef);
|
|
50296
50317
|
}
|
|
50297
50318
|
}
|
|
@@ -50603,7 +50624,7 @@ function createTypeChecker(host) {
|
|
|
50603
50624
|
}
|
|
50604
50625
|
}
|
|
50605
50626
|
if (seenNames) {
|
|
50606
|
-
const
|
|
50627
|
+
const restoreFlags = saveRestoreFlags(context);
|
|
50607
50628
|
context.flags |= 64 /* UseFullyQualifiedType */;
|
|
50608
50629
|
seenNames.forEach((types2) => {
|
|
50609
50630
|
if (!arrayIsHomogeneous(types2, ([a], [b]) => typesAreSameReference(a, b))) {
|
|
@@ -50612,7 +50633,7 @@ function createTypeChecker(host) {
|
|
|
50612
50633
|
}
|
|
50613
50634
|
}
|
|
50614
50635
|
});
|
|
50615
|
-
|
|
50636
|
+
restoreFlags();
|
|
50616
50637
|
}
|
|
50617
50638
|
return result;
|
|
50618
50639
|
}
|
|
@@ -50664,19 +50685,19 @@ function createTypeChecker(host) {
|
|
|
50664
50685
|
} else {
|
|
50665
50686
|
typeParameters = signature.typeParameters && signature.typeParameters.map((parameter) => typeParameterToDeclaration(parameter, context));
|
|
50666
50687
|
}
|
|
50667
|
-
const
|
|
50688
|
+
const restoreFlags = saveRestoreFlags(context);
|
|
50668
50689
|
context.flags &= ~256 /* SuppressAnyReturnType */;
|
|
50669
50690
|
const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 176 /* Constructor */));
|
|
50670
50691
|
const thisParameter = context.flags & 33554432 /* OmitThisParameter */ ? void 0 : tryGetThisParameterDeclaration(signature, context);
|
|
50671
50692
|
if (thisParameter) {
|
|
50672
50693
|
parameters.unshift(thisParameter);
|
|
50673
50694
|
}
|
|
50674
|
-
|
|
50695
|
+
restoreFlags();
|
|
50675
50696
|
const returnTypeNode = serializeReturnTypeForSignature(context, signature);
|
|
50676
50697
|
let modifiers = options == null ? void 0 : options.modifiers;
|
|
50677
50698
|
if (kind === 185 /* ConstructorType */ && signature.flags & 4 /* Abstract */) {
|
|
50678
|
-
const
|
|
50679
|
-
modifiers = factory.createModifiersFromModifierFlags(
|
|
50699
|
+
const flags = modifiersToFlags(modifiers);
|
|
50700
|
+
modifiers = factory.createModifiersFromModifierFlags(flags | 64 /* Abstract */);
|
|
50680
50701
|
}
|
|
50681
50702
|
const node = kind === 179 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 180 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 173 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (options == null ? void 0 : options.name) ?? factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 174 /* MethodDeclaration */ ? factory.createMethodDeclaration(
|
|
50682
50703
|
modifiers,
|
|
@@ -50896,13 +50917,13 @@ function createTypeChecker(host) {
|
|
|
50896
50917
|
}
|
|
50897
50918
|
}
|
|
50898
50919
|
function typeParameterToDeclarationWithConstraint(type, context, constraintNode) {
|
|
50899
|
-
const
|
|
50920
|
+
const restoreFlags = saveRestoreFlags(context);
|
|
50900
50921
|
context.flags &= ~512 /* WriteTypeParametersInQualifiedName */;
|
|
50901
50922
|
const modifiers = factory.createModifiersFromModifierFlags(getTypeParameterModifiers(type));
|
|
50902
50923
|
const name = typeParameterToName(type, context);
|
|
50903
50924
|
const defaultParameter = getDefaultFromTypeParameter(type);
|
|
50904
50925
|
const defaultParameterNode = defaultParameter && typeToTypeNodeHelper(defaultParameter, context);
|
|
50905
|
-
|
|
50926
|
+
restoreFlags();
|
|
50906
50927
|
return factory.createTypeParameterDeclaration(modifiers, name, constraintNode, defaultParameterNode);
|
|
50907
50928
|
}
|
|
50908
50929
|
function typeToTypeNodeHelperWithPossibleReusableTypeNode(type, typeNode, context) {
|
|
@@ -51006,7 +51027,7 @@ function createTypeChecker(host) {
|
|
|
51006
51027
|
function lookupSymbolChainWorker(symbol, context, meaning, yieldModuleSymbol) {
|
|
51007
51028
|
let chain;
|
|
51008
51029
|
const isTypeParameter = symbol.flags & 262144 /* TypeParameter */;
|
|
51009
|
-
if (!isTypeParameter && (context.enclosingDeclaration || context.flags & 64 /* UseFullyQualifiedType */) && !(context.
|
|
51030
|
+
if (!isTypeParameter && (context.enclosingDeclaration || context.flags & 64 /* UseFullyQualifiedType */) && !(context.internalFlags & 4 /* DoNotIncludeSymbolChain */)) {
|
|
51010
51031
|
chain = Debug.checkDefined(getSymbolChain(
|
|
51011
51032
|
symbol,
|
|
51012
51033
|
meaning,
|
|
@@ -51532,19 +51553,19 @@ function createTypeChecker(host) {
|
|
|
51532
51553
|
var _a, _b;
|
|
51533
51554
|
const addUndefinedForParameter = declaration && (isParameter(declaration) || isJSDocParameterTag(declaration)) && requiresAddingImplicitUndefined(declaration);
|
|
51534
51555
|
const enclosingDeclaration = context.enclosingDeclaration;
|
|
51535
|
-
const
|
|
51536
|
-
if (declaration && hasInferredType(declaration) && !(context.
|
|
51556
|
+
const restoreFlags = saveRestoreFlags(context);
|
|
51557
|
+
if (declaration && hasInferredType(declaration) && !(context.internalFlags & 2 /* NoSyntacticPrinter */)) {
|
|
51537
51558
|
syntacticNodeBuilder.serializeTypeOfDeclaration(declaration, context);
|
|
51538
51559
|
}
|
|
51539
|
-
context.
|
|
51540
|
-
if (enclosingDeclaration && (!isErrorType(type) || context.
|
|
51560
|
+
context.internalFlags |= 2 /* NoSyntacticPrinter */;
|
|
51561
|
+
if (enclosingDeclaration && (!isErrorType(type) || context.internalFlags & 8 /* AllowUnresolvedNames */)) {
|
|
51541
51562
|
const declWithExistingAnnotation = declaration && getNonlocalEffectiveTypeAnnotationNode(declaration) ? declaration : getDeclarationWithTypeAnnotation(symbol);
|
|
51542
51563
|
if (declWithExistingAnnotation && !isFunctionLikeDeclaration(declWithExistingAnnotation) && !isGetAccessorDeclaration(declWithExistingAnnotation)) {
|
|
51543
51564
|
const existing = getNonlocalEffectiveTypeAnnotationNode(declWithExistingAnnotation);
|
|
51544
51565
|
const addUndefined = addUndefinedForParameter || !!(symbol.flags & 4 /* Property */ && symbol.flags & 16777216 /* Optional */ && isOptionalDeclaration(declWithExistingAnnotation) && ((_a = symbol.links) == null ? void 0 : _a.mappedType) && containsNonMissingUndefinedType(type));
|
|
51545
51566
|
const result2 = !isTypePredicateNode(existing) && tryReuseExistingTypeNode(context, existing, type, declWithExistingAnnotation, addUndefined);
|
|
51546
51567
|
if (result2) {
|
|
51547
|
-
|
|
51568
|
+
restoreFlags();
|
|
51548
51569
|
return result2;
|
|
51549
51570
|
}
|
|
51550
51571
|
}
|
|
@@ -51555,7 +51576,7 @@ function createTypeChecker(host) {
|
|
|
51555
51576
|
const decl = declaration ?? symbol.valueDeclaration ?? ((_b = symbol.declarations) == null ? void 0 : _b[0]);
|
|
51556
51577
|
const expr = decl && isDeclarationWithPossibleInnerTypeNodeReuse(decl) ? getPossibleTypeNodeReuseExpression(decl) : void 0;
|
|
51557
51578
|
const result = expressionOrTypeToTypeNode(context, expr, type, addUndefinedForParameter);
|
|
51558
|
-
|
|
51579
|
+
restoreFlags();
|
|
51559
51580
|
return result;
|
|
51560
51581
|
}
|
|
51561
51582
|
function typeNodeIsEquivalentToType(annotatedDeclaration, type, typeFromTypeNode) {
|
|
@@ -51569,26 +51590,26 @@ function createTypeChecker(host) {
|
|
|
51569
51590
|
}
|
|
51570
51591
|
function serializeReturnTypeForSignature(context, signature) {
|
|
51571
51592
|
const suppressAny = context.flags & 256 /* SuppressAnyReturnType */;
|
|
51572
|
-
const
|
|
51593
|
+
const restoreFlags = saveRestoreFlags(context);
|
|
51573
51594
|
if (suppressAny) context.flags &= ~256 /* SuppressAnyReturnType */;
|
|
51574
51595
|
let returnTypeNode;
|
|
51575
51596
|
const returnType = getReturnTypeOfSignature(signature);
|
|
51576
51597
|
if (returnType && !(suppressAny && isTypeAny(returnType))) {
|
|
51577
|
-
if (signature.declaration && !(context.
|
|
51598
|
+
if (signature.declaration && !(context.internalFlags & 2 /* NoSyntacticPrinter */)) {
|
|
51578
51599
|
syntacticNodeBuilder.serializeReturnTypeForSignature(signature.declaration, context);
|
|
51579
51600
|
}
|
|
51580
|
-
context.
|
|
51601
|
+
context.internalFlags |= 2 /* NoSyntacticPrinter */;
|
|
51581
51602
|
returnTypeNode = serializeReturnTypeForSignatureWorker(context, signature);
|
|
51582
51603
|
} else if (!suppressAny) {
|
|
51583
51604
|
returnTypeNode = factory.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
51584
51605
|
}
|
|
51585
|
-
|
|
51606
|
+
restoreFlags();
|
|
51586
51607
|
return returnTypeNode;
|
|
51587
51608
|
}
|
|
51588
51609
|
function serializeReturnTypeForSignatureWorker(context, signature) {
|
|
51589
51610
|
const typePredicate = getTypePredicateOfSignature(signature);
|
|
51590
51611
|
const type = getReturnTypeOfSignature(signature);
|
|
51591
|
-
if (context.enclosingDeclaration && (!isErrorType(type) || context.
|
|
51612
|
+
if (context.enclosingDeclaration && (!isErrorType(type) || context.internalFlags & 8 /* AllowUnresolvedNames */) && signature.declaration && !nodeIsSynthesized(signature.declaration)) {
|
|
51592
51613
|
const annotation = getNonlocalEffectiveReturnTypeAnnotationNode(signature.declaration);
|
|
51593
51614
|
if (annotation) {
|
|
51594
51615
|
const result = tryReuseExistingTypeNode(context, annotation, type, context.enclosingDeclaration);
|
|
@@ -52090,7 +52111,7 @@ function createTypeChecker(host) {
|
|
|
52090
52111
|
if (!hasDynamicName(node)) {
|
|
52091
52112
|
return visitEachChild2(node, visitExistingNodeTreeSymbols);
|
|
52092
52113
|
}
|
|
52093
|
-
if (!(context.
|
|
52114
|
+
if (!(context.internalFlags & 8 /* AllowUnresolvedNames */ && isEntityNameExpression(node.name.expression) && checkComputedPropertyName(node.name).flags & 1 /* Any */)) {
|
|
52094
52115
|
return void 0;
|
|
52095
52116
|
}
|
|
52096
52117
|
}
|
|
@@ -52742,7 +52763,7 @@ function createTypeChecker(host) {
|
|
|
52742
52763
|
const typeParamDecls = map(typeParams, (p) => typeParameterToDeclaration(p, context));
|
|
52743
52764
|
const jsdocAliasDecl = (_a2 = symbol.declarations) == null ? void 0 : _a2.find(isJSDocTypeAlias);
|
|
52744
52765
|
const commentText = getTextOfJSDocComment(jsdocAliasDecl ? jsdocAliasDecl.comment || jsdocAliasDecl.parent.comment : void 0);
|
|
52745
|
-
const
|
|
52766
|
+
const restoreFlags = saveRestoreFlags(context);
|
|
52746
52767
|
context.flags |= 8388608 /* InTypeAlias */;
|
|
52747
52768
|
const oldEnclosingDecl = context.enclosingDeclaration;
|
|
52748
52769
|
context.enclosingDeclaration = jsdocAliasDecl;
|
|
@@ -52766,7 +52787,7 @@ function createTypeChecker(host) {
|
|
|
52766
52787
|
),
|
|
52767
52788
|
modifierFlags
|
|
52768
52789
|
);
|
|
52769
|
-
|
|
52790
|
+
restoreFlags();
|
|
52770
52791
|
context.enclosingDeclaration = oldEnclosingDecl;
|
|
52771
52792
|
}
|
|
52772
52793
|
function serializeInterface(symbol, symbolName2, modifierFlags) {
|
|
@@ -53775,10 +53796,10 @@ function createTypeChecker(host) {
|
|
|
53775
53796
|
}
|
|
53776
53797
|
function getNameCandidateWorker(symbol, localName) {
|
|
53777
53798
|
if (localName === "default" /* Default */ || localName === "__class" /* Class */ || localName === "__function" /* Function */) {
|
|
53778
|
-
const
|
|
53799
|
+
const restoreFlags = saveRestoreFlags(context);
|
|
53779
53800
|
context.flags |= 16777216 /* InInitialEntityName */;
|
|
53780
53801
|
const nameCandidate = getNameOfSymbolAsWritten(symbol, context);
|
|
53781
|
-
|
|
53802
|
+
restoreFlags();
|
|
53782
53803
|
localName = nameCandidate.length > 0 && isSingleOrDoubleQuote(nameCandidate.charCodeAt(0)) ? stripQuotes(nameCandidate) : nameCandidate;
|
|
53783
53804
|
}
|
|
53784
53805
|
if (localName === "default" /* Default */) {
|
|
@@ -55361,7 +55382,8 @@ function createTypeChecker(host) {
|
|
|
55361
55382
|
if (!node) {
|
|
55362
55383
|
return void 0;
|
|
55363
55384
|
}
|
|
55364
|
-
|
|
55385
|
+
const kind = node.kind;
|
|
55386
|
+
switch (kind) {
|
|
55365
55387
|
case 263 /* ClassDeclaration */:
|
|
55366
55388
|
case 231 /* ClassExpression */:
|
|
55367
55389
|
case 264 /* InterfaceDeclaration */:
|
|
@@ -55383,13 +55405,19 @@ function createTypeChecker(host) {
|
|
|
55383
55405
|
case 200 /* MappedType */:
|
|
55384
55406
|
case 194 /* ConditionalType */: {
|
|
55385
55407
|
const outerTypeParameters = getOuterTypeParameters(node, includeThisTypes);
|
|
55386
|
-
if (
|
|
55408
|
+
if ((kind === 218 /* FunctionExpression */ || kind === 219 /* ArrowFunction */ || isObjectLiteralMethod(node)) && isContextSensitive(node)) {
|
|
55409
|
+
const signature = firstOrUndefined(getSignaturesOfType(getTypeOfSymbol(getSymbolOfDeclaration(node)), 0 /* Call */));
|
|
55410
|
+
if (signature && signature.typeParameters) {
|
|
55411
|
+
return [...outerTypeParameters || emptyArray, ...signature.typeParameters];
|
|
55412
|
+
}
|
|
55413
|
+
}
|
|
55414
|
+
if (kind === 200 /* MappedType */) {
|
|
55387
55415
|
return append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(node.typeParameter)));
|
|
55388
|
-
} else if (
|
|
55416
|
+
} else if (kind === 194 /* ConditionalType */) {
|
|
55389
55417
|
return concatenate(outerTypeParameters, getInferTypeParameters(node));
|
|
55390
55418
|
}
|
|
55391
55419
|
const outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, getEffectiveTypeParameterDeclarations(node));
|
|
55392
|
-
const thisType = includeThisTypes && (
|
|
55420
|
+
const thisType = includeThisTypes && (kind === 263 /* ClassDeclaration */ || kind === 231 /* ClassExpression */ || kind === 264 /* InterfaceDeclaration */ || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(node)).thisType;
|
|
55393
55421
|
return thisType ? append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters;
|
|
55394
55422
|
}
|
|
55395
55423
|
case 341 /* JSDocParameterTag */:
|
|
@@ -58201,8 +58229,11 @@ function createTypeChecker(host) {
|
|
|
58201
58229
|
true
|
|
58202
58230
|
);
|
|
58203
58231
|
}
|
|
58232
|
+
function getTypeParametersForMapper(signature) {
|
|
58233
|
+
return sameMap(signature.typeParameters, (tp) => tp.mapper ? instantiateType(tp, tp.mapper) : tp);
|
|
58234
|
+
}
|
|
58204
58235
|
function createSignatureTypeMapper(signature, typeArguments) {
|
|
58205
|
-
return createTypeMapper(
|
|
58236
|
+
return createTypeMapper(getTypeParametersForMapper(signature), typeArguments);
|
|
58206
58237
|
}
|
|
58207
58238
|
function getErasedSignature(signature) {
|
|
58208
58239
|
return signature.typeParameters ? signature.erasedSignatureCache || (signature.erasedSignatureCache = createErasedSignature(signature)) : signature;
|
|
@@ -71216,7 +71247,7 @@ function createTypeChecker(host) {
|
|
|
71216
71247
|
type,
|
|
71217
71248
|
(t) => {
|
|
71218
71249
|
var _a;
|
|
71219
|
-
if (isGenericMappedType(t) &&
|
|
71250
|
+
if (isGenericMappedType(t) && getMappedTypeNameTypeKind(t) !== 2 /* Remapping */) {
|
|
71220
71251
|
const constraint = getConstraintTypeFromMappedType(t);
|
|
71221
71252
|
const constraintOfConstraint = getBaseConstraintOfType(constraint) || constraint;
|
|
71222
71253
|
const propertyNameType = nameType || getStringLiteralType(unescapeLeadingUnderscores(name));
|
|
@@ -73902,7 +73933,7 @@ function createTypeChecker(host) {
|
|
|
73902
73933
|
return void 0;
|
|
73903
73934
|
}
|
|
73904
73935
|
function instantiateSignatureInContextOf(signature, contextualSignature, inferenceContext, compareTypes) {
|
|
73905
|
-
const context = createInferenceContext(signature
|
|
73936
|
+
const context = createInferenceContext(getTypeParametersForMapper(signature), signature, 0 /* None */, compareTypes);
|
|
73906
73937
|
const restType = getEffectiveRestType(contextualSignature);
|
|
73907
73938
|
const mapper = inferenceContext && (restType && restType.flags & 262144 /* TypeParameter */ ? inferenceContext.nonFixingMapper : inferenceContext.mapper);
|
|
73908
73939
|
const sourceSignature = mapper ? instantiateSignature(contextualSignature, mapper) : contextualSignature;
|
|
@@ -85939,14 +85970,14 @@ function createTypeChecker(host) {
|
|
|
85939
85970
|
return 11 /* ObjectType */;
|
|
85940
85971
|
}
|
|
85941
85972
|
}
|
|
85942
|
-
function createTypeOfDeclaration(declarationIn, enclosingDeclaration, flags, tracker) {
|
|
85973
|
+
function createTypeOfDeclaration(declarationIn, enclosingDeclaration, flags, internalFlags, tracker) {
|
|
85943
85974
|
const declaration = getParseTreeNode(declarationIn, isVariableLikeOrAccessor);
|
|
85944
85975
|
if (!declaration) {
|
|
85945
85976
|
return factory.createToken(133 /* AnyKeyword */);
|
|
85946
85977
|
}
|
|
85947
85978
|
const symbol = getSymbolOfDeclaration(declaration);
|
|
85948
85979
|
const type = symbol && !(symbol.flags & (2048 /* TypeLiteral */ | 131072 /* Signature */)) ? getWidenedLiteralType(getTypeOfSymbol(symbol)) : errorType;
|
|
85949
|
-
return nodeBuilder.serializeTypeForDeclaration(declaration, type, symbol, enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */, tracker);
|
|
85980
|
+
return nodeBuilder.serializeTypeForDeclaration(declaration, type, symbol, enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */, internalFlags, tracker);
|
|
85950
85981
|
}
|
|
85951
85982
|
function isDeclarationWithPossibleInnerTypeNodeReuse(declaration) {
|
|
85952
85983
|
return isFunctionLike(declaration) || isExportAssignment(declaration) || isVariableLike(declaration);
|
|
@@ -85989,14 +86020,14 @@ function createTypeChecker(host) {
|
|
|
85989
86020
|
}
|
|
85990
86021
|
return candidateExpr;
|
|
85991
86022
|
}
|
|
85992
|
-
function createReturnTypeOfSignatureDeclaration(signatureDeclarationIn, enclosingDeclaration, flags, tracker) {
|
|
86023
|
+
function createReturnTypeOfSignatureDeclaration(signatureDeclarationIn, enclosingDeclaration, flags, internalFlags, tracker) {
|
|
85993
86024
|
const signatureDeclaration = getParseTreeNode(signatureDeclarationIn, isFunctionLike);
|
|
85994
86025
|
if (!signatureDeclaration) {
|
|
85995
86026
|
return factory.createToken(133 /* AnyKeyword */);
|
|
85996
86027
|
}
|
|
85997
|
-
return nodeBuilder.serializeReturnTypeForSignature(getSignatureFromDeclaration(signatureDeclaration), enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */, tracker);
|
|
86028
|
+
return nodeBuilder.serializeReturnTypeForSignature(getSignatureFromDeclaration(signatureDeclaration), enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */, internalFlags, tracker);
|
|
85998
86029
|
}
|
|
85999
|
-
function createTypeOfExpression(exprIn, enclosingDeclaration, flags, tracker) {
|
|
86030
|
+
function createTypeOfExpression(exprIn, enclosingDeclaration, flags, internalFlags, tracker) {
|
|
86000
86031
|
const expr = getParseTreeNode(exprIn, isExpression);
|
|
86001
86032
|
if (!expr) {
|
|
86002
86033
|
return factory.createToken(133 /* AnyKeyword */);
|
|
@@ -86009,6 +86040,7 @@ function createTypeChecker(host) {
|
|
|
86009
86040
|
void 0,
|
|
86010
86041
|
enclosingDeclaration,
|
|
86011
86042
|
flags | 1024 /* MultilineObjectLiterals */,
|
|
86043
|
+
internalFlags,
|
|
86012
86044
|
tracker
|
|
86013
86045
|
);
|
|
86014
86046
|
}
|
|
@@ -86114,6 +86146,8 @@ function createTypeChecker(host) {
|
|
|
86114
86146
|
enclosing,
|
|
86115
86147
|
/*flags*/
|
|
86116
86148
|
void 0,
|
|
86149
|
+
/*internalFlags*/
|
|
86150
|
+
void 0,
|
|
86117
86151
|
tracker
|
|
86118
86152
|
) : type === trueType ? factory.createTrue() : type === falseType && factory.createFalse();
|
|
86119
86153
|
if (enumResult) return enumResult;
|
|
@@ -86242,15 +86276,15 @@ function createTypeChecker(host) {
|
|
|
86242
86276
|
const parseDecl = getParseTreeNode(decl);
|
|
86243
86277
|
return !!parseNode && !!parseDecl && (isVariableDeclaration(parseDecl) || isBindingElement(parseDecl)) && isBindingCapturedByNode(parseNode, parseDecl);
|
|
86244
86278
|
},
|
|
86245
|
-
getDeclarationStatementsForSourceFile: (node, flags, tracker) => {
|
|
86279
|
+
getDeclarationStatementsForSourceFile: (node, flags, internalFlags, tracker) => {
|
|
86246
86280
|
const n = getParseTreeNode(node);
|
|
86247
86281
|
Debug.assert(n && n.kind === 307 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile");
|
|
86248
86282
|
const sym = getSymbolOfDeclaration(node);
|
|
86249
86283
|
if (!sym) {
|
|
86250
|
-
return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker);
|
|
86284
|
+
return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, internalFlags, tracker);
|
|
86251
86285
|
}
|
|
86252
86286
|
resolveExternalModuleSymbol(sym);
|
|
86253
|
-
return !sym.exports ? [] : nodeBuilder.symbolTableToDeclarationStatements(sym.exports, node, flags, tracker);
|
|
86287
|
+
return !sym.exports ? [] : nodeBuilder.symbolTableToDeclarationStatements(sym.exports, node, flags, internalFlags, tracker);
|
|
86254
86288
|
},
|
|
86255
86289
|
isImportRequiredByAugmentation,
|
|
86256
86290
|
isDefinitelyReferenceToGlobalSymbolObject
|
|
@@ -91222,7 +91256,6 @@ function transformTypeScript(context) {
|
|
|
91222
91256
|
let currentNamespaceContainerName;
|
|
91223
91257
|
let currentLexicalScope;
|
|
91224
91258
|
let currentScopeFirstDeclarationsOfName;
|
|
91225
|
-
let currentClassHasParameterProperties;
|
|
91226
91259
|
let enabledSubstitutions;
|
|
91227
91260
|
let applicableSubstitutions;
|
|
91228
91261
|
return transformSourceFileOrBundle;
|
|
@@ -91250,14 +91283,12 @@ function transformTypeScript(context) {
|
|
|
91250
91283
|
function saveStateAndInvoke(node, f) {
|
|
91251
91284
|
const savedCurrentScope = currentLexicalScope;
|
|
91252
91285
|
const savedCurrentScopeFirstDeclarationsOfName = currentScopeFirstDeclarationsOfName;
|
|
91253
|
-
const savedCurrentClassHasParameterProperties = currentClassHasParameterProperties;
|
|
91254
91286
|
onBeforeVisitNode(node);
|
|
91255
91287
|
const visited = f(node);
|
|
91256
91288
|
if (currentLexicalScope !== savedCurrentScope) {
|
|
91257
91289
|
currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName;
|
|
91258
91290
|
}
|
|
91259
91291
|
currentLexicalScope = savedCurrentScope;
|
|
91260
|
-
currentClassHasParameterProperties = savedCurrentClassHasParameterProperties;
|
|
91261
91292
|
return visited;
|
|
91262
91293
|
}
|
|
91263
91294
|
function onBeforeVisitNode(node) {
|
|
@@ -91890,7 +91921,7 @@ function transformTypeScript(context) {
|
|
|
91890
91921
|
}
|
|
91891
91922
|
function visitPropertyNameOfClassElement(member) {
|
|
91892
91923
|
const name = member.name;
|
|
91893
|
-
if (
|
|
91924
|
+
if (legacyDecorators && isComputedPropertyName(name) && hasDecorators(member)) {
|
|
91894
91925
|
const expression = visitNode(name.expression, visitor, isExpression);
|
|
91895
91926
|
Debug.assert(expression);
|
|
91896
91927
|
const innerExpression = skipPartiallyEmittedExpressions(expression);
|
|
@@ -111353,7 +111384,8 @@ function getDeclarationDiagnostics(host, resolver, file) {
|
|
|
111353
111384
|
false
|
|
111354
111385
|
).diagnostics : void 0;
|
|
111355
111386
|
}
|
|
111356
|
-
var declarationEmitNodeBuilderFlags = 1024 /* MultilineObjectLiterals */ | 2048 /* WriteClassExpressionAsTypeLiteral */ | 4096 /* UseTypeOfFunction */ | 8 /* UseStructuralFallback */ | 524288 /* AllowEmptyTuple */ |
|
|
111387
|
+
var declarationEmitNodeBuilderFlags = 1024 /* MultilineObjectLiterals */ | 2048 /* WriteClassExpressionAsTypeLiteral */ | 4096 /* UseTypeOfFunction */ | 8 /* UseStructuralFallback */ | 524288 /* AllowEmptyTuple */ | 4 /* GenerateNamesForShadowedTypeParams */ | 1 /* NoTruncation */;
|
|
111388
|
+
var declarationEmitInternalNodeBuilderFlags = 8 /* AllowUnresolvedNames */;
|
|
111357
111389
|
function transformDeclarations(context) {
|
|
111358
111390
|
const throwDiagnostic = () => Debug.fail("Diagnostic emitted without context");
|
|
111359
111391
|
let getSymbolAccessibilityDiagnostic = throwDiagnostic;
|
|
@@ -111509,7 +111541,7 @@ function transformDeclarations(context) {
|
|
|
111509
111541
|
diagnosticMessage: s.errorModuleName ? Diagnostics.Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit : Diagnostics.Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit,
|
|
111510
111542
|
errorNode: s.errorNode || sourceFile
|
|
111511
111543
|
};
|
|
111512
|
-
const result = resolver.getDeclarationStatementsForSourceFile(sourceFile, declarationEmitNodeBuilderFlags, symbolTracker);
|
|
111544
|
+
const result = resolver.getDeclarationStatementsForSourceFile(sourceFile, declarationEmitNodeBuilderFlags, declarationEmitInternalNodeBuilderFlags, symbolTracker);
|
|
111513
111545
|
getSymbolAccessibilityDiagnostic = oldDiag;
|
|
111514
111546
|
return result;
|
|
111515
111547
|
}
|
|
@@ -111779,7 +111811,7 @@ function transformDeclarations(context) {
|
|
|
111779
111811
|
case 172 /* PropertyDeclaration */:
|
|
111780
111812
|
case 208 /* BindingElement */:
|
|
111781
111813
|
case 260 /* VariableDeclaration */:
|
|
111782
|
-
typeNode = resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker);
|
|
111814
|
+
typeNode = resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, declarationEmitInternalNodeBuilderFlags, symbolTracker);
|
|
111783
111815
|
break;
|
|
111784
111816
|
case 262 /* FunctionDeclaration */:
|
|
111785
111817
|
case 180 /* ConstructSignature */:
|
|
@@ -111787,7 +111819,7 @@ function transformDeclarations(context) {
|
|
|
111787
111819
|
case 174 /* MethodDeclaration */:
|
|
111788
111820
|
case 177 /* GetAccessor */:
|
|
111789
111821
|
case 179 /* CallSignature */:
|
|
111790
|
-
typeNode = resolver.createReturnTypeOfSignatureDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker);
|
|
111822
|
+
typeNode = resolver.createReturnTypeOfSignatureDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, declarationEmitInternalNodeBuilderFlags, symbolTracker);
|
|
111791
111823
|
break;
|
|
111792
111824
|
default:
|
|
111793
111825
|
Debug.assertNever(node);
|
|
@@ -112388,7 +112420,7 @@ function transformDeclarations(context) {
|
|
|
112388
112420
|
newId,
|
|
112389
112421
|
/*exclamationToken*/
|
|
112390
112422
|
void 0,
|
|
112391
|
-
resolver.createTypeOfExpression(input.expression, input, declarationEmitNodeBuilderFlags, symbolTracker),
|
|
112423
|
+
resolver.createTypeOfExpression(input.expression, input, declarationEmitNodeBuilderFlags, declarationEmitInternalNodeBuilderFlags, symbolTracker),
|
|
112392
112424
|
/*initializer*/
|
|
112393
112425
|
void 0
|
|
112394
112426
|
);
|
|
@@ -112514,7 +112546,7 @@ function transformDeclarations(context) {
|
|
|
112514
112546
|
return void 0;
|
|
112515
112547
|
}
|
|
112516
112548
|
getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(p.valueDeclaration);
|
|
112517
|
-
const type = resolver.createTypeOfDeclaration(p.valueDeclaration, fakespace, declarationEmitNodeBuilderFlags |
|
|
112549
|
+
const type = resolver.createTypeOfDeclaration(p.valueDeclaration, fakespace, declarationEmitNodeBuilderFlags, declarationEmitInternalNodeBuilderFlags | 2 /* NoSyntacticPrinter */, symbolTracker);
|
|
112518
112550
|
getSymbolAccessibilityDiagnostic = oldDiag;
|
|
112519
112551
|
const isNonContextualKeywordName = isStringANonContextualKeyword(nameStr);
|
|
112520
112552
|
const name = isNonContextualKeywordName ? factory2.getGeneratedNameForNode(p.valueDeclaration) : factory2.createIdentifier(nameStr);
|
|
@@ -112717,7 +112749,7 @@ function transformDeclarations(context) {
|
|
|
112717
112749
|
newId,
|
|
112718
112750
|
/*exclamationToken*/
|
|
112719
112751
|
void 0,
|
|
112720
|
-
resolver.createTypeOfExpression(extendsClause.expression, input, declarationEmitNodeBuilderFlags, symbolTracker),
|
|
112752
|
+
resolver.createTypeOfExpression(extendsClause.expression, input, declarationEmitNodeBuilderFlags, declarationEmitInternalNodeBuilderFlags, symbolTracker),
|
|
112721
112753
|
/*initializer*/
|
|
112722
112754
|
void 0
|
|
112723
112755
|
);
|