Do not allow newlines in string literals

This commit is contained in:
Anthony Van de Gejuchte
2015-12-26 15:08:37 +01:00
parent 60c4030a4d
commit 174404c0f3

View File

@@ -399,6 +399,7 @@ function tokenizer($TEXT, filename, html5_comments, shebang) {
if (octal_len > 0) ch = String.fromCharCode(parseInt(ch, 8)); if (octal_len > 0) ch = String.fromCharCode(parseInt(ch, 8));
else ch = read_escaped_char(true); else ch = read_escaped_char(true);
} }
else if (ch == "\n") parse_error("Unterminated string constant");
else if (ch == quote) break; else if (ch == quote) break;
ret += ch; ret += ch;
} }