(token ast.Kind, pos int, contextNode *ast.Node, flags tokenEmitFlags)
| 817 | } |
| 818 | |
| 819 | func (p *Printer) shouldEmitTokenSourceMaps(token ast.Kind, pos int, contextNode *ast.Node, flags tokenEmitFlags) bool { |
| 820 | // We don't emit source positions for most tokens as it tends to be quite noisy, however |
| 821 | // we need to emit source positions for open and close braces so that tools like istanbul |
| 822 | // can map branches for code coverage. However, we still omit brace source positions when |
| 823 | // the output is a declaration file. |
| 824 | return flags&tefNoSourceMaps == 0 && |
| 825 | p.shouldEmitSourceMaps(contextNode) && |
| 826 | !p.Options.OmitBraceSourceMapPositions && (token == ast.KindOpenBraceToken || token == ast.KindCloseBraceToken) |
| 827 | } |
| 828 | |
| 829 | func (p *Printer) shouldEmitLeadingComments(node *ast.Node) bool { |
| 830 | return p.emitContext.EmitFlags(node)&EFNoLeadingComments == 0 |
no test coverage detected