1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 12:07:19 +00:00

Fix for LinkedLists when using bad filter prefix (#5251)

This commit is contained in:
Cameron Fischer 2020-12-10 13:25:53 -05:00 committed by GitHub
parent 78c2beb640
commit 6ca89304a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -297,7 +297,7 @@ exports.compileFilter = function(filterString) {
return filterRunPrefixes[operation.namedPrefix](operationSubFunction, options); return filterRunPrefixes[operation.namedPrefix](operationSubFunction, options);
} else { } else {
return function(results,source,widget) { return function(results,source,widget) {
results.splice(0,results.length); results.clear();
results.push($tw.language.getString("Error/FilterRunPrefix")); results.push($tw.language.getString("Error/FilterRunPrefix"));
}; };
} }

View File

@ -12,6 +12,14 @@ Tests the reduce prefix and filter.
/* global $tw, require */ /* global $tw, require */
"use strict"; "use strict";
describe("general filter prefix tests", function() {
it("should handle nonexistent prefixes gracefully", function() {
var wiki = new $tw.Wiki();
var results = wiki.filterTiddlers("[tag[A]] :nonexistent[tag[B]]");
expect(results).toEqual(["Filter Error: Unknown prefix for filter run"]);
});
});
describe("'reduce' and 'intersection' filter prefix tests", function() { describe("'reduce' and 'intersection' filter prefix tests", function() {
var wiki = new $tw.Wiki(); var wiki = new $tw.Wiki();