mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 11:54:44 -06:00
Minor changes
This commit is contained in:
parent
28ea53e4f0
commit
0d47c73ba6
@ -13711,7 +13711,7 @@ namespace ts {
|
||||
// signatures, is not in a destructuring pattern, doesn't have more than 10 properties, and doesn't
|
||||
// have property names containing colons (which we use as a separator in the cache key).
|
||||
if (!isInferredTypeOfVariable(node) && !hasMethodsOrAccessors && !stringIndexInfo && !numberIndexInfo && !inDestructuringPattern &&
|
||||
propertiesArray.length <= 10 && !forEach(propertiesArray, symbolNameContainsColon)) {
|
||||
propertiesArray.length <= 10 && every(propertiesArray, propertyNameIsValidKey)) {
|
||||
return getObjectLiteralType(typeFlags, node.symbol, propertiesTable, propertiesArray);
|
||||
}
|
||||
const result = makeObjectLiteralType(typeFlags, node.symbol, propertiesTable, stringIndexInfo, numberIndexInfo);
|
||||
@ -13733,8 +13733,8 @@ namespace ts {
|
||||
return isVariableLike(parent) && !parent.type && parent.initializer === node;
|
||||
}
|
||||
|
||||
function symbolNameContainsColon(symbol: Symbol) {
|
||||
return (<string>symbol.escapedName).indexOf(":") >= 0;
|
||||
function propertyNameIsValidKey(symbol: Symbol) {
|
||||
return (<string>symbol.escapedName).indexOf(":") < 0;
|
||||
}
|
||||
|
||||
function getObjectLiteralType(flags: TypeFlags, symbol: Symbol, members: SymbolTable, properties: Symbol[]): ResolvedType {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user