From c2131fcb2817d936d04e742d011b53c5e905414a Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Thu, 28 Apr 2011 21:14:50 +0200 Subject: [PATCH] fix lexing of string literals --- lib/ace/narcissus/jslex.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ace/narcissus/jslex.js b/lib/ace/narcissus/jslex.js index c551792f..e2c5a646 100644 --- a/lib/ace/narcissus/jslex.js +++ b/lib/ace/narcissus/jslex.js @@ -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");