Allow HTML comments on first line (#9760)

This commit is contained in:
Daniel Tschinder
2019-03-25 14:22:57 -07:00
committed by GitHub
parent 3aaafae053
commit aaefc83a6c
3 changed files with 107 additions and 1 deletions

View File

@@ -526,7 +526,10 @@ export default class Tokenizer extends LocationParser {
next === charCodes.dash &&
!this.inModule &&
this.input.charCodeAt(this.state.pos + 2) === charCodes.greaterThan &&
lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.pos))
(this.state.lastTokEnd === 0 ||
lineBreak.test(
this.input.slice(this.state.lastTokEnd, this.state.pos),
))
) {
// A `-->` line comment
this.skipLineComment(3);