зеркало из https://github.com/mozilla/pjs.git
Fix test bustage by reordering reference clearing. Unit tests attempt to
start new searches from result callbacks.
This commit is contained in:
Родитель
93762808d9
Коммит
6f2e4c06e6
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче