Catch syntax errors in regexp filters

print-window-tiddler
Astrid Elocson 2015-01-23 14:32:57 +00:00
rodzic f4005871b4
commit 8d9f1e7477
1 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -41,7 +41,11 @@ exports.regexp = function(source,operator,options) {
regexpString = regexpString.substr(0,regexpString.length - match[0].length);
}
}
regexp = new RegExp(regexpString,flags);
try {
regexp = new RegExp(regexpString,flags);
} catch(e) {
return ["" + e];
}
// Process the incoming tiddlers
if(operator.prefix === "!") {
source(function(tiddler,title) {