Skip to content

Commit

Permalink
MDL-63210 core: convert for loop to forEach in JS
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjnelson committed Aug 24, 2018
1 parent a456850 commit 5b4811c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/amd/build/ajax.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions lib/amd/src/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,13 @@ define(['jquery', 'core/config', 'core/log', 'core/url'], function($, config, Lo
}
// Something failed, reject the remaining promises.
if (exception !== null) {
// If the user isn't doing anything too important, redirect to the login page.
// Redirect to the login page.
if (exception.errorcode === "servicerequireslogin") {
window.location = URL.relativeUrl("/login/index.php");
} else {
for (; i < requests.length; i++) {
request = requests[i];
requests.forEach(function(request) {
request.deferred.reject(exception);
}
});
}
}
};
Expand Down

0 comments on commit 5b4811c

Please sign in to comment.