зеркало из https://github.com/mozilla/gecko-dev.git
Bug 469102 - Places Tag Autocomplete breaks with certain tags (Regex escaping) (r=marco)
This commit is contained in:
Родитель
c5ae2a1961
Коммит
d6a71cae70
|
@ -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]();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче