Bug 1088125 - Part 2: Use arrow function instead of separate 'self' variable. r=gfritzsche

This commit is contained in:
Birunthan Mohanathas 2015-02-09 19:51:17 +02:00
parent 8b72b69f8d
commit f6a99b47cd

View File

@ -298,29 +298,28 @@ Submitter.prototype = {
let manager = Services.crashmanager;
let submissionID = manager.generateSubmissionID();
let self = this;
xhr.addEventListener("readystatechange", function (aEvt) {
xhr.addEventListener("readystatechange", (evt) => {
if (xhr.readyState == 4) {
let ret =
xhr.status == 200 ? parseKeyValuePairs(xhr.responseText) : {};
let submitted = !!ret.CrashID;
if (self.recordSubmission) {
if (this.recordSubmission) {
let result = submitted ? manager.SUBMISSION_RESULT_OK :
manager.SUBMISSION_RESULT_FAILED;
manager.addSubmissionResult(self.id, submissionID, new Date(),
manager.addSubmissionResult(this.id, submissionID, new Date(),
result);
if (submitted) {
manager.setRemoteCrashID(self.id, ret.CrashID);
manager.setRemoteCrashID(this.id, ret.CrashID);
}
}
if (submitted) {
self.submitSuccess(ret);
this.submitSuccess(ret);
}
else {
self.notifyStatus(FAILED);
self.cleanup();
this.notifyStatus(FAILED);
this.cleanup();
}
}
}, false);