mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-09 02:30:15 -06:00
handle todo
This commit is contained in:
parent
a32bc985bf
commit
9e9054bd2b
@ -2555,7 +2555,7 @@ namespace ts {
|
||||
const resolved = resolveStructuredTypeMembers(type);
|
||||
if (!resolved.properties.length && !resolved.stringIndexInfo && !resolved.numberIndexInfo) {
|
||||
if (!resolved.callSignatures.length && !resolved.constructSignatures.length) {
|
||||
return createTypeLiteralNode(/*members*/ undefined);
|
||||
return setEmitFlags(createTypeLiteralNode(/*members*/ undefined), EmitFlags.SingleLine);
|
||||
}
|
||||
|
||||
if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) {
|
||||
|
||||
@ -961,7 +961,7 @@ namespace ts {
|
||||
|
||||
function emitTypeLiteral(node: TypeLiteralNode) {
|
||||
write("{");
|
||||
// TODO: fix added indentation so we can remove this check.
|
||||
// If the literal is empty, do not add spaces between braces.
|
||||
if (node.members.length > 0) {
|
||||
emitList(node, node.members, getEmitFlags(node) & EmitFlags.SingleLine ? ListFormat.SingleLineTypeLiteralMembers : ListFormat.MultiLineTypeLiteralMembers);
|
||||
}
|
||||
|
||||
@ -3294,16 +3294,6 @@ namespace ts {
|
||||
return statements;
|
||||
}
|
||||
|
||||
export function parenthesizeConditionalHead(condition: Expression) {
|
||||
const conditionalPrecedence = getOperatorPrecedence(SyntaxKind.ConditionalExpression, SyntaxKind.QuestionToken);
|
||||
const emittedCondition = skipPartiallyEmittedExpressions(condition);
|
||||
const conditionPrecedence = getExpressionPrecedence(emittedCondition);
|
||||
if (compareValues(conditionPrecedence, conditionalPrecedence) === Comparison.LessThan) {
|
||||
return createParen(condition);
|
||||
}
|
||||
return condition;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wraps the operand to a BinaryExpression in parentheses if they are needed to preserve the intended
|
||||
* order of operations.
|
||||
@ -3605,6 +3595,8 @@ namespace ts {
|
||||
return expression;
|
||||
}
|
||||
|
||||
function parenthesizeElementTypeMembers() {}
|
||||
|
||||
/**
|
||||
* Clones a series of not-emitted expressions with a new inner expression.
|
||||
*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user