Fix test bustage by reordering reference clearing. Unit tests attempt to

start new searches from result callbacks.
This commit is contained in:
dtownsend%oxymoronical.com 2008-04-17 13:18:46 +00:00
Родитель 93762808d9
Коммит 6f2e4c06e6
1 изменённых файлов: 7 добавлений и 3 удалений

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

@ -181,19 +181,23 @@ AddonRepository.prototype = {
_reportSuccess: function(aCount) {
this._searching = false;
this._request = null;
this._callback.searchSucceeded(this._addons, this._addons.length,
this._recommended ? -1 : aCount);
// The callback may want to trigger a new search so clear references early
var addons = this._addons;
var callback = this._callback;
this._callback = null;
this._addons = null;
callback.searchSucceeded(addons, addons.length, this._recommended ? -1 : aCount);
},
// Notifies the callback of a failure
_reportFailure: function(aEvent) {
this._searching = false;
this._request = null;
this._callback.searchFailed();
// The callback may want to trigger a new search so clear references early
var callback = this._callback;
this._callback = null;
this._addons = null;
callback.searchFailed();
},
// Parses an add-on entry from an <addon> element