A spliced directive without the `//` comment that ends it, one in a string literal aside.
(text: string)
| 440 | |
| 441 | /** A spliced directive without the `//` comment that ends it, one in a string literal aside. */ |
| 442 | function withoutLineComment(text: string): string { |
| 443 | for (let i = 0; i < text.length; i++) { |
| 444 | const c = text[i]; |
| 445 | if (c === '"' || c === "'") i = quotedEnd(text, i) - 1; |
| 446 | else if (c === '/' && text[i + 1] === '/') return text.slice(0, i); |
| 447 | } |
| 448 | return text; |
| 449 | } |
| 450 | |
| 451 | /** Past blanks and comments from `i`. */ |
| 452 | function skipBlankAndComments(source: string, i: number): number { |
no test coverage detected