fix lexing of string literals
This commit is contained in:
parent
298408b93a
commit
c2131fcb28
1 changed files with 2 additions and 0 deletions
|
|
@ -281,6 +281,8 @@ Tokenizer.prototype = {
|
||||||
|
|
||||||
var hasEscapes = false;
|
var hasEscapes = false;
|
||||||
var delim = ch;
|
var delim = ch;
|
||||||
|
if (input.length <= this.cursor)
|
||||||
|
throw this.newSyntaxError("Unterminated string literal");
|
||||||
while ((ch = input[this.cursor++]) !== delim) {
|
while ((ch = input[this.cursor++]) !== delim) {
|
||||||
if (this.cursor == input.length)
|
if (this.cursor == input.length)
|
||||||
throw this.newSyntaxError("Unterminated string literal");
|
throw this.newSyntaxError("Unterminated string literal");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue