This commit is contained in:
Chris Cowan 2015-07-29 13:04:47 +00:00
commit 5bca71940c

View File

@ -480,7 +480,13 @@ function tokenizer($TEXT, filename, html5_comments) {
regexp += ch;
}
var mods = read_name();
return token("regexp", new RegExp(regexp, mods));
var r;
try {
r = new RegExp(regexp, mods);
} catch(e) {
parse_error(e.message);
}
return token("regexp", r);
});
function read_operator(prefix) {