fix lexing of string literals

This commit is contained in:
Fabian Jakobs 2011-04-28 21:14:50 +02:00
commit c2131fcb28

View file

@ -281,6 +281,8 @@ Tokenizer.prototype = {
var hasEscapes = false;
var delim = ch;
if (input.length <= this.cursor)
throw this.newSyntaxError("Unterminated string literal");
while ((ch = input[this.cursor++]) !== delim) {
if (this.cursor == input.length)
throw this.newSyntaxError("Unterminated string literal");