Skip to content

Commit e2a5d45

Browse files
Update LKG.
1 parent 756efd2 commit e2a5d45

File tree

4 files changed

+47
-64
lines changed

4 files changed

+47
-64
lines changed

lib/tsc.js

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ and limitations under the License.
1818

1919
// src/compiler/corePublic.ts
2020
var versionMajorMinor = "5.3";
21-
var version = "5.3.1-rc";
21+
var version = "5.3.2";
2222

2323
// src/compiler/core.ts
2424
var emptyArray = [];
@@ -10961,7 +10961,7 @@ function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) {
1096110961
return kind === 211 /* PropertyAccessExpression */ || kind === 166 /* QualifiedName */ || kind === 205 /* ImportType */;
1096210962
}
1096310963
function isCallLikeOrFunctionLikeExpression(node) {
10964-
return isCallLikeExpression(node) || isFunctionLike(node);
10964+
return isCallLikeExpression(node) || isFunctionExpressionOrArrowFunction(node);
1096510965
}
1096610966
function isCallLikeExpression(node) {
1096710967
switch (node.kind) {
@@ -18823,10 +18823,8 @@ function createNodeFactory(flags, baseFactory2) {
1882318823
return update(updated, original);
1882418824
}
1882518825
function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
18826-
const text = typeof value === "number" ? value + "" : value;
18827-
Debug.assert(text.charCodeAt(0) !== 45 /* minus */, "Negative numbers should be created in combination with createPrefixUnaryExpression");
1882818826
const node = createBaseDeclaration(9 /* NumericLiteral */);
18829-
node.text = text;
18827+
node.text = typeof value === "number" ? value + "" : value;
1883018828
node.numericLiteralFlags = numericLiteralFlags;
1883118829
if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
1883218830
node.transformFlags |= 1024 /* ContainsES2015 */;
@@ -43682,7 +43680,7 @@ function createTypeChecker(host) {
4368243680
const nodeLinks2 = getNodeLinks(node);
4368343681
cachedResolvedSignatures.push([nodeLinks2, nodeLinks2.resolvedSignature]);
4368443682
nodeLinks2.resolvedSignature = void 0;
43685-
if (isFunctionLike(node)) {
43683+
if (isFunctionExpressionOrArrowFunction(node)) {
4368643684
const symbolLinks2 = getSymbolLinks(getSymbolOfDeclaration(node));
4368743685
const type = symbolLinks2.type;
4368843686
cachedTypes2.push([symbolLinks2, type]);
@@ -48243,6 +48241,8 @@ function createTypeChecker(host) {
4824348241
context.symbolDepth.set(id, depth + 1);
4824448242
}
4824548243
context.visitedTypes.add(typeId);
48244+
const prevTrackedSymbols = context.trackedSymbols;
48245+
context.trackedSymbols = void 0;
4824648246
const startLength = context.approximateLength;
4824748247
const result = transform(type2);
4824848248
const addedLength = context.approximateLength - startLength;
@@ -48258,6 +48258,7 @@ function createTypeChecker(host) {
4825848258
if (id) {
4825948259
context.symbolDepth.set(id, depth);
4826048260
}
48261+
context.trackedSymbols = prevTrackedSymbols;
4826148262
return result;
4826248263
function deepCloneOrReuseNode(node) {
4826348264
if (!nodeIsSynthesized(node) && getParseTreeNode(node) === node) {
@@ -48560,7 +48561,7 @@ function createTypeChecker(host) {
4856048561
context.approximateLength += symbolName(propertySymbol).length + 1;
4856148562
if (propertySymbol.flags & 98304 /* Accessor */) {
4856248563
const writeType = getWriteTypeOfSymbol(propertySymbol);
48563-
if (propertyType !== writeType) {
48564+
if (propertyType !== writeType && !isErrorType(propertyType) && !isErrorType(writeType)) {
4856448565
const getterDeclaration = getDeclarationOfKind(propertySymbol, 177 /* GetAccessor */);
4856548566
const getterSignature = getSignatureFromDeclaration(getterDeclaration);
4856648567
typeElements.push(
@@ -49483,7 +49484,7 @@ function createTypeChecker(host) {
4948349484
return factory.createStringLiteral(name, !!singleQuote);
4948449485
}
4948549486
if (isNumericLiteralName(name) && startsWith(name, "-")) {
49486-
return factory.createComputedPropertyName(factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createNumericLiteral(Math.abs(+name))));
49487+
return factory.createComputedPropertyName(factory.createNumericLiteral(+name));
4948749488
}
4948849489
return createPropertyNameNodeForIdentifierOrLiteral(name, getEmitScriptTarget(compilerOptions), singleQuote, stringNamed, isMethod);
4948949490
}
@@ -75350,14 +75351,9 @@ function createTypeChecker(host) {
7535075351
case 15 /* NoSubstitutionTemplateLiteral */:
7535175352
case 11 /* StringLiteral */:
7535275353
return hasSkipDirectInferenceFlag(node) ? blockedStringType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
75353-
case 9 /* NumericLiteral */: {
75354+
case 9 /* NumericLiteral */:
7535475355
checkGrammarNumericLiteral(node);
75355-
const value = +node.text;
75356-
if (!isFinite(value)) {
75357-
return numberType;
75358-
}
75359-
return getFreshTypeOfLiteralType(getNumberLiteralType(value));
75360-
}
75356+
return getFreshTypeOfLiteralType(getNumberLiteralType(+node.text));
7536175357
case 10 /* BigIntLiteral */:
7536275358
checkGrammarBigIntLiteral(node);
7536375359
return getFreshTypeOfLiteralType(getBigIntLiteralType({
@@ -82358,7 +82354,7 @@ function createTypeChecker(host) {
8235882354
if (enumResult)
8235982355
return enumResult;
8236082356
const literalValue = type.value;
82361-
return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "string" ? factory.createStringLiteral(literalValue) : literalValue < 0 ? factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createNumericLiteral(Math.abs(literalValue))) : factory.createNumericLiteral(literalValue);
82357+
return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "number" ? factory.createNumericLiteral(literalValue) : factory.createStringLiteral(literalValue);
8236282358
}
8236382359
function createLiteralConstValue(node, tracker) {
8236482360
const type = getTypeOfSymbol(getSymbolOfDeclaration(node));
@@ -88781,7 +88777,7 @@ function transformTypeScript(context) {
8878188777
function transformEnumMemberDeclarationValue(member) {
8878288778
const value = resolver.getConstantValue(member);
8878388779
if (value !== void 0) {
88784-
return typeof value === "string" ? factory2.createStringLiteral(value) : value < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(Math.abs(value))) : factory2.createNumericLiteral(value);
88780+
return typeof value === "string" ? factory2.createStringLiteral(value) : factory2.createNumericLiteral(value);
8878588781
} else {
8878688782
enableSubstitutionForNonQualifiedEnumMembers();
8878788783
if (member.initializer) {
@@ -102959,7 +102955,7 @@ function transformGenerators(context) {
102959102955
if (labelExpressions === void 0) {
102960102956
labelExpressions = [];
102961102957
}
102962-
const expression = factory2.createNumericLiteral(Number.MAX_SAFE_INTEGER);
102958+
const expression = factory2.createNumericLiteral(-1);
102963102959
if (labelExpressions[label] === void 0) {
102964102960
labelExpressions[label] = [expression];
102965102961
} else {
@@ -108834,8 +108830,7 @@ function transformDeclarations(context) {
108834108830
if (shouldStripInternal(m))
108835108831
return;
108836108832
const constValue = resolver.getConstantValue(m);
108837-
const newInitializer = constValue === void 0 ? void 0 : typeof constValue === "string" ? factory2.createStringLiteral(constValue) : constValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(Math.abs(constValue))) : factory2.createNumericLiteral(constValue);
108838-
return preserveJsDoc(factory2.updateEnumMember(m, m.name, newInitializer), m);
108833+
return preserveJsDoc(factory2.updateEnumMember(m, m.name, constValue !== void 0 ? typeof constValue === "string" ? factory2.createStringLiteral(constValue) : factory2.createNumericLiteral(constValue) : void 0), m);
108839108834
}))
108840108835
));
108841108836
}

lib/tsserver.js

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2328,7 +2328,7 @@ module.exports = __toCommonJS(server_exports);
23282328

23292329
// src/compiler/corePublic.ts
23302330
var versionMajorMinor = "5.3";
2331-
var version = "5.3.1-rc";
2331+
var version = "5.3.2";
23322332
var Comparison = /* @__PURE__ */ ((Comparison3) => {
23332333
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
23342334
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -14639,7 +14639,7 @@ function isPropertyAccessOrQualifiedName(node) {
1463914639
return kind === 211 /* PropertyAccessExpression */ || kind === 166 /* QualifiedName */;
1464014640
}
1464114641
function isCallLikeOrFunctionLikeExpression(node) {
14642-
return isCallLikeExpression(node) || isFunctionLike(node);
14642+
return isCallLikeExpression(node) || isFunctionExpressionOrArrowFunction(node);
1464314643
}
1464414644
function isCallLikeExpression(node) {
1464514645
switch (node.kind) {
@@ -23031,10 +23031,8 @@ function createNodeFactory(flags, baseFactory2) {
2303123031
return update(updated, original);
2303223032
}
2303323033
function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
23034-
const text = typeof value === "number" ? value + "" : value;
23035-
Debug.assert(text.charCodeAt(0) !== 45 /* minus */, "Negative numbers should be created in combination with createPrefixUnaryExpression");
2303623034
const node = createBaseDeclaration(9 /* NumericLiteral */);
23037-
node.text = text;
23035+
node.text = typeof value === "number" ? value + "" : value;
2303823036
node.numericLiteralFlags = numericLiteralFlags;
2303923037
if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
2304023038
node.transformFlags |= 1024 /* ContainsES2015 */;
@@ -48386,7 +48384,7 @@ function createTypeChecker(host) {
4838648384
const nodeLinks2 = getNodeLinks(node);
4838748385
cachedResolvedSignatures.push([nodeLinks2, nodeLinks2.resolvedSignature]);
4838848386
nodeLinks2.resolvedSignature = void 0;
48389-
if (isFunctionLike(node)) {
48387+
if (isFunctionExpressionOrArrowFunction(node)) {
4839048388
const symbolLinks2 = getSymbolLinks(getSymbolOfDeclaration(node));
4839148389
const type = symbolLinks2.type;
4839248390
cachedTypes2.push([symbolLinks2, type]);
@@ -52947,6 +52945,8 @@ function createTypeChecker(host) {
5294752945
context.symbolDepth.set(id, depth + 1);
5294852946
}
5294952947
context.visitedTypes.add(typeId);
52948+
const prevTrackedSymbols = context.trackedSymbols;
52949+
context.trackedSymbols = void 0;
5295052950
const startLength = context.approximateLength;
5295152951
const result = transform2(type2);
5295252952
const addedLength = context.approximateLength - startLength;
@@ -52962,6 +52962,7 @@ function createTypeChecker(host) {
5296252962
if (id) {
5296352963
context.symbolDepth.set(id, depth);
5296452964
}
52965+
context.trackedSymbols = prevTrackedSymbols;
5296552966
return result;
5296652967
function deepCloneOrReuseNode(node) {
5296752968
if (!nodeIsSynthesized(node) && getParseTreeNode(node) === node) {
@@ -53264,7 +53265,7 @@ function createTypeChecker(host) {
5326453265
context.approximateLength += symbolName(propertySymbol).length + 1;
5326553266
if (propertySymbol.flags & 98304 /* Accessor */) {
5326653267
const writeType = getWriteTypeOfSymbol(propertySymbol);
53267-
if (propertyType !== writeType) {
53268+
if (propertyType !== writeType && !isErrorType(propertyType) && !isErrorType(writeType)) {
5326853269
const getterDeclaration = getDeclarationOfKind(propertySymbol, 177 /* GetAccessor */);
5326953270
const getterSignature = getSignatureFromDeclaration(getterDeclaration);
5327053271
typeElements.push(
@@ -54187,7 +54188,7 @@ function createTypeChecker(host) {
5418754188
return factory.createStringLiteral(name, !!singleQuote);
5418854189
}
5418954190
if (isNumericLiteralName(name) && startsWith(name, "-")) {
54190-
return factory.createComputedPropertyName(factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createNumericLiteral(Math.abs(+name))));
54191+
return factory.createComputedPropertyName(factory.createNumericLiteral(+name));
5419154192
}
5419254193
return createPropertyNameNodeForIdentifierOrLiteral(name, getEmitScriptTarget(compilerOptions), singleQuote, stringNamed, isMethod);
5419354194
}
@@ -80054,14 +80055,9 @@ function createTypeChecker(host) {
8005480055
case 15 /* NoSubstitutionTemplateLiteral */:
8005580056
case 11 /* StringLiteral */:
8005680057
return hasSkipDirectInferenceFlag(node) ? blockedStringType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
80057-
case 9 /* NumericLiteral */: {
80058+
case 9 /* NumericLiteral */:
8005880059
checkGrammarNumericLiteral(node);
80059-
const value = +node.text;
80060-
if (!isFinite(value)) {
80061-
return numberType;
80062-
}
80063-
return getFreshTypeOfLiteralType(getNumberLiteralType(value));
80064-
}
80060+
return getFreshTypeOfLiteralType(getNumberLiteralType(+node.text));
8006580061
case 10 /* BigIntLiteral */:
8006680062
checkGrammarBigIntLiteral(node);
8006780063
return getFreshTypeOfLiteralType(getBigIntLiteralType({
@@ -87062,7 +87058,7 @@ function createTypeChecker(host) {
8706287058
if (enumResult)
8706387059
return enumResult;
8706487060
const literalValue = type.value;
87065-
return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "string" ? factory.createStringLiteral(literalValue) : literalValue < 0 ? factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createNumericLiteral(Math.abs(literalValue))) : factory.createNumericLiteral(literalValue);
87061+
return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "number" ? factory.createNumericLiteral(literalValue) : factory.createStringLiteral(literalValue);
8706687062
}
8706787063
function createLiteralConstValue(node, tracker) {
8706887064
const type = getTypeOfSymbol(getSymbolOfDeclaration(node));
@@ -93656,7 +93652,7 @@ function transformTypeScript(context) {
9365693652
function transformEnumMemberDeclarationValue(member) {
9365793653
const value = resolver.getConstantValue(member);
9365893654
if (value !== void 0) {
93659-
return typeof value === "string" ? factory2.createStringLiteral(value) : value < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(Math.abs(value))) : factory2.createNumericLiteral(value);
93655+
return typeof value === "string" ? factory2.createStringLiteral(value) : factory2.createNumericLiteral(value);
9366093656
} else {
9366193657
enableSubstitutionForNonQualifiedEnumMembers();
9366293658
if (member.initializer) {
@@ -107834,7 +107830,7 @@ function transformGenerators(context) {
107834107830
if (labelExpressions === void 0) {
107835107831
labelExpressions = [];
107836107832
}
107837-
const expression = factory2.createNumericLiteral(Number.MAX_SAFE_INTEGER);
107833+
const expression = factory2.createNumericLiteral(-1);
107838107834
if (labelExpressions[label] === void 0) {
107839107835
labelExpressions[label] = [expression];
107840107836
} else {
@@ -113709,8 +113705,7 @@ function transformDeclarations(context) {
113709113705
if (shouldStripInternal(m))
113710113706
return;
113711113707
const constValue = resolver.getConstantValue(m);
113712-
const newInitializer = constValue === void 0 ? void 0 : typeof constValue === "string" ? factory2.createStringLiteral(constValue) : constValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(Math.abs(constValue))) : factory2.createNumericLiteral(constValue);
113713-
return preserveJsDoc(factory2.updateEnumMember(m, m.name, newInitializer), m);
113708+
return preserveJsDoc(factory2.updateEnumMember(m, m.name, constValue !== void 0 ? typeof constValue === "string" ? factory2.createStringLiteral(constValue) : factory2.createNumericLiteral(constValue) : void 0), m);
113714113709
}))
113715113710
));
113716113711
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy