File tree Expand file tree Collapse file tree 3 files changed +4
-12
lines changed Expand file tree Collapse file tree 3 files changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -2555,7 +2555,7 @@ namespace ts {
2555
2555
const resolved = resolveStructuredTypeMembers(type);
2556
2556
if (!resolved.properties.length && !resolved.stringIndexInfo && !resolved.numberIndexInfo) {
2557
2557
if (!resolved.callSignatures.length && !resolved.constructSignatures.length) {
2558
- return createTypeLiteralNode(/*members*/ undefined);
2558
+ return setEmitFlags( createTypeLiteralNode(/*members*/ undefined), EmitFlags.SingleLine );
2559
2559
}
2560
2560
2561
2561
if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) {
Original file line number Diff line number Diff line change @@ -961,7 +961,7 @@ namespace ts {
961
961
962
962
function emitTypeLiteral ( node : TypeLiteralNode ) {
963
963
write ( "{" ) ;
964
- // TODO: fix added indentation so we can remove this check .
964
+ // If the literal is empty, do not add spaces between braces .
965
965
if ( node . members . length > 0 ) {
966
966
emitList ( node , node . members , getEmitFlags ( node ) & EmitFlags . SingleLine ? ListFormat . SingleLineTypeLiteralMembers : ListFormat . MultiLineTypeLiteralMembers ) ;
967
967
}
Original file line number Diff line number Diff line change @@ -3294,16 +3294,6 @@ namespace ts {
3294
3294
return statements ;
3295
3295
}
3296
3296
3297
- export function parenthesizeConditionalHead ( condition : Expression ) {
3298
- const conditionalPrecedence = getOperatorPrecedence ( SyntaxKind . ConditionalExpression , SyntaxKind . QuestionToken ) ;
3299
- const emittedCondition = skipPartiallyEmittedExpressions ( condition ) ;
3300
- const conditionPrecedence = getExpressionPrecedence ( emittedCondition ) ;
3301
- if ( compareValues ( conditionPrecedence , conditionalPrecedence ) === Comparison . LessThan ) {
3302
- return createParen ( condition ) ;
3303
- }
3304
- return condition ;
3305
- }
3306
-
3307
3297
/**
3308
3298
* Wraps the operand to a BinaryExpression in parentheses if they are needed to preserve the intended
3309
3299
* order of operations.
@@ -3605,6 +3595,8 @@ namespace ts {
3605
3595
return expression ;
3606
3596
}
3607
3597
3598
+ function parenthesizeElementTypeMembers ( ) { }
3599
+
3608
3600
/**
3609
3601
* Clones a series of not-emitted expressions with a new inner expression.
3610
3602
*
You can’t perform that action at this time.
0 commit comments