Skip to content

Commit 2dd4c8a

Browse files
committed
Update LKG
1 parent 9d2656f commit 2dd4c8a

File tree

5 files changed

+70
-15
lines changed

5 files changed

+70
-15
lines changed

lib/tsc.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31272,6 +31272,7 @@ var ts;
3127231272
var spread = emptyObjectType;
3127331273
var attributesArray = [];
3127431274
var hasSpreadAnyType = false;
31275+
var typeToIntersect;
3127531276
var explicitlySpecifyChildrenAttribute = false;
3127631277
var jsxChildrenPropertyName = getJsxElementChildrenPropertyname();
3127731278
for (var _i = 0, _a = attributes.properties; _i < _a.length; _i++) {
@@ -31302,11 +31303,16 @@ var ts;
3130231303
attributesArray = [];
3130331304
attributesTable = ts.createMap();
3130431305
}
31305-
var exprType = getApparentType(checkExpression(attributeDecl.expression));
31306+
var exprType = checkExpression(attributeDecl.expression);
3130631307
if (isTypeAny(exprType)) {
3130731308
hasSpreadAnyType = true;
3130831309
}
31309-
spread = getSpreadType(spread, exprType);
31310+
if (isValidSpreadType(exprType)) {
31311+
spread = getSpreadType(spread, exprType);
31312+
}
31313+
else {
31314+
typeToIntersect = typeToIntersect ? getIntersectionType([typeToIntersect, exprType]) : exprType;
31315+
}
3131031316
}
3131131317
}
3131231318
if (!hasSpreadAnyType) {
@@ -31352,7 +31358,12 @@ var ts;
3135231358
attributesTable.set(jsxChildrenPropertyName, childrenPropSymbol);
3135331359
}
3135431360
}
31355-
return hasSpreadAnyType ? anyType : createJsxAttributesType(attributes.symbol, attributesTable);
31361+
if (hasSpreadAnyType) {
31362+
return anyType;
31363+
}
31364+
var attributeType = createJsxAttributesType(attributes.symbol, attributesTable);
31365+
return typeToIntersect && attributesTable.size ? getIntersectionType([typeToIntersect, attributeType]) :
31366+
typeToIntersect ? typeToIntersect : attributeType;
3135631367
function createJsxAttributesType(symbol, attributesTable) {
3135731368
var result = createAnonymousType(symbol, attributesTable, emptyArray, emptyArray, undefined, undefined);
3135831369
result.flags |= 33554432 | 4194304;

lib/tsserver.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32436,6 +32436,7 @@ var ts;
3243632436
var spread = emptyObjectType;
3243732437
var attributesArray = [];
3243832438
var hasSpreadAnyType = false;
32439+
var typeToIntersect;
3243932440
var explicitlySpecifyChildrenAttribute = false;
3244032441
var jsxChildrenPropertyName = getJsxElementChildrenPropertyname();
3244132442
for (var _i = 0, _a = attributes.properties; _i < _a.length; _i++) {
@@ -32466,11 +32467,16 @@ var ts;
3246632467
attributesArray = [];
3246732468
attributesTable = ts.createMap();
3246832469
}
32469-
var exprType = getApparentType(checkExpression(attributeDecl.expression));
32470+
var exprType = checkExpression(attributeDecl.expression);
3247032471
if (isTypeAny(exprType)) {
3247132472
hasSpreadAnyType = true;
3247232473
}
32473-
spread = getSpreadType(spread, exprType);
32474+
if (isValidSpreadType(exprType)) {
32475+
spread = getSpreadType(spread, exprType);
32476+
}
32477+
else {
32478+
typeToIntersect = typeToIntersect ? getIntersectionType([typeToIntersect, exprType]) : exprType;
32479+
}
3247432480
}
3247532481
}
3247632482
if (!hasSpreadAnyType) {
@@ -32516,7 +32522,12 @@ var ts;
3251632522
attributesTable.set(jsxChildrenPropertyName, childrenPropSymbol);
3251732523
}
3251832524
}
32519-
return hasSpreadAnyType ? anyType : createJsxAttributesType(attributes.symbol, attributesTable);
32525+
if (hasSpreadAnyType) {
32526+
return anyType;
32527+
}
32528+
var attributeType = createJsxAttributesType(attributes.symbol, attributesTable);
32529+
return typeToIntersect && attributesTable.size ? getIntersectionType([typeToIntersect, attributeType]) :
32530+
typeToIntersect ? typeToIntersect : attributeType;
3252032531
function createJsxAttributesType(symbol, attributesTable) {
3252132532
var result = createAnonymousType(symbol, attributesTable, emptyArray, emptyArray, undefined, undefined);
3252232533
result.flags |= 33554432 | 4194304;

lib/tsserverlibrary.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33782,6 +33782,7 @@ var ts;
3378233782
var spread = emptyObjectType;
3378333783
var attributesArray = [];
3378433784
var hasSpreadAnyType = false;
33785+
var typeToIntersect;
3378533786
var explicitlySpecifyChildrenAttribute = false;
3378633787
var jsxChildrenPropertyName = getJsxElementChildrenPropertyname();
3378733788
for (var _i = 0, _a = attributes.properties; _i < _a.length; _i++) {
@@ -33812,11 +33813,16 @@ var ts;
3381233813
attributesArray = [];
3381333814
attributesTable = ts.createMap();
3381433815
}
33815-
var exprType = getApparentType(checkExpression(attributeDecl.expression));
33816+
var exprType = checkExpression(attributeDecl.expression);
3381633817
if (isTypeAny(exprType)) {
3381733818
hasSpreadAnyType = true;
3381833819
}
33819-
spread = getSpreadType(spread, exprType);
33820+
if (isValidSpreadType(exprType)) {
33821+
spread = getSpreadType(spread, exprType);
33822+
}
33823+
else {
33824+
typeToIntersect = typeToIntersect ? getIntersectionType([typeToIntersect, exprType]) : exprType;
33825+
}
3382033826
}
3382133827
}
3382233828
if (!hasSpreadAnyType) {
@@ -33862,7 +33868,12 @@ var ts;
3386233868
attributesTable.set(jsxChildrenPropertyName, childrenPropSymbol);
3386333869
}
3386433870
}
33865-
return hasSpreadAnyType ? anyType : createJsxAttributesType(attributes.symbol, attributesTable);
33871+
if (hasSpreadAnyType) {
33872+
return anyType;
33873+
}
33874+
var attributeType = createJsxAttributesType(attributes.symbol, attributesTable);
33875+
return typeToIntersect && attributesTable.size ? getIntersectionType([typeToIntersect, attributeType]) :
33876+
typeToIntersect ? typeToIntersect : attributeType;
3386633877
function createJsxAttributesType(symbol, attributesTable) {
3386733878
var result = createAnonymousType(symbol, attributesTable, emptyArray, emptyArray, undefined, undefined);
3386833879
result.flags |= 33554432 | 4194304;

lib/typescript.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37595,6 +37595,7 @@ var ts;
3759537595
var spread = emptyObjectType;
3759637596
var attributesArray = [];
3759737597
var hasSpreadAnyType = false;
37598+
var typeToIntersect;
3759837599
var explicitlySpecifyChildrenAttribute = false;
3759937600
var jsxChildrenPropertyName = getJsxElementChildrenPropertyname();
3760037601
for (var _i = 0, _a = attributes.properties; _i < _a.length; _i++) {
@@ -37625,11 +37626,16 @@ var ts;
3762537626
attributesArray = [];
3762637627
attributesTable = ts.createMap();
3762737628
}
37628-
var exprType = getApparentType(checkExpression(attributeDecl.expression));
37629+
var exprType = checkExpression(attributeDecl.expression);
3762937630
if (isTypeAny(exprType)) {
3763037631
hasSpreadAnyType = true;
3763137632
}
37632-
spread = getSpreadType(spread, exprType);
37633+
if (isValidSpreadType(exprType)) {
37634+
spread = getSpreadType(spread, exprType);
37635+
}
37636+
else {
37637+
typeToIntersect = typeToIntersect ? getIntersectionType([typeToIntersect, exprType]) : exprType;
37638+
}
3763337639
}
3763437640
}
3763537641
if (!hasSpreadAnyType) {
@@ -37683,7 +37689,12 @@ var ts;
3768337689
attributesTable.set(jsxChildrenPropertyName, childrenPropSymbol);
3768437690
}
3768537691
}
37686-
return hasSpreadAnyType ? anyType : createJsxAttributesType(attributes.symbol, attributesTable);
37692+
if (hasSpreadAnyType) {
37693+
return anyType;
37694+
}
37695+
var attributeType = createJsxAttributesType(attributes.symbol, attributesTable);
37696+
return typeToIntersect && attributesTable.size ? getIntersectionType([typeToIntersect, attributeType]) :
37697+
typeToIntersect ? typeToIntersect : attributeType;
3768737698
/**
3768837699
* Create anonymous type from given attributes symbol table.
3768937700
* @param symbol a symbol of JsxAttributes containing attributes corresponding to attributesTable

lib/typescriptServices.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37595,6 +37595,7 @@ var ts;
3759537595
var spread = emptyObjectType;
3759637596
var attributesArray = [];
3759737597
var hasSpreadAnyType = false;
37598+
var typeToIntersect;
3759837599
var explicitlySpecifyChildrenAttribute = false;
3759937600
var jsxChildrenPropertyName = getJsxElementChildrenPropertyname();
3760037601
for (var _i = 0, _a = attributes.properties; _i < _a.length; _i++) {
@@ -37625,11 +37626,16 @@ var ts;
3762537626
attributesArray = [];
3762637627
attributesTable = ts.createMap();
3762737628
}
37628-
var exprType = getApparentType(checkExpression(attributeDecl.expression));
37629+
var exprType = checkExpression(attributeDecl.expression);
3762937630
if (isTypeAny(exprType)) {
3763037631
hasSpreadAnyType = true;
3763137632
}
37632-
spread = getSpreadType(spread, exprType);
37633+
if (isValidSpreadType(exprType)) {
37634+
spread = getSpreadType(spread, exprType);
37635+
}
37636+
else {
37637+
typeToIntersect = typeToIntersect ? getIntersectionType([typeToIntersect, exprType]) : exprType;
37638+
}
3763337639
}
3763437640
}
3763537641
if (!hasSpreadAnyType) {
@@ -37683,7 +37689,12 @@ var ts;
3768337689
attributesTable.set(jsxChildrenPropertyName, childrenPropSymbol);
3768437690
}
3768537691
}
37686-
return hasSpreadAnyType ? anyType : createJsxAttributesType(attributes.symbol, attributesTable);
37692+
if (hasSpreadAnyType) {
37693+
return anyType;
37694+
}
37695+
var attributeType = createJsxAttributesType(attributes.symbol, attributesTable);
37696+
return typeToIntersect && attributesTable.size ? getIntersectionType([typeToIntersect, attributeType]) :
37697+
typeToIntersect ? typeToIntersect : attributeType;
3768737698
/**
3768837699
* Create anonymous type from given attributes symbol table.
3768937700
* @param symbol a symbol of JsxAttributes containing attributes corresponding to attributesTable

0 commit comments

Comments
 (0)