@typescript-deploys/pr-build 5.0.0-pr-49226-5 → 5.1.0-pr-53034-6
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/lib.es2015.collection.d.ts +1 -1
- package/lib/tsc.js +107 -97
- package/lib/tsserver.js +110 -103
- package/lib/tsserverlibrary.d.ts +1 -1
- package/lib/tsserverlibrary.js +110 -102
- package/lib/typescript.d.ts +1 -1
- package/lib/typescript.js +110 -101
- package/lib/typingsInstaller.js +2 -2
- package/package.json +2 -2
|
@@ -82,7 +82,7 @@ interface WeakMap<K extends object, V> {
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
interface WeakMapConstructor {
|
|
85
|
-
new <K extends object = object, V = any>(entries?: readonly [K, V][] | null): WeakMap<K, V>;
|
|
85
|
+
new <K extends object = object, V = any>(entries?: readonly (readonly [K, V])[] | null): WeakMap<K, V>;
|
|
86
86
|
readonly prototype: WeakMap<object, any>;
|
|
87
87
|
}
|
|
88
88
|
declare var WeakMap: WeakMapConstructor;
|
package/lib/tsc.js
CHANGED
|
@@ -22,8 +22,8 @@ var __export = (target, all) => {
|
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
// src/compiler/corePublic.ts
|
|
25
|
-
var versionMajorMinor = "5.
|
|
26
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
25
|
+
var versionMajorMinor = "5.1";
|
|
26
|
+
var version = `${versionMajorMinor}.0-insiders.20230228`;
|
|
27
27
|
|
|
28
28
|
// src/compiler/core.ts
|
|
29
29
|
var emptyArray = [];
|
|
@@ -842,9 +842,6 @@ function multiMapRemove(key, value) {
|
|
|
842
842
|
}
|
|
843
843
|
}
|
|
844
844
|
}
|
|
845
|
-
function createUnderscoreEscapedMultiMap() {
|
|
846
|
-
return createMultiMap();
|
|
847
|
-
}
|
|
848
845
|
function createQueue(items) {
|
|
849
846
|
const elements = (items == null ? void 0 : items.slice()) || [];
|
|
850
847
|
let headIndex = 0;
|
|
@@ -45908,6 +45905,10 @@ function createTypeChecker(host) {
|
|
|
45908
45905
|
return;
|
|
45909
45906
|
merged.exports.set(name, merged.exports.has(name) ? mergeSymbol(merged.exports.get(name), s) : s);
|
|
45910
45907
|
});
|
|
45908
|
+
if (merged === exported) {
|
|
45909
|
+
getSymbolLinks(merged).resolvedExports = void 0;
|
|
45910
|
+
getSymbolLinks(merged).resolvedMembers = void 0;
|
|
45911
|
+
}
|
|
45911
45912
|
getSymbolLinks(merged).cjsExportMerged = merged;
|
|
45912
45913
|
return links.cjsExportMerged = merged;
|
|
45913
45914
|
}
|
|
@@ -47794,7 +47795,7 @@ function createTypeChecker(host) {
|
|
|
47794
47795
|
}
|
|
47795
47796
|
}
|
|
47796
47797
|
const mayHaveNameCollisions = !(context.flags & 64 /* UseFullyQualifiedType */);
|
|
47797
|
-
const seenNames = mayHaveNameCollisions ?
|
|
47798
|
+
const seenNames = mayHaveNameCollisions ? createMultiMap() : void 0;
|
|
47798
47799
|
const result = [];
|
|
47799
47800
|
let i = 0;
|
|
47800
47801
|
for (const type of types) {
|
|
@@ -49361,7 +49362,8 @@ function createTypeChecker(host) {
|
|
|
49361
49362
|
), modifierFlags);
|
|
49362
49363
|
}
|
|
49363
49364
|
function getNamespaceMembersForSerialization(symbol) {
|
|
49364
|
-
|
|
49365
|
+
const exports = getExportsOfSymbol(symbol);
|
|
49366
|
+
return !exports ? [] : filter(arrayFrom(exports.values()), (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
|
|
49365
49367
|
}
|
|
49366
49368
|
function isTypeOnlyNamespace(symbol) {
|
|
49367
49369
|
return every(getNamespaceMembersForSerialization(symbol), (m) => !(getAllSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
|
|
@@ -60075,7 +60077,7 @@ function createTypeChecker(host) {
|
|
|
60075
60077
|
0 /* None */
|
|
60076
60078
|
);
|
|
60077
60079
|
}
|
|
60078
|
-
} else if (result2 && isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => !!(getObjectFlags(t) & 262144 /* NonInferrableType */))) {
|
|
60080
|
+
} else if (result2 && isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => t === target2 || !!(getObjectFlags(t) & 262144 /* NonInferrableType */))) {
|
|
60079
60081
|
result2 &= propertiesRelatedTo(
|
|
60080
60082
|
source2,
|
|
60081
60083
|
target2,
|
|
@@ -61657,7 +61659,7 @@ function createTypeChecker(host) {
|
|
|
61657
61659
|
return type.symbol;
|
|
61658
61660
|
}
|
|
61659
61661
|
if (isTupleType(type)) {
|
|
61660
|
-
return type;
|
|
61662
|
+
return type.target;
|
|
61661
61663
|
}
|
|
61662
61664
|
}
|
|
61663
61665
|
if (type.flags & 262144 /* TypeParameter */) {
|
|
@@ -85279,6 +85281,7 @@ function createDefaultValueCheck(flattenContext, value, defaultValue, location)
|
|
|
85279
85281
|
);
|
|
85280
85282
|
}
|
|
85281
85283
|
function createDestructuringPropertyAccess(flattenContext, value, propertyName) {
|
|
85284
|
+
const { factory: factory2 } = flattenContext.context;
|
|
85282
85285
|
if (isComputedPropertyName(propertyName)) {
|
|
85283
85286
|
const argumentExpression = ensureIdentifier(
|
|
85284
85287
|
flattenContext,
|
|
@@ -85290,7 +85293,7 @@ function createDestructuringPropertyAccess(flattenContext, value, propertyName)
|
|
|
85290
85293
|
);
|
|
85291
85294
|
return flattenContext.context.factory.createElementAccessExpression(value, argumentExpression);
|
|
85292
85295
|
} else if (isStringOrNumericLiteralLike(propertyName)) {
|
|
85293
|
-
const argumentExpression =
|
|
85296
|
+
const argumentExpression = factory2.cloneNode(propertyName);
|
|
85294
85297
|
return flattenContext.context.factory.createElementAccessExpression(value, argumentExpression);
|
|
85295
85298
|
} else {
|
|
85296
85299
|
const name = flattenContext.context.factory.createIdentifier(idText(propertyName));
|
|
@@ -85360,28 +85363,29 @@ function processTaggedTemplateExpression(context, node, visitor, currentSourceFi
|
|
|
85360
85363
|
if (level === 0 /* LiftRestriction */ && !hasInvalidEscape(template)) {
|
|
85361
85364
|
return visitEachChild(node, visitor, context);
|
|
85362
85365
|
}
|
|
85366
|
+
const { factory: factory2 } = context;
|
|
85363
85367
|
if (isNoSubstitutionTemplateLiteral(template)) {
|
|
85364
|
-
cookedStrings.push(createTemplateCooked(template));
|
|
85365
|
-
rawStrings.push(getRawLiteral(template, currentSourceFile));
|
|
85368
|
+
cookedStrings.push(createTemplateCooked(factory2, template));
|
|
85369
|
+
rawStrings.push(getRawLiteral(factory2, template, currentSourceFile));
|
|
85366
85370
|
} else {
|
|
85367
|
-
cookedStrings.push(createTemplateCooked(template.head));
|
|
85368
|
-
rawStrings.push(getRawLiteral(template.head, currentSourceFile));
|
|
85371
|
+
cookedStrings.push(createTemplateCooked(factory2, template.head));
|
|
85372
|
+
rawStrings.push(getRawLiteral(factory2, template.head, currentSourceFile));
|
|
85369
85373
|
for (const templateSpan of template.templateSpans) {
|
|
85370
|
-
cookedStrings.push(createTemplateCooked(templateSpan.literal));
|
|
85371
|
-
rawStrings.push(getRawLiteral(templateSpan.literal, currentSourceFile));
|
|
85374
|
+
cookedStrings.push(createTemplateCooked(factory2, templateSpan.literal));
|
|
85375
|
+
rawStrings.push(getRawLiteral(factory2, templateSpan.literal, currentSourceFile));
|
|
85372
85376
|
templateArguments.push(Debug.checkDefined(visitNode(templateSpan.expression, visitor, isExpression)));
|
|
85373
85377
|
}
|
|
85374
85378
|
}
|
|
85375
85379
|
const helperCall = context.getEmitHelperFactory().createTemplateObjectHelper(
|
|
85376
|
-
|
|
85377
|
-
|
|
85380
|
+
factory2.createArrayLiteralExpression(cookedStrings),
|
|
85381
|
+
factory2.createArrayLiteralExpression(rawStrings)
|
|
85378
85382
|
);
|
|
85379
85383
|
if (isExternalModule(currentSourceFile)) {
|
|
85380
|
-
const tempVar =
|
|
85384
|
+
const tempVar = factory2.createUniqueName("templateObject");
|
|
85381
85385
|
recordTaggedTemplateString(tempVar);
|
|
85382
|
-
templateArguments[0] =
|
|
85386
|
+
templateArguments[0] = factory2.createLogicalOr(
|
|
85383
85387
|
tempVar,
|
|
85384
|
-
|
|
85388
|
+
factory2.createAssignment(
|
|
85385
85389
|
tempVar,
|
|
85386
85390
|
helperCall
|
|
85387
85391
|
)
|
|
@@ -85389,17 +85393,17 @@ function processTaggedTemplateExpression(context, node, visitor, currentSourceFi
|
|
|
85389
85393
|
} else {
|
|
85390
85394
|
templateArguments[0] = helperCall;
|
|
85391
85395
|
}
|
|
85392
|
-
return
|
|
85396
|
+
return factory2.createCallExpression(
|
|
85393
85397
|
tag,
|
|
85394
85398
|
/*typeArguments*/
|
|
85395
85399
|
void 0,
|
|
85396
85400
|
templateArguments
|
|
85397
85401
|
);
|
|
85398
85402
|
}
|
|
85399
|
-
function createTemplateCooked(template) {
|
|
85400
|
-
return template.templateFlags ?
|
|
85403
|
+
function createTemplateCooked(factory2, template) {
|
|
85404
|
+
return template.templateFlags ? factory2.createVoidZero() : factory2.createStringLiteral(template.text);
|
|
85401
85405
|
}
|
|
85402
|
-
function getRawLiteral(node, currentSourceFile) {
|
|
85406
|
+
function getRawLiteral(factory2, node, currentSourceFile) {
|
|
85403
85407
|
let text = node.rawText;
|
|
85404
85408
|
if (text === void 0) {
|
|
85405
85409
|
Debug.assertIsDefined(
|
|
@@ -85411,7 +85415,7 @@ function getRawLiteral(node, currentSourceFile) {
|
|
|
85411
85415
|
text = text.substring(1, text.length - (isLast ? 1 : 2));
|
|
85412
85416
|
}
|
|
85413
85417
|
text = text.replace(/\r\n?/g, "\n");
|
|
85414
|
-
return setTextRange(
|
|
85418
|
+
return setTextRange(factory2.createStringLiteral(text), node);
|
|
85415
85419
|
}
|
|
85416
85420
|
|
|
85417
85421
|
// src/compiler/transformers/ts.ts
|
|
@@ -88867,12 +88871,14 @@ function transformClassFields(context) {
|
|
|
88867
88871
|
if (privateIdentifierInfo.kind === "f" /* Field */) {
|
|
88868
88872
|
if (!privateIdentifierInfo.isStatic) {
|
|
88869
88873
|
return createPrivateInstanceFieldInitializer(
|
|
88874
|
+
factory2,
|
|
88870
88875
|
receiver,
|
|
88871
88876
|
visitNode(property.initializer, initializerVisitor, isExpression),
|
|
88872
88877
|
privateIdentifierInfo.brandCheckIdentifier
|
|
88873
88878
|
);
|
|
88874
88879
|
} else {
|
|
88875
88880
|
return createPrivateStaticFieldInitializer(
|
|
88881
|
+
factory2,
|
|
88876
88882
|
privateIdentifierInfo.variableName,
|
|
88877
88883
|
visitNode(property.initializer, initializerVisitor, isExpression)
|
|
88878
88884
|
);
|
|
@@ -88954,7 +88960,7 @@ function transformClassFields(context) {
|
|
|
88954
88960
|
Debug.assert(weakSetName, "weakSetName should be set in private identifier environment");
|
|
88955
88961
|
statements.push(
|
|
88956
88962
|
factory2.createExpressionStatement(
|
|
88957
|
-
createPrivateInstanceMethodInitializer(receiver, weakSetName)
|
|
88963
|
+
createPrivateInstanceMethodInitializer(factory2, receiver, weakSetName)
|
|
88958
88964
|
)
|
|
88959
88965
|
);
|
|
88960
88966
|
}
|
|
@@ -89407,25 +89413,25 @@ function transformClassFields(context) {
|
|
|
89407
89413
|
return void 0;
|
|
89408
89414
|
}
|
|
89409
89415
|
}
|
|
89410
|
-
function createPrivateStaticFieldInitializer(variableName, initializer) {
|
|
89411
|
-
return
|
|
89416
|
+
function createPrivateStaticFieldInitializer(factory2, variableName, initializer) {
|
|
89417
|
+
return factory2.createAssignment(
|
|
89412
89418
|
variableName,
|
|
89413
|
-
|
|
89414
|
-
|
|
89419
|
+
factory2.createObjectLiteralExpression([
|
|
89420
|
+
factory2.createPropertyAssignment("value", initializer || factory2.createVoidZero())
|
|
89415
89421
|
])
|
|
89416
89422
|
);
|
|
89417
89423
|
}
|
|
89418
|
-
function createPrivateInstanceFieldInitializer(receiver, initializer, weakMapName) {
|
|
89419
|
-
return
|
|
89420
|
-
|
|
89424
|
+
function createPrivateInstanceFieldInitializer(factory2, receiver, initializer, weakMapName) {
|
|
89425
|
+
return factory2.createCallExpression(
|
|
89426
|
+
factory2.createPropertyAccessExpression(weakMapName, "set"),
|
|
89421
89427
|
/*typeArguments*/
|
|
89422
89428
|
void 0,
|
|
89423
|
-
[receiver, initializer ||
|
|
89429
|
+
[receiver, initializer || factory2.createVoidZero()]
|
|
89424
89430
|
);
|
|
89425
89431
|
}
|
|
89426
|
-
function createPrivateInstanceMethodInitializer(receiver, weakSetName) {
|
|
89427
|
-
return
|
|
89428
|
-
|
|
89432
|
+
function createPrivateInstanceMethodInitializer(factory2, receiver, weakSetName) {
|
|
89433
|
+
return factory2.createCallExpression(
|
|
89434
|
+
factory2.createPropertyAccessExpression(weakSetName, "add"),
|
|
89429
89435
|
/*typeArguments*/
|
|
89430
89436
|
void 0,
|
|
89431
89437
|
[receiver]
|
|
@@ -89441,6 +89447,7 @@ function isPrivateIdentifierInExpression(node) {
|
|
|
89441
89447
|
// src/compiler/transformers/typeSerializer.ts
|
|
89442
89448
|
function createRuntimeTypeSerializer(context) {
|
|
89443
89449
|
const {
|
|
89450
|
+
factory: factory2,
|
|
89444
89451
|
hoistVariableDeclaration
|
|
89445
89452
|
} = context;
|
|
89446
89453
|
const resolver = context.getEmitResolver();
|
|
@@ -89480,9 +89487,9 @@ function createRuntimeTypeSerializer(context) {
|
|
|
89480
89487
|
case 260 /* ClassDeclaration */:
|
|
89481
89488
|
case 228 /* ClassExpression */:
|
|
89482
89489
|
case 171 /* MethodDeclaration */:
|
|
89483
|
-
return
|
|
89490
|
+
return factory2.createIdentifier("Function");
|
|
89484
89491
|
default:
|
|
89485
|
-
return
|
|
89492
|
+
return factory2.createVoidZero();
|
|
89486
89493
|
}
|
|
89487
89494
|
}
|
|
89488
89495
|
function serializeParameterTypesOfNode(node, container) {
|
|
@@ -89503,7 +89510,7 @@ function createRuntimeTypeSerializer(context) {
|
|
|
89503
89510
|
}
|
|
89504
89511
|
}
|
|
89505
89512
|
}
|
|
89506
|
-
return
|
|
89513
|
+
return factory2.createArrayLiteralExpression(expressions);
|
|
89507
89514
|
}
|
|
89508
89515
|
function getParametersOfDecoratedDeclaration(node, container) {
|
|
89509
89516
|
if (container && node.kind === 174 /* GetAccessor */) {
|
|
@@ -89518,39 +89525,39 @@ function createRuntimeTypeSerializer(context) {
|
|
|
89518
89525
|
if (isFunctionLike(node) && node.type) {
|
|
89519
89526
|
return serializeTypeNode(node.type);
|
|
89520
89527
|
} else if (isAsyncFunction(node)) {
|
|
89521
|
-
return
|
|
89528
|
+
return factory2.createIdentifier("Promise");
|
|
89522
89529
|
}
|
|
89523
|
-
return
|
|
89530
|
+
return factory2.createVoidZero();
|
|
89524
89531
|
}
|
|
89525
89532
|
function serializeTypeNode(node) {
|
|
89526
89533
|
if (node === void 0) {
|
|
89527
|
-
return
|
|
89534
|
+
return factory2.createIdentifier("Object");
|
|
89528
89535
|
}
|
|
89529
89536
|
node = skipTypeParentheses(node);
|
|
89530
89537
|
switch (node.kind) {
|
|
89531
89538
|
case 114 /* VoidKeyword */:
|
|
89532
89539
|
case 155 /* UndefinedKeyword */:
|
|
89533
89540
|
case 144 /* NeverKeyword */:
|
|
89534
|
-
return
|
|
89541
|
+
return factory2.createVoidZero();
|
|
89535
89542
|
case 181 /* FunctionType */:
|
|
89536
89543
|
case 182 /* ConstructorType */:
|
|
89537
|
-
return
|
|
89544
|
+
return factory2.createIdentifier("Function");
|
|
89538
89545
|
case 185 /* ArrayType */:
|
|
89539
89546
|
case 186 /* TupleType */:
|
|
89540
|
-
return
|
|
89547
|
+
return factory2.createIdentifier("Array");
|
|
89541
89548
|
case 179 /* TypePredicate */:
|
|
89542
|
-
return node.assertsModifier ?
|
|
89549
|
+
return node.assertsModifier ? factory2.createVoidZero() : factory2.createIdentifier("Boolean");
|
|
89543
89550
|
case 134 /* BooleanKeyword */:
|
|
89544
|
-
return
|
|
89551
|
+
return factory2.createIdentifier("Boolean");
|
|
89545
89552
|
case 200 /* TemplateLiteralType */:
|
|
89546
89553
|
case 152 /* StringKeyword */:
|
|
89547
|
-
return
|
|
89554
|
+
return factory2.createIdentifier("String");
|
|
89548
89555
|
case 149 /* ObjectKeyword */:
|
|
89549
|
-
return
|
|
89556
|
+
return factory2.createIdentifier("Object");
|
|
89550
89557
|
case 198 /* LiteralType */:
|
|
89551
89558
|
return serializeLiteralOfLiteralTypeNode(node.literal);
|
|
89552
89559
|
case 148 /* NumberKeyword */:
|
|
89553
|
-
return
|
|
89560
|
+
return factory2.createIdentifier("Number");
|
|
89554
89561
|
case 160 /* BigIntKeyword */:
|
|
89555
89562
|
return getGlobalConstructor("BigInt", 7 /* ES2020 */);
|
|
89556
89563
|
case 153 /* SymbolKeyword */:
|
|
@@ -89602,13 +89609,13 @@ function createRuntimeTypeSerializer(context) {
|
|
|
89602
89609
|
default:
|
|
89603
89610
|
return Debug.failBadSyntaxKind(node);
|
|
89604
89611
|
}
|
|
89605
|
-
return
|
|
89612
|
+
return factory2.createIdentifier("Object");
|
|
89606
89613
|
}
|
|
89607
89614
|
function serializeLiteralOfLiteralTypeNode(node) {
|
|
89608
89615
|
switch (node.kind) {
|
|
89609
89616
|
case 10 /* StringLiteral */:
|
|
89610
89617
|
case 14 /* NoSubstitutionTemplateLiteral */:
|
|
89611
|
-
return
|
|
89618
|
+
return factory2.createIdentifier("String");
|
|
89612
89619
|
case 221 /* PrefixUnaryExpression */: {
|
|
89613
89620
|
const operand = node.operand;
|
|
89614
89621
|
switch (operand.kind) {
|
|
@@ -89620,14 +89627,14 @@ function createRuntimeTypeSerializer(context) {
|
|
|
89620
89627
|
}
|
|
89621
89628
|
}
|
|
89622
89629
|
case 8 /* NumericLiteral */:
|
|
89623
|
-
return
|
|
89630
|
+
return factory2.createIdentifier("Number");
|
|
89624
89631
|
case 9 /* BigIntLiteral */:
|
|
89625
89632
|
return getGlobalConstructor("BigInt", 7 /* ES2020 */);
|
|
89626
89633
|
case 110 /* TrueKeyword */:
|
|
89627
89634
|
case 95 /* FalseKeyword */:
|
|
89628
|
-
return
|
|
89635
|
+
return factory2.createIdentifier("Boolean");
|
|
89629
89636
|
case 104 /* NullKeyword */:
|
|
89630
|
-
return
|
|
89637
|
+
return factory2.createVoidZero();
|
|
89631
89638
|
default:
|
|
89632
89639
|
return Debug.failBadSyntaxKind(node);
|
|
89633
89640
|
}
|
|
@@ -89638,16 +89645,16 @@ function createRuntimeTypeSerializer(context) {
|
|
|
89638
89645
|
typeNode = skipTypeParentheses(typeNode);
|
|
89639
89646
|
if (typeNode.kind === 144 /* NeverKeyword */) {
|
|
89640
89647
|
if (isIntersection)
|
|
89641
|
-
return
|
|
89648
|
+
return factory2.createVoidZero();
|
|
89642
89649
|
continue;
|
|
89643
89650
|
}
|
|
89644
89651
|
if (typeNode.kind === 157 /* UnknownKeyword */) {
|
|
89645
89652
|
if (!isIntersection)
|
|
89646
|
-
return
|
|
89653
|
+
return factory2.createIdentifier("Object");
|
|
89647
89654
|
continue;
|
|
89648
89655
|
}
|
|
89649
89656
|
if (typeNode.kind === 131 /* AnyKeyword */) {
|
|
89650
|
-
return
|
|
89657
|
+
return factory2.createIdentifier("Object");
|
|
89651
89658
|
}
|
|
89652
89659
|
if (!strictNullChecks && (isLiteralTypeNode(typeNode) && typeNode.literal.kind === 104 /* NullKeyword */ || typeNode.kind === 155 /* UndefinedKeyword */)) {
|
|
89653
89660
|
continue;
|
|
@@ -89658,13 +89665,13 @@ function createRuntimeTypeSerializer(context) {
|
|
|
89658
89665
|
}
|
|
89659
89666
|
if (serializedType) {
|
|
89660
89667
|
if (!equateSerializedTypeNodes(serializedType, serializedConstituent)) {
|
|
89661
|
-
return
|
|
89668
|
+
return factory2.createIdentifier("Object");
|
|
89662
89669
|
}
|
|
89663
89670
|
} else {
|
|
89664
89671
|
serializedType = serializedConstituent;
|
|
89665
89672
|
}
|
|
89666
89673
|
}
|
|
89667
|
-
return serializedType != null ? serializedType :
|
|
89674
|
+
return serializedType != null ? serializedType : factory2.createVoidZero();
|
|
89668
89675
|
}
|
|
89669
89676
|
function equateSerializedTypeNodes(left, right) {
|
|
89670
89677
|
return (
|
|
@@ -89698,48 +89705,48 @@ function createRuntimeTypeSerializer(context) {
|
|
|
89698
89705
|
switch (kind) {
|
|
89699
89706
|
case 0 /* Unknown */:
|
|
89700
89707
|
if (findAncestor(node, (n) => n.parent && isConditionalTypeNode(n.parent) && (n.parent.trueType === n || n.parent.falseType === n))) {
|
|
89701
|
-
return
|
|
89708
|
+
return factory2.createIdentifier("Object");
|
|
89702
89709
|
}
|
|
89703
89710
|
const serialized = serializeEntityNameAsExpressionFallback(node.typeName);
|
|
89704
|
-
const temp =
|
|
89705
|
-
return
|
|
89706
|
-
|
|
89711
|
+
const temp = factory2.createTempVariable(hoistVariableDeclaration);
|
|
89712
|
+
return factory2.createConditionalExpression(
|
|
89713
|
+
factory2.createTypeCheck(factory2.createAssignment(temp, serialized), "function"),
|
|
89707
89714
|
/*questionToken*/
|
|
89708
89715
|
void 0,
|
|
89709
89716
|
temp,
|
|
89710
89717
|
/*colonToken*/
|
|
89711
89718
|
void 0,
|
|
89712
|
-
|
|
89719
|
+
factory2.createIdentifier("Object")
|
|
89713
89720
|
);
|
|
89714
89721
|
case 1 /* TypeWithConstructSignatureAndValue */:
|
|
89715
89722
|
return serializeEntityNameAsExpression(node.typeName);
|
|
89716
89723
|
case 2 /* VoidNullableOrNeverType */:
|
|
89717
|
-
return
|
|
89724
|
+
return factory2.createVoidZero();
|
|
89718
89725
|
case 4 /* BigIntLikeType */:
|
|
89719
89726
|
return getGlobalConstructor("BigInt", 7 /* ES2020 */);
|
|
89720
89727
|
case 6 /* BooleanType */:
|
|
89721
|
-
return
|
|
89728
|
+
return factory2.createIdentifier("Boolean");
|
|
89722
89729
|
case 3 /* NumberLikeType */:
|
|
89723
|
-
return
|
|
89730
|
+
return factory2.createIdentifier("Number");
|
|
89724
89731
|
case 5 /* StringLikeType */:
|
|
89725
|
-
return
|
|
89732
|
+
return factory2.createIdentifier("String");
|
|
89726
89733
|
case 7 /* ArrayLikeType */:
|
|
89727
|
-
return
|
|
89734
|
+
return factory2.createIdentifier("Array");
|
|
89728
89735
|
case 8 /* ESSymbolType */:
|
|
89729
89736
|
return getGlobalConstructor("Symbol", 2 /* ES2015 */);
|
|
89730
89737
|
case 10 /* TypeWithCallSignature */:
|
|
89731
|
-
return
|
|
89738
|
+
return factory2.createIdentifier("Function");
|
|
89732
89739
|
case 9 /* Promise */:
|
|
89733
|
-
return
|
|
89740
|
+
return factory2.createIdentifier("Promise");
|
|
89734
89741
|
case 11 /* ObjectType */:
|
|
89735
|
-
return
|
|
89742
|
+
return factory2.createIdentifier("Object");
|
|
89736
89743
|
default:
|
|
89737
89744
|
return Debug.assertNever(kind);
|
|
89738
89745
|
}
|
|
89739
89746
|
}
|
|
89740
89747
|
function createCheckedValue(left, right) {
|
|
89741
|
-
return
|
|
89742
|
-
|
|
89748
|
+
return factory2.createLogicalAnd(
|
|
89749
|
+
factory2.createStrictInequality(factory2.createTypeOfExpression(left), factory2.createStringLiteral("undefined")),
|
|
89743
89750
|
right
|
|
89744
89751
|
);
|
|
89745
89752
|
}
|
|
@@ -89752,13 +89759,13 @@ function createRuntimeTypeSerializer(context) {
|
|
|
89752
89759
|
return createCheckedValue(serializeEntityNameAsExpression(node.left), serializeEntityNameAsExpression(node));
|
|
89753
89760
|
}
|
|
89754
89761
|
const left = serializeEntityNameAsExpressionFallback(node.left);
|
|
89755
|
-
const temp =
|
|
89756
|
-
return
|
|
89757
|
-
|
|
89762
|
+
const temp = factory2.createTempVariable(hoistVariableDeclaration);
|
|
89763
|
+
return factory2.createLogicalAnd(
|
|
89764
|
+
factory2.createLogicalAnd(
|
|
89758
89765
|
left.left,
|
|
89759
|
-
|
|
89766
|
+
factory2.createStrictInequality(factory2.createAssignment(temp, left.right), factory2.createVoidZero())
|
|
89760
89767
|
),
|
|
89761
|
-
|
|
89768
|
+
factory2.createPropertyAccessExpression(temp, node.right)
|
|
89762
89769
|
);
|
|
89763
89770
|
}
|
|
89764
89771
|
function serializeEntityNameAsExpression(node) {
|
|
@@ -89773,21 +89780,21 @@ function createRuntimeTypeSerializer(context) {
|
|
|
89773
89780
|
}
|
|
89774
89781
|
}
|
|
89775
89782
|
function serializeQualifiedNameAsExpression(node) {
|
|
89776
|
-
return
|
|
89783
|
+
return factory2.createPropertyAccessExpression(serializeEntityNameAsExpression(node.left), node.right);
|
|
89777
89784
|
}
|
|
89778
89785
|
function getGlobalConstructorWithFallback(name) {
|
|
89779
|
-
return
|
|
89780
|
-
|
|
89786
|
+
return factory2.createConditionalExpression(
|
|
89787
|
+
factory2.createTypeCheck(factory2.createIdentifier(name), "function"),
|
|
89781
89788
|
/*questionToken*/
|
|
89782
89789
|
void 0,
|
|
89783
|
-
|
|
89790
|
+
factory2.createIdentifier(name),
|
|
89784
89791
|
/*colonToken*/
|
|
89785
89792
|
void 0,
|
|
89786
|
-
|
|
89793
|
+
factory2.createIdentifier("Object")
|
|
89787
89794
|
);
|
|
89788
89795
|
}
|
|
89789
89796
|
function getGlobalConstructor(name, minLanguageVersion) {
|
|
89790
|
-
return languageVersion < minLanguageVersion ? getGlobalConstructorWithFallback(name) :
|
|
89797
|
+
return languageVersion < minLanguageVersion ? getGlobalConstructorWithFallback(name) : factory2.createIdentifier(name);
|
|
89791
89798
|
}
|
|
89792
89799
|
}
|
|
89793
89800
|
|
|
@@ -103832,7 +103839,7 @@ function transformNodeModule(context) {
|
|
|
103832
103839
|
|
|
103833
103840
|
// src/compiler/transformers/declarations/diagnostics.ts
|
|
103834
103841
|
function canProduceDiagnostics(node) {
|
|
103835
|
-
return isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isBindingElement(node) || isSetAccessor(node) || isGetAccessor(node) || isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isParameter(node) || isTypeParameterDeclaration(node) || isExpressionWithTypeArguments(node) || isImportEqualsDeclaration(node) || isTypeAliasDeclaration(node) || isConstructorDeclaration(node) || isIndexSignatureDeclaration(node) || isPropertyAccessExpression(node) || isJSDocTypeAlias(node);
|
|
103842
|
+
return isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isBindingElement(node) || isSetAccessor(node) || isGetAccessor(node) || isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isParameter(node) || isTypeParameterDeclaration(node) || isExpressionWithTypeArguments(node) || isImportEqualsDeclaration(node) || isTypeAliasDeclaration(node) || isConstructorDeclaration(node) || isIndexSignatureDeclaration(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isJSDocTypeAlias(node);
|
|
103836
103843
|
}
|
|
103837
103844
|
function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
|
|
103838
103845
|
if (isSetAccessor(node) || isGetAccessor(node)) {
|
|
@@ -103878,7 +103885,7 @@ function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
|
|
|
103878
103885
|
}
|
|
103879
103886
|
}
|
|
103880
103887
|
function createGetSymbolAccessibilityDiagnosticForNode(node) {
|
|
103881
|
-
if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isPropertyAccessExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
|
|
103888
|
+
if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
|
|
103882
103889
|
return getVariableDeclarationTypeVisibilityError;
|
|
103883
103890
|
} else if (isSetAccessor(node) || isGetAccessor(node)) {
|
|
103884
103891
|
return getAccessorDeclarationTypeVisibilityError;
|
|
@@ -103903,7 +103910,7 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
|
|
|
103903
103910
|
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
|
|
103904
103911
|
if (node.kind === 257 /* VariableDeclaration */ || node.kind === 205 /* BindingElement */) {
|
|
103905
103912
|
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Exported_variable_0_has_or_is_using_private_name_1;
|
|
103906
|
-
} else if (node.kind === 169 /* PropertyDeclaration */ || node.kind === 208 /* PropertyAccessExpression */ || node.kind === 168 /* PropertySignature */ || node.kind === 166 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
|
|
103913
|
+
} else if (node.kind === 169 /* PropertyDeclaration */ || node.kind === 208 /* PropertyAccessExpression */ || node.kind === 209 /* ElementAccessExpression */ || node.kind === 223 /* BinaryExpression */ || node.kind === 168 /* PropertySignature */ || node.kind === 166 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
|
|
103907
103914
|
if (isStatic(node)) {
|
|
103908
103915
|
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;
|
|
103909
103916
|
} else if (node.parent.kind === 260 /* ClassDeclaration */ || node.kind === 166 /* Parameter */) {
|
|
@@ -104618,7 +104625,7 @@ function transformDeclarations(context) {
|
|
|
104618
104625
|
}
|
|
104619
104626
|
const newParam = factory2.updateParameterDeclaration(
|
|
104620
104627
|
p,
|
|
104621
|
-
maskModifiers(p, modifierMask),
|
|
104628
|
+
maskModifiers(factory2, p, modifierMask),
|
|
104622
104629
|
p.dotDotDotToken,
|
|
104623
104630
|
filterBindingPatternInitializersAndRenamings(p.name),
|
|
104624
104631
|
resolver.isOptionalParameter(p) ? p.questionToken || factory2.createToken(57 /* QuestionToken */) : void 0,
|
|
@@ -105356,13 +105363,16 @@ function transformDeclarations(context) {
|
|
|
105356
105363
|
fakespace.symbol = props[0].parent;
|
|
105357
105364
|
const exportMappings = [];
|
|
105358
105365
|
let declarations = mapDefined(props, (p) => {
|
|
105359
|
-
if (!p.valueDeclaration || !isPropertyAccessExpression(p.valueDeclaration)) {
|
|
105366
|
+
if (!p.valueDeclaration || !(isPropertyAccessExpression(p.valueDeclaration) || isElementAccessExpression(p.valueDeclaration) || isBinaryExpression(p.valueDeclaration))) {
|
|
105367
|
+
return void 0;
|
|
105368
|
+
}
|
|
105369
|
+
const nameStr = unescapeLeadingUnderscores(p.escapedName);
|
|
105370
|
+
if (!isIdentifierText(nameStr, 99 /* ESNext */)) {
|
|
105360
105371
|
return void 0;
|
|
105361
105372
|
}
|
|
105362
105373
|
getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(p.valueDeclaration);
|
|
105363
105374
|
const type = resolver.createTypeOfDeclaration(p.valueDeclaration, fakespace, declarationEmitNodeBuilderFlags, symbolTracker);
|
|
105364
105375
|
getSymbolAccessibilityDiagnostic = oldDiag;
|
|
105365
|
-
const nameStr = unescapeLeadingUnderscores(p.escapedName);
|
|
105366
105376
|
const isNonContextualKeywordName = isStringANonContextualKeyword(nameStr);
|
|
105367
105377
|
const name = isNonContextualKeywordName ? factory2.getGeneratedNameForNode(p.valueDeclaration) : factory2.createIdentifier(nameStr);
|
|
105368
105378
|
if (isNonContextualKeywordName) {
|
|
@@ -105732,8 +105742,8 @@ function isAlwaysType(node) {
|
|
|
105732
105742
|
}
|
|
105733
105743
|
return false;
|
|
105734
105744
|
}
|
|
105735
|
-
function maskModifiers(node, modifierMask, modifierAdditions) {
|
|
105736
|
-
return
|
|
105745
|
+
function maskModifiers(factory2, node, modifierMask, modifierAdditions) {
|
|
105746
|
+
return factory2.createModifiersFromModifierFlags(maskModifierFlags(node, modifierMask, modifierAdditions));
|
|
105737
105747
|
}
|
|
105738
105748
|
function maskModifierFlags(node, modifierMask = 258047 /* All */ ^ 4 /* Public */, modifierAdditions = 0 /* None */) {
|
|
105739
105749
|
let flags = getEffectiveModifierFlags(node) & modifierMask | modifierAdditions;
|
|
@@ -115341,7 +115351,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
115341
115351
|
const version2 = typeScriptVersion2 || versionMajorMinor;
|
|
115342
115352
|
const ignoreDeprecations = options.ignoreDeprecations;
|
|
115343
115353
|
if (ignoreDeprecations) {
|
|
115344
|
-
if (ignoreDeprecations === "5.0" /* v5_0 */ &&
|
|
115354
|
+
if (ignoreDeprecations === "5.0" /* v5_0 */ && version2.startsWith("5.")) {
|
|
115345
115355
|
return;
|
|
115346
115356
|
} else if (reportInvalidIgnoreDeprecations) {
|
|
115347
115357
|
createOptionValueDiagnostic("ignoreDeprecations", Diagnostics.Invalid_value_for_ignoreDeprecations);
|