launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #03143
[Merge] lp:~deryck/launchpad/xhr-log-not-overwrite-arguments into lp:launchpad
Deryck Hodge has proposed merging lp:~deryck/launchpad/xhr-log-not-overwrite-arguments into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~deryck/launchpad/xhr-log-not-overwrite-arguments/+merge/55750
This is a minor fix to ensure the AJAX log stuff doesn't shadow the "arguments" variable, which is a special array inside functions that holds all the supplied arguments to the function. I've renamed this to "response" which makes the use clearer, too. I've also cleaned up a bit of trailing whitespace.
--
https://code.launchpad.net/~deryck/launchpad/xhr-log-not-overwrite-arguments/+merge/55750
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~deryck/launchpad/xhr-log-not-overwrite-arguments into lp:launchpad.
=== modified file 'lib/lp/app/javascript/ajax_log.js'
--- lib/lp/app/javascript/ajax_log.js 2011-03-30 06:23:06 +0000
+++ lib/lp/app/javascript/ajax_log.js 2011-03-31 13:36:32 +0000
@@ -4,7 +4,7 @@
/* Requests slower than this are marked as slow. Value in seconds.
*/
var AJAX_OK_TIME = 1;
-
+
LPS.use('node', 'lazr.anim', function(Y) {
Y.on('contentready', function() {
var node = Y.one('#ajax-time-list');
@@ -22,7 +22,7 @@
});
/* When an AJAX event finishes add it to the log.
*/
- Y.on('io:complete', function(transactionid, arguments) {
+ Y.on('io:complete', function(transactionid, response) {
/* The AJAX event has finished so record the time.
*/
var finish_time = new Date();
@@ -48,9 +48,9 @@
log_node.one('span').set(
'text',
'ID: ' + transactionid +
- ', status: ' + arguments.status +
- ' (' + arguments.statusText + ')');
- var oops = arguments.getResponseHeader('X-Lazr-OopsId');
+ ', status: ' + response.status +
+ ' (' + response.statusText + ')');
+ var oops = response.getResponseHeader('X-Lazr-OopsId');
if (oops) {
var oops_node = Y.Node.create('<a/>');
oops_node.setAttribute(
@@ -73,7 +73,7 @@
}
}
});
-
+
/* Open/close the log.
*/
Y.on('click', function(e) {