emitPostfixTypeOperand emits the operand of a postfix type (ArrayType, IndexedAccessType, OptionalType). It is equivalent to `emitTypeNode(operand, TypePrecedencePostfix)` except that it preserves a parsed `typeof X` operand without adding parentheses (e.g., `typeof C[K]` instead of `(typeof C)[K]`)
(operand *ast.TypeNode, parent *ast.Node)
| 1989 | // via the factory, so parsed postfix types preserve the source as written during round-trip |
| 1990 | // emit while synthesized postfix types (e.g., from declaration emit) still get the parentheses. |
| 1991 | func (p *Printer) emitPostfixTypeOperand(operand *ast.TypeNode, parent *ast.Node) { |
| 1992 | if ast.IsParseTreeNode(parent) && operand.Kind == ast.KindTypeQuery { |
| 1993 | p.emitTypeNode(operand, ast.TypePrecedenceTypeOperator) |
| 1994 | return |
| 1995 | } |
| 1996 | p.emitTypeNode(operand, ast.TypePrecedencePostfix) |
| 1997 | } |
| 1998 | |
| 1999 | func (p *Printer) emitTupleElementType(node *ast.Node) { |
| 2000 | p.emitTypeNodeOutsideExtends(node) |
no test coverage detected