aboutsummaryrefslogtreecommitdiffstats
path: root/src/Parser.js
diff options
context:
space:
mode:
authorMisko Hevery2010-10-15 14:06:30 -0700
committerMisko Hevery2010-10-15 14:06:30 -0700
commitff52f47537c9bf5c6acc636f25ae5f7f70d20f3b (patch)
treee202d6f8eee4602b44130bf71f1c926e8689645c /src/Parser.js
parenta36964799be3d21163ba6350d862fced2bbd3437 (diff)
downloadangular.js-ff52f47537c9bf5c6acc636f25ae5f7f70d20f3b.tar.bz2
Fix unicode parsing Close #56
Diffstat (limited to 'src/Parser.js')
-rw-r--r--src/Parser.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Parser.js b/src/Parser.js
index 2c681be0..9082bb2a 100644
--- a/src/Parser.js
+++ b/src/Parser.js
@@ -170,6 +170,10 @@ function lex(text, parseStrings){
if (escape) {
if (ch == 'u') {
var hex = text.substring(index + 1, index + 5);
+ if (!hex.match(/[\da-f]{4}/i))
+ throw "Lexer Error: Invalid unicode escape [\\u" +
+ hex + "] starting at column '" +
+ start + "' in expression '" + text + "'.";
index += 4;
string += String.fromCharCode(parseInt(hex, 16));
} else {