Fix regression in multiline comments with nlb

This commit is contained in:
Anthony Van de Gejuchte 2016-07-04 14:33:16 +02:00
parent 572b97b0bb
commit a8029a0ba4
2 changed files with 10 additions and 0 deletions

View File

@ -444,6 +444,7 @@ function tokenizer($TEXT, filename, html5_comments, shebang) {
// update stream position
forward(text.length /* doesn't count \r\n as 2 char while S.pos - i does */ + 2);
S.comments_before.push(token("comment2", text, true));
S.newline_before = S.newline_before || text.indexOf("\n") >= 0;
S.regex_allowed = regex_allowed;
return next_token;
});

View File

@ -69,3 +69,12 @@ html_comment_in_string_literal: {
}
expect_exact: 'function f(){return"\\x3c!--HTML--\\x3ecomment in\\x3c!--string literal--\\x3e"}';
}
html_comment_after_multiline_comment: {
input: {
var foo; /*
*/--> var bar;
var foobar;
}
expect_exact: "var foo;var foobar;"
}