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

browser-messaging-saver
Cameron Fischer 2020-12-10 13:25:53 -05:00 zatwierdzone przez GitHub
rodzic 78c2beb640
commit 6ca89304a1
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 9 dodań i 1 usunięć

Wyświetl plik

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

Wyświetl plik

@ -12,6 +12,14 @@ Tests the reduce prefix and filter.
/* global $tw, require */
"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() {
var wiki = new $tw.Wiki();