Fix ch that could contain other newline characters
authorAnthony Van de Gejuchte <anthonyvdgent@gmail.com>
Sun, 27 Dec 2015 21:24:37 +0000 (22:24 +0100)
committerAnthony Van de Gejuchte <anthonyvdgent@gmail.com>
Sun, 27 Dec 2015 21:24:37 +0000 (22:24 +0100)
lib/parse.js

index 7e7b227..2218c00 100644 (file)
@@ -399,7 +399,7 @@ function tokenizer($TEXT, filename, html5_comments, shebang) {
                 if (octal_len > 0) ch = String.fromCharCode(parseInt(ch, 8));
                 else ch = read_escaped_char(true);
             }
-            else if (ch == "\n") parse_error("Unterminated string constant");
+            else if ("\r\n\u2028\u2029".indexOf(ch) >= 0) parse_error("Unterminated string constant");
             else if (ch == quote) break;
             ret += ch;
         }