From 05eec2ae19d06ef0e418ce9563e65a5de08c371f Mon Sep 17 00:00:00 2001 From: Zev Benjamin Date: Tue, 12 Mar 2013 19:15:14 -0400 Subject: [PATCH] blueslip: Add some clarifying comments (imported from commit 8b8ed83593d4dfb8ac3deb2c3442c2614481701a) --- zephyr/static/js/blueslip.js | 8 ++++++++ zephyr/static/js/setup.js | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/zephyr/static/js/blueslip.js b/zephyr/static/js/blueslip.js index f58c20d0f4..3828c3f8a9 100644 --- a/zephyr/static/js/blueslip.js +++ b/zephyr/static/js/blueslip.js @@ -1,3 +1,7 @@ +// This must be included before the first call to $(document).ready +// in order to be able to report exceptions that occur during their +// execution. + // Silence jslint errors about the "console" global /*global console: true */ @@ -18,6 +22,10 @@ function report_error(msg, stack, opts) { return; } + // TODO: If an exception gets thrown before we setup ajax calls + // to include the CSRF token, our ajax call will fail. The + // elegant thing to do in that case is to either wait until that + // setup is done or do it ourselves and then retry. $.ajax({ type: 'POST', url: '/json/report_error', diff --git a/zephyr/static/js/setup.js b/zephyr/static/js/setup.js index c2d9bfcf5b..1762ed6b30 100644 --- a/zephyr/static/js/setup.js +++ b/zephyr/static/js/setup.js @@ -1,5 +1,4 @@ // Miscellaneous early setup. -// This is the first of our Javascript files to be included. var templates = {}; var csrf_token;