TODO: Support emitting nameIndex for source maps func (p *Printer) emitSourcePosName(source sourcemap.Source, pos int, name string) { if source != p.sourceMapSource { savedSourceMapSource := p.sourceMapSource savedSourceMapSourceIndex := p.sourceMapSourceIndex p.setSourceMapSource(source) p
(node *ast.Node)
| 5870 | ////} |
| 5871 | |
| 5872 | func (p *Printer) emitSourceMapsBeforeNode(node *ast.Node) *sourceMapState { |
| 5873 | if !p.shouldEmitSourceMaps(node) { |
| 5874 | return nil |
| 5875 | } |
| 5876 | |
| 5877 | emitFlags := p.emitContext.EmitFlags(node) |
| 5878 | loc := p.emitContext.SourceMapRange(node) |
| 5879 | |
| 5880 | if !ast.IsNotEmittedStatement(node) && |
| 5881 | emitFlags&EFNoLeadingSourceMap == 0 && |
| 5882 | p.currentSourceFile != nil && |
| 5883 | !ast.PositionIsSynthesized(loc.Pos()) { |
| 5884 | p.emitSourcePos(p.sourceMapSource, scanner.SkipTrivia(p.currentSourceFile.Text(), loc.Pos())) |
| 5885 | } |
| 5886 | |
| 5887 | if emitFlags&EFNoNestedSourceMaps != 0 { |
| 5888 | p.sourceMapsDisabled = true |
| 5889 | } |
| 5890 | |
| 5891 | state := p.sourceMapStateArena.New() |
| 5892 | *state = sourceMapState{emitFlags, loc, false} |
| 5893 | return state |
| 5894 | } |
| 5895 | |
| 5896 | func (p *Printer) emitSourceMapsAfterNode(node *ast.Node, previousState *sourceMapState) { |
| 5897 | if previousState == nil { |
no test coverage detected