Re-use the caught exception's error message in the parse error call.
This commit is contained in:
committed by
Richard van Velzen
parent
d6814050dd
commit
9854deb626
@@ -480,13 +480,11 @@ function tokenizer($TEXT, filename, html5_comments) {
|
|||||||
regexp += ch;
|
regexp += ch;
|
||||||
}
|
}
|
||||||
var mods = read_name();
|
var mods = read_name();
|
||||||
var r;
|
|
||||||
try {
|
try {
|
||||||
r = new RegExp(regexp, mods);
|
return token("regexp", new RegExp(regexp, mods));
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
parse_error("Invalid regular expression");
|
parse_error(e.message);
|
||||||
}
|
}
|
||||||
return token("regexp", r);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function read_operator(prefix) {
|
function read_operator(prefix) {
|
||||||
|
|||||||
Reference in New Issue
Block a user