aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Cowan <agentme49@gmail.com>2015-05-14 12:27:56 -0700
committerRichard van Velzen <rvanvelzen@experty.com>2015-07-29 15:06:52 +0200
commit9854deb626874f06107db196b87afcf2dc49b035 (patch)
tree82359bf5a60801723f46f660d837c8f33b5532ab
parentd6814050dd42298abb02e3fee2856174e02f01fa (diff)
downloadtracifyjs-9854deb626874f06107db196b87afcf2dc49b035.tar.gz
tracifyjs-9854deb626874f06107db196b87afcf2dc49b035.zip
Re-use the caught exception's error message in the parse error call.
-rw-r--r--lib/parse.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/parse.js b/lib/parse.js
index 70ee2e80..ab72ad2d 100644
--- a/lib/parse.js
+++ b/lib/parse.js
@@ -480,13 +480,11 @@ function tokenizer($TEXT, filename, html5_comments) {
regexp += ch;
}
var mods = read_name();
- var r;
try {
- r = new RegExp(regexp, mods);
+ return token("regexp", new RegExp(regexp, mods));
} catch(e) {
- parse_error("Invalid regular expression");
+ parse_error(e.message);
}
- return token("regexp", r);
});
function read_operator(prefix) {