This commit is contained in:
Rob Colburn 2017-04-16 01:15:07 +00:00 committed by GitHub
commit 86f422f8dd

View File

@ -1297,7 +1297,12 @@ function OutputStream(options) {
}; };
DEFPRINT(AST_RegExp, function(self, output){ DEFPRINT(AST_RegExp, function(self, output){
var str = self.getValue().toString(); var str = self.getValue()
try {
str = str.toString();
} catch (e) {
throw new Error('Cannot evaluate RegExp [' + self.start.file + ':' + self.start.line + ',' + self.start.col + ']');
}
if (output.option("ascii_only")) { if (output.option("ascii_only")) {
str = output.to_ascii(str); str = output.to_ascii(str);
} else if (output.option("unescape_regexps")) { } else if (output.option("unescape_regexps")) {