@@ -29,16 +29,13 @@ function experimentalTernaries(
2929 const isNestedAsTrueExpression =
3030 isNested && grandparent . trueExpression . variant === node ;
3131 const falseExpressionInSameLine =
32- typeof node . falseExpression . variant !== 'string' &&
33- ( node . falseExpression . variant . kind === NonterminalKind . TupleExpression ||
34- node . falseExpression . variant . kind ===
35- NonterminalKind . ConditionalExpression ) ;
32+ node . falseExpression . variant . kind === NonterminalKind . TupleExpression ||
33+ node . falseExpression . variant . kind === NonterminalKind . ConditionalExpression ;
3634
3735 // If the `condition` breaks into multiple lines, we add parentheses,
3836 // unless it already is a `TupleExpression`.
3937 const operand = path . call ( print , 'operand' ) ;
4038 const operandDoc = group ( [
41- typeof node . operand . variant !== 'string' &&
4239 node . operand . variant . kind === NonterminalKind . TupleExpression
4340 ? operand
4441 : ifBreak ( [ '(' , printSeparatedItem ( operand ) , ')' ] , operand ) ,
@@ -137,13 +134,10 @@ export class ConditionalExpression implements SlangNode {
137134 // `condition` must be a single `bool` value.
138135 const operandLoc = this . operand . loc ;
139136 while (
140- typeof this . operand . variant !== 'string' &&
141137 this . operand . variant . kind === NonterminalKind . TupleExpression &&
142138 this . operand . variant . items . items . length === 1 &&
143- ( typeof this . operand . variant . items . items [ 0 ] . expression ! . variant ===
144- 'string' ||
145- this . operand . variant . items . items [ 0 ] . expression ! . variant . kind !==
146- NonterminalKind . ConditionalExpression )
139+ this . operand . variant . items . items [ 0 ] . expression ! . variant . kind !==
140+ NonterminalKind . ConditionalExpression
147141 ) {
148142 this . operand = this . operand . variant . items . items [ 0 ] . expression ! ;
149143 }
0 commit comments