1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:38:11 +00:00

LibJS: Make new lines in block comments reset line has token

Before this a closing html comment would not be treated as a comment if
directly following a block comment which was not the first token of its
first line.
This commit is contained in:
davidot 2021-12-19 02:27:25 +01:00 committed by Linus Groh
parent 45578f58dc
commit a1308bfc60
2 changed files with 13 additions and 0 deletions

View file

@ -26,6 +26,15 @@ i;`;
expect(source).toEvalTo(2);
});
test("html comments directly after block comment", () => {
expect("0 /* */-->i").not.toEval();
expect(`0 /*
*/-->i`).toEval();
expect(`0 /*
*/-->i
'a'`).toEvalTo("a");
});
test("unterminated multi-line comment", () => {
expect("/*").not.toEval();
expect("/**").not.toEval();