Do not allow newlines in regex

This commit is contained in:
Anthony Van de Gejuchte
2016-06-05 02:44:59 +02:00
committed by Richard van Velzen
parent 09d5707a8a
commit 00ad57e393
2 changed files with 24 additions and 0 deletions

View File

@@ -490,6 +490,8 @@ function tokenizer($TEXT, filename, html5_comments, shebang) {
break;
} else if (ch == "\\") {
prev_backslash = true;
} else if ("\r\n\u2028\u2029".indexOf(ch) >= 0) {
parse_error("Unexpected line terminator");
} else {
regexp += ch;
}