Always make a new jsxAttributes type, dont reuse emptyObjectType (#22810)

* Always make a new jsxAttributes type, dont reuse emptyObjectType

* Break up conditional a bit
This commit is contained in:
Wesley Wigham
2018-03-22 15:16:33 -07:00
committed by GitHub
parent a909000b62
commit ca1d19a579
6 changed files with 143 additions and 1 deletions

View File

@@ -15398,7 +15398,10 @@ namespace ts {
if (hasSpreadAnyType) {
return anyType;
}
return typeToIntersect && spread !== emptyObjectType ? getIntersectionType([typeToIntersect, spread]) : (typeToIntersect || spread);
if (typeToIntersect && spread !== emptyObjectType) {
return getIntersectionType([typeToIntersect, spread]);
}
return typeToIntersect || (spread === emptyObjectType ? createJsxAttributesType() : spread);
/**
* Create anonymous type from given attributes symbol table.