(start: number, end?: number)
| 914 | } |
| 915 | |
| 916 | function getLoc(start: number, end?: number): SourceLocation { |
| 917 | return { |
| 918 | start: tokenizer.getPos(start), |
| 919 | // @ts-expect-error allow late attachment |
| 920 | end: end == null ? end : tokenizer.getPos(end), |
| 921 | // @ts-expect-error allow late attachment |
| 922 | source: end == null ? end : getSlice(start, end), |
| 923 | } |
| 924 | } |
| 925 | |
| 926 | export function cloneLoc(loc: SourceLocation): SourceLocation { |
| 927 | return getLoc(loc.start.offset, loc.end.offset) |
no test coverage detected