Bug 469102 - Places Tag Autocomplete breaks with certain tags (Regex escaping) (r=marco)

This commit is contained in:
Dietrich Ayala 2008-12-18 12:33:47 -08:00
Родитель c5ae2a1961
Коммит d6a71cae70
2 изменённых файлов: 6 добавлений и 4 удалений

Просмотреть файл

@ -538,9 +538,8 @@ TagAutoCompleteSearch.prototype = {
if (self._stopped)
yield false;
// for each match, prepend what the user has typed so far
var pattern = new RegExp("(^" + searchResults[i] + "$|" + searchResults[i] + "(,|;))");
if (searchResults[i].indexOf(searchString) == 0 &&
!pattern.test(before)) {
comments.indexOf(searchResults[i]) == -1) {
results.push(before + searchResults[i]);
comments.push(searchResults[i]);
}
@ -577,12 +576,15 @@ TagAutoCompleteSearch.prototype = {
driveGenerator();
},
/**
* nsITimer callback
*/
notify: function PTACS_notify(timer) {
if (this._callback)
this._callback();
},
/*
/**
* Stop an asynchronous search that is in progress
*/
stopSearch: function PTACS_stopSearch() {

Просмотреть файл

@ -161,7 +161,7 @@ var tests = [
* Test tag autocomplete
*/
function run_test() {
tagssvc.tagURI(uri1, ["bar", "baz", "boo"]);
tagssvc.tagURI(uri1, ["bar", "baz", "boo", "*nix"]);
tests[0]();
}