()
| 2698 | } |
| 2699 | |
| 2700 | func (node *SourceFile) ECMALineMap() []core.TextPos { |
| 2701 | node.ecmaLineMapMu.RLock() |
| 2702 | lineMap := node.ecmaLineMap |
| 2703 | node.ecmaLineMapMu.RUnlock() |
| 2704 | if lineMap == nil { |
| 2705 | node.ecmaLineMapMu.Lock() |
| 2706 | defer node.ecmaLineMapMu.Unlock() |
| 2707 | lineMap = node.ecmaLineMap |
| 2708 | if lineMap == nil { |
| 2709 | lineMap = core.ComputeECMALineStarts(node.Text()) |
| 2710 | node.ecmaLineMap = lineMap |
| 2711 | } |
| 2712 | } |
| 2713 | return lineMap |
| 2714 | } |
| 2715 | |
| 2716 | // GetNameTable returns a map of all names in the file to their positions. |
| 2717 | // If the name appears more than once, the value is -1. |
nothing calls this directly
no test coverage detected