Merge lp:~cjwatson/launchpad/eslint-declare-vars into lp:launchpad

Proposed by Colin Watson
Status: Merged
Merged at revision: 18432
Proposed branch: lp:~cjwatson/launchpad/eslint-declare-vars
Merge into: lp:launchpad
Prerequisite: lp:~cjwatson/launchpad/eslint-remove-unused-vars
Diff against target: 1331 lines (+176/-147)
47 files modified
lib/lp/app/javascript/calendar.js (+5/-3)
lib/lp/app/javascript/choiceedit/choiceedit.js (+1/-1)
lib/lp/app/javascript/client.js (+2/-2)
lib/lp/app/javascript/comment.js (+3/-2)
lib/lp/app/javascript/inlinehelp/tests/test_inlinehelp.js (+1/-1)
lib/lp/app/javascript/lp.js (+1/-1)
lib/lp/app/javascript/ordering/tests/test_orderby_widget.js (+1/-1)
lib/lp/app/javascript/picker/tests/test_picker.js (+2/-2)
lib/lp/app/javascript/subscribers/subscribers_list.js (+1/-0)
lib/lp/app/javascript/tests/test_expander.js (+1/-1)
lib/lp/app/javascript/tests/test_listing_navigator.js (+3/-3)
lib/lp/app/javascript/tests/test_longpoll.js (+1/-1)
lib/lp/app/javascript/tests/test_lp_client.js (+6/-6)
lib/lp/blueprints/javascript/workitems.js (+1/-1)
lib/lp/bugs/javascript/buglisting_utils.js (+1/-1)
lib/lp/bugs/javascript/bugtask_index.js (+4/-4)
lib/lp/bugs/javascript/subscription.js (+4/-3)
lib/lp/bugs/javascript/tests/test_bug_subscription_portlet.js (+21/-12)
lib/lp/bugs/javascript/tests/test_official_bug_tags.js (+2/-2)
lib/lp/bugs/javascript/tests/test_pre_search.js (+3/-3)
lib/lp/bugs/javascript/tests/test_subscription.js (+11/-7)
lib/lp/code/javascript/branch.subscription.js (+1/-1)
lib/lp/code/javascript/branchmergeproposal.inlinecomments.js (+2/-1)
lib/lp/code/javascript/branchmergeproposal.status.js (+9/-7)
lib/lp/code/javascript/requestbuild_overlay.js (+10/-13)
lib/lp/code/javascript/tests/test_requestbuild_overlay.js (+3/-3)
lib/lp/registry/javascript/distroseries/tests/test_widgets.js (+1/-1)
lib/lp/registry/javascript/distroseriesdifferences_details.js (+5/-4)
lib/lp/registry/javascript/milestonetable.js (+1/-1)
lib/lp/registry/javascript/structural-subscription.js (+2/-2)
lib/lp/registry/javascript/team.js (+5/-5)
lib/lp/registry/javascript/team_mailinglists.js (+3/-2)
lib/lp/registry/javascript/tests/test_distroseriesdifferences_details.js (+6/-6)
lib/lp/registry/javascript/tests/test_structural_subscription.js (+7/-7)
lib/lp/registry/javascript/tests/timeline.js (+1/-1)
lib/lp/registry/javascript/timeline.js (+3/-3)
lib/lp/services/webhooks/javascript/deliveries.js (+1/-1)
lib/lp/snappy/javascript/tests/test_snap.edit.js (+1/-0)
lib/lp/snappy/javascript/tests/test_snap.update_build_statuses.js (+12/-8)
lib/lp/soyuz/javascript/lp_dynamic_dom_updater.js (+1/-1)
lib/lp/soyuz/javascript/update_archive_build_statuses.js (+1/-0)
lib/lp/translations/javascript/importqueue.js (+3/-3)
lib/lp/translations/javascript/pofile.js (+3/-2)
lib/lp/translations/javascript/sourcepackage_sharing_details.js (+8/-6)
lib/lp/translations/javascript/tests/test_importqueue.js (+2/-2)
lib/lp/translations/javascript/tests/test_poexport.js (+4/-4)
lib/lp/translations/javascript/tests/test_sourcepackage_sharing_details.js (+6/-6)
To merge this branch: bzr merge lp:~cjwatson/launchpad/eslint-declare-vars
Reviewer Review Type Date Requested Status
William Grant Approve
Review via email: mp+327900@code.launchpad.net

Commit message

Add lots of missing variable declarations spotted by ESLint.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/app/javascript/calendar.js'
2--- lib/lp/app/javascript/calendar.js 2013-04-22 06:20:18 +0000
3+++ lib/lp/app/javascript/calendar.js 2017-07-21 17:49:13 +0000
4@@ -22,7 +22,7 @@
5 * @param num {Number} the number to convert and possibly pad.
6 */
7 var pad_with_zero = function(num) {
8- num_as_string = String(num);
9+ var num_as_string = String(num);
10 if (num_as_string.length === 1) {
11 num_as_string = "0" + num_as_string;
12 }
13@@ -110,6 +110,8 @@
14 width: '300px',
15 date: initial_value}).render();
16
17+ var time_selector_node;
18+
19 if (include_time) {
20 time_selector_node = create_time_selector_node(initial_value);
21 containing_div_node.appendChild(time_selector_node);
22@@ -127,9 +129,9 @@
23 calendar.on("selectionChange", function(e) {
24 var newDate = Y.Date.format(e.newSelection[0]);
25 if (include_time) {
26- hours = pad_with_zero(
27+ var hours = pad_with_zero(
28 time_selector_node.one('.hours').get('value'));
29- minutes = pad_with_zero(
30+ var minutes = pad_with_zero(
31 time_selector_node.one('.minutes').get('value'));
32 newDate += " " + hours + ":" + minutes;
33 }
34
35=== modified file 'lib/lp/app/javascript/choiceedit/choiceedit.js'
36--- lib/lp/app/javascript/choiceedit/choiceedit.js 2017-07-21 17:49:13 +0000
37+++ lib/lp/app/javascript/choiceedit/choiceedit.js 2017-07-21 17:49:13 +0000
38@@ -579,7 +579,7 @@
39 var client_width = document.body.clientWidth;
40 var offset_width = boundingBox.get('offsetWidth');
41 var selectedListItem = boundingBox.one('span.current');
42- valueX = this._mouseX - (boundingBox.get('offsetWidth') / 2);
43+ var valueX = this._mouseX - (boundingBox.get('offsetWidth') / 2);
44 var valueY;
45 if (Y.Lang.isValue(selectedListItem)) {
46 valueY = (this._mouseY -
47
48=== modified file 'lib/lp/app/javascript/client.js'
49--- lib/lp/app/javascript/client.js 2017-07-21 17:49:13 +0000
50+++ lib/lp/app/javascript/client.js 2017-07-21 17:49:13 +0000
51@@ -265,7 +265,7 @@
52 * @return {String} URL
53 */
54 module.get_view_url = function(entry, view_name, namespace, query){
55- entry_url = Y.lp.get_url_path(entry.get('web_link'));
56+ var entry_url = Y.lp.get_url_path(entry.get('web_link'));
57 var querystring = Y.QueryString.stringify(query);
58 if (querystring !== '') {
59 querystring = '?' + querystring;
60@@ -1016,7 +1016,7 @@
61 },
62
63 get_oops_id: function(response) {
64- var oops_re = /code class\="oopsid">(OOPS-[^<]*)/;
65+ var oops_re = /code class="oopsid">(OOPS-[^<]*)/;
66 var result = response.responseText.match(oops_re);
67 if (result === null) {
68 return null;
69
70=== modified file 'lib/lp/app/javascript/comment.js'
71--- lib/lp/app/javascript/comment.js 2014-05-28 20:38:48 +0000
72+++ lib/lp/app/javascript/comment.js 2017-07-21 17:49:13 +0000
73@@ -54,7 +54,7 @@
74 var that = this;
75 var comment_number = parseInt(
76 link.get('id').replace('mark-spam-', ''), 10);
77- parameters = {
78+ var parameters = {
79 visible: visible,
80 comment_number: comment_number
81 };
82@@ -408,7 +408,8 @@
83 * @param callback On success, call this with the HTML of the comment.
84 */
85 get_comment_HTML: function(comment_entry, callback) {
86- fragment_url = 'comments/' + comment_entry.get('id') + '/+fragment';
87+ var fragment_url = 'comments/' + comment_entry.get('id') +
88+ '/+fragment';
89 Y.io(fragment_url, {
90 on: {
91 success: function(id, response){
92
93=== modified file 'lib/lp/app/javascript/inlinehelp/tests/test_inlinehelp.js'
94--- lib/lp/app/javascript/inlinehelp/tests/test_inlinehelp.js 2017-07-21 17:49:13 +0000
95+++ lib/lp/app/javascript/inlinehelp/tests/test_inlinehelp.js 2017-07-21 17:49:13 +0000
96@@ -109,7 +109,7 @@
97 var target_link = e.target;
98
99 // init the overlay and show it
100- overlay = new Y.lp.app.inlinehelp.InlineHelpOverlay({
101+ var overlay = new Y.lp.app.inlinehelp.InlineHelpOverlay({
102 'contentUrl': target_link.get('href')
103 });
104 overlay.render();
105
106=== modified file 'lib/lp/app/javascript/lp.js'
107--- lib/lp/app/javascript/lp.js 2012-05-17 20:38:13 +0000
108+++ lib/lp/app/javascript/lp.js 2017-07-21 17:49:13 +0000
109@@ -77,7 +77,7 @@
110 * Return the path portion of the specified URL.
111 */
112 Y.lp.get_url_path = function(url) {
113- pathname = get_hyperlink(url).get('pathname');
114+ var pathname = get_hyperlink(url).get('pathname');
115 if (!pathname || pathname[0] !== '/') {
116 // Ensure the leading slash often dropped by msie.
117 pathname = '/' + pathname;
118
119=== modified file 'lib/lp/app/javascript/ordering/tests/test_orderby_widget.js'
120--- lib/lp/app/javascript/ordering/tests/test_orderby_widget.js 2013-03-20 03:41:40 +0000
121+++ lib/lp/app/javascript/ordering/tests/test_orderby_widget.js 2017-07-21 17:49:13 +0000
122@@ -368,7 +368,7 @@
123 };
124 this.orderby.updateVisibility(visibility_rules);
125 Y.each(this.orderby.get('li_nodes'), function(node) {
126- sort_name = node.get('id').replace('sort-', '');
127+ var sort_name = node.get('id').replace('sort-', '');
128 if (visibility_rules[sort_name] === true) {
129 Assert.isFalse(node._isHidden());
130 } else {
131
132=== modified file 'lib/lp/app/javascript/picker/tests/test_picker.js'
133--- lib/lp/app/javascript/picker/tests/test_picker.js 2017-07-21 17:49:13 +0000
134+++ lib/lp/app/javascript/picker/tests/test_picker.js 2017-07-21 17:49:13 +0000
135@@ -768,7 +768,7 @@
136 },
137
138 test_save_does_not_clear_widget_when_clear_on_save_is_false: function () {
139- picker = new Y.lp.ui.picker.Picker({clear_on_save: false});
140+ var picker = new Y.lp.ui.picker.Picker({clear_on_save: false});
141 picker.render();
142
143 picker._search_input.set('value', 'foo');
144@@ -789,7 +789,7 @@
145 },
146
147 test_cancel_event_clears_widget_when_clear_on_cancel_true: function () {
148- picker = new Y.lp.ui.picker.Picker({clear_on_cancel: true});
149+ var picker = new Y.lp.ui.picker.Picker({clear_on_cancel: true});
150 picker.render();
151
152 picker._search_input.set('value', 'foo');
153
154=== modified file 'lib/lp/app/javascript/subscribers/subscribers_list.js'
155--- lib/lp/app/javascript/subscribers/subscribers_list.js 2017-07-20 13:29:41 +0000
156+++ lib/lp/app/javascript/subscribers/subscribers_list.js 2017-07-21 17:49:13 +0000
157@@ -523,6 +523,7 @@
158 } else {
159 loader.subscribers_list.stopActivity();
160 }
161+ var error_msg;
162 if (response.status === 400 && response.responseText !== undefined) {
163 error_msg = response.responseText;
164 } else {
165
166=== modified file 'lib/lp/app/javascript/tests/test_expander.js'
167--- lib/lp/app/javascript/tests/test_expander.js 2017-07-21 17:49:13 +0000
168+++ lib/lp/app/javascript/tests/test_expander.js 2017-07-21 17:49:13 +0000
169@@ -209,7 +209,7 @@
170 wrap_has_run = true;
171 };
172
173- root = this.makeExpanderHooks();
174+ var root = this.makeExpanderHooks();
175 var expander = new module.Expander(
176 root.one('.icon'), root.one('.content'));
177 expander.wrapNodeWithLink = fake_wrapNodeWithLink;
178
179=== modified file 'lib/lp/app/javascript/tests/test_listing_navigator.js'
180--- lib/lp/app/javascript/tests/test_listing_navigator.js 2017-07-21 17:49:13 +0000
181+++ lib/lp/app/javascript/tests/test_listing_navigator.js 2017-07-21 17:49:13 +0000
182@@ -30,7 +30,7 @@
183 target = Y.Node.create('<div "id=#client-listing"></div>');
184 target_parent.appendChild(target);
185 }
186- lp_cache = {
187+ var lp_cache = {
188 context: {
189 resource_type_link: 'http://foo_type',
190 web_link: 'http://foo/bar'
191@@ -250,8 +250,8 @@
192 * Return a ListingNavigator ordered by 'intensity'
193 */
194 get_intensity_listing: function() {
195- mock_io = new Y.lp.testing.mockio.MockIo();
196- lp_cache = {
197+ var mock_io = new Y.lp.testing.mockio.MockIo();
198+ var lp_cache = {
199 context: {
200 resource_type_link: 'http://foo_type',
201 web_link: 'http://foo/bar'
202
203=== modified file 'lib/lp/app/javascript/tests/test_longpoll.js'
204--- lib/lp/app/javascript/tests/test_longpoll.js 2017-07-21 17:49:13 +0000
205+++ lib/lp/app/javascript/tests/test_longpoll.js 2017-07-21 17:49:13 +0000
206@@ -216,7 +216,7 @@
207 var manager = longpoll.getLongPollManager();
208 // Monkeypatch io to simulate a request timeout.
209 manager._io = function(uri, config) {
210- response = {status: error_code};
211+ var response = {status: error_code};
212 config.on.failure(4, response);
213 };
214
215
216=== modified file 'lib/lp/app/javascript/tests/test_lp_client.js'
217--- lib/lp/app/javascript/tests/test_lp_client.js 2015-10-22 00:15:41 +0000
218+++ lib/lp/app/javascript/tests/test_lp_client.js 2017-07-21 17:49:13 +0000
219@@ -110,18 +110,18 @@
220 "/api/devel/has/slash/field");
221 },
222 test_view_url: function() {
223- entry_repr = {web_link: 'http://example.com/context'};
224+ var entry_repr = {web_link: 'http://example.com/context'};
225 var context = new Y.lp.client.Entry(null, entry_repr, null);
226- expected = '/context/+myview/++mynamespace++';
227- actual = Y.lp.client.get_view_url(
228+ var expected = '/context/+myview/++mynamespace++';
229+ var actual = Y.lp.client.get_view_url(
230 context, '+myview', 'mynamespace');
231 Assert.areEqual(expected, actual);
232 },
233 test_get_form_url: function() {
234- entry_repr = {web_link: 'http://example.com/context'};
235+ var entry_repr = {web_link: 'http://example.com/context'};
236 var context = new Y.lp.client.Entry(null, entry_repr, null);
237- expected = '/context/+myview/++form++';
238- actual = Y.lp.client.get_form_url(context, '+myview');
239+ var expected = '/context/+myview/++form++';
240+ var actual = Y.lp.client.get_form_url(context, '+myview');
241 Assert.areEqual(expected, actual);
242 },
243 test_load_model: function(){
244
245=== modified file 'lib/lp/blueprints/javascript/workitems.js'
246--- lib/lp/blueprints/javascript/workitems.js 2012-06-13 14:34:14 +0000
247+++ lib/lp/blueprints/javascript/workitems.js 2017-07-21 17:49:13 +0000
248@@ -78,7 +78,7 @@
249
250 // For each milestone, store an array containing the expander
251 // object and the default state for it
252- default_expanded = widget_body.hasClass('default-expanded');
253+ var default_expanded = widget_body.hasClass('default-expanded');
254 expanders[index].push(new Array(expander, default_expanded));
255 }
256 namespace._add_expanders = add_expanders;
257
258=== modified file 'lib/lp/bugs/javascript/buglisting_utils.js'
259--- lib/lp/bugs/javascript/buglisting_utils.js 2013-03-20 03:41:40 +0000
260+++ lib/lp/bugs/javascript/buglisting_utils.js 2017-07-21 17:49:13 +0000
261@@ -277,7 +277,7 @@
262 _extraRenderUI: function() {
263 var form_content = this.buildFormContent();
264 var on_submit_callback = Y.bind(this.handleOverlaySubmit, this);
265- util_overlay = new Y.lp.ui.FormOverlay({
266+ var util_overlay = new Y.lp.ui.FormOverlay({
267 align: 'left',
268 headerContent: '<h2>Visible information</h2>',
269 centered: true,
270
271=== modified file 'lib/lp/bugs/javascript/bugtask_index.js'
272--- lib/lp/bugs/javascript/bugtask_index.js 2017-07-21 17:49:13 +0000
273+++ lib/lp/bugs/javascript/bugtask_index.js 2017-07-21 17:49:13 +0000
274@@ -164,7 +164,7 @@
275 };
276
277 // Call linkBranch() on the bug.
278- config = {
279+ var config = {
280 on: {
281 success: function(bug_branch_entry) {
282 link_branch_link.toggleClass(
283@@ -771,8 +771,8 @@
284 // Do not show the team selection, if a user is not a member
285 // of any team,
286 if (conf.hide_assignee_team_selection) {
287- content_box = assignee_picker.get('contentBox');
288- search_box = content_box.one('.yui3-picker-search-box');
289+ var content_box = assignee_picker.get('contentBox');
290+ var search_box = content_box.one('.yui3-picker-search-box');
291 search_box.setStyle('display', 'none');
292 var info = Y.Node.create('<p style="padding-top: 1em;"></p>')
293 .set('text', 'You may only assign yourself because you are ' +
294@@ -1021,7 +1021,7 @@
295 duration: namespace.ANIM_DURATION});
296 success_anim.run();
297 }
298- batch_url_div = Y.one('#next-batch-url');
299+ var batch_url_div = Y.one('#next-batch-url');
300 if (Y.Lang.isValue(batch_url_div)) {
301 batched_comments_url = batch_url_div.get(
302 'innerHTML');
303
304=== modified file 'lib/lp/bugs/javascript/subscription.js'
305--- lib/lp/bugs/javascript/subscription.js 2013-04-09 05:05:39 +0000
306+++ lib/lp/bugs/javascript/subscription.js 2017-07-21 17:49:13 +0000
307@@ -352,7 +352,7 @@
308 * ObjectLink class to unify link elements for better consistency.
309 * Needed because some objects expose `title`, others expose `display_name`.
310 */
311-ObjectLink = function(self, title, url) {
312+var ObjectLink = function(self, title, url) {
313 return {
314 self: self,
315 title: title,
316@@ -847,11 +847,12 @@
317 }
318 }
319 var replacements = {};
320- for (var property in subscription.vars) {
321+ var property;
322+ for (property in subscription.vars) {
323 replacements[property] = var_replacer(
324 undefined, subscription.vars[property]);
325 }
326- for (var property in additional_vars) {
327+ for (property in additional_vars) {
328 replacements[property] = var_replacer(
329 property, additional_vars[property]);
330 }
331
332=== modified file 'lib/lp/bugs/javascript/tests/test_bug_subscription_portlet.js'
333--- lib/lp/bugs/javascript/tests/test_bug_subscription_portlet.js 2013-03-20 03:41:40 +0000
334+++ lib/lp/bugs/javascript/tests/test_bug_subscription_portlet.js 2017-07-21 17:49:13 +0000
335@@ -380,10 +380,13 @@
336 Y.Assert.areEqual('Change your mail subscription for this bug',
337 overlay.one('h2').get('text'));
338 // We show the Discussion status.
339- var status = overlay.one('.subscription-status');
340- Y.Assert.isFalse(overlay.one('span.Discussion').hasClass('hidden'));
341- Y.Assert.isTrue(overlay.one('span.Details').hasClass('hidden'));
342- Y.Assert.isTrue(overlay.one('span.Lifecycle').hasClass('hidden'));
343+ var status_node = overlay.one('.subscription-status');
344+ Y.Assert.isFalse(status_node.one(
345+ 'span.Discussion').hasClass('hidden'));
346+ Y.Assert.isTrue(status_node.one(
347+ 'span.Details').hasClass('hidden'));
348+ Y.Assert.isTrue(status_node.one(
349+ 'span.Lifecycle').hasClass('hidden'));
350 // The action links are visible except for Discussion.
351 var action_links = overlay.one('.subscription-actions');
352 Y.Assert.isTrue(action_links.one('.Discussion a').hasClass('hidden'));
353@@ -402,10 +405,13 @@
354 this.link().simulate('click');
355 var overlay = Y.one('.pretty-overlay-window');
356 // We show the Lifecycle status.
357- var status = overlay.one('.subscription-status');
358- Y.Assert.isTrue(overlay.one('span.Discussion').hasClass('hidden'));
359- Y.Assert.isFalse(overlay.one('span.Details').hasClass('hidden'));
360- Y.Assert.isTrue(overlay.one('span.Lifecycle').hasClass('hidden'));
361+ var status_node = overlay.one('.subscription-status');
362+ Y.Assert.isTrue(status_node.one(
363+ 'span.Discussion').hasClass('hidden'));
364+ Y.Assert.isFalse(status_node.one(
365+ 'span.Details').hasClass('hidden'));
366+ Y.Assert.isTrue(status_node.one(
367+ 'span.Lifecycle').hasClass('hidden'));
368 // The action links are visible except for Lifecycle.
369 var action_links = overlay.one('.subscription-actions');
370 Y.Assert.isFalse(action_links.one(
371@@ -425,10 +431,13 @@
372 this.link().simulate('click');
373 var overlay = Y.one('.pretty-overlay-window');
374 // We show the Lifecycle status.
375- var status = overlay.one('.subscription-status');
376- Y.Assert.isTrue(overlay.one('span.Discussion').hasClass('hidden'));
377- Y.Assert.isTrue(overlay.one('span.Details').hasClass('hidden'));
378- Y.Assert.isFalse(overlay.one('span.Lifecycle').hasClass('hidden'));
379+ var status_node = overlay.one('.subscription-status');
380+ Y.Assert.isTrue(status_node.one(
381+ 'span.Discussion').hasClass('hidden'));
382+ Y.Assert.isTrue(status_node.one(
383+ 'span.Details').hasClass('hidden'));
384+ Y.Assert.isFalse(status_node.one(
385+ 'span.Lifecycle').hasClass('hidden'));
386 // The action links are visible except for Lifecycle.
387 var action_links = overlay.one('.subscription-actions');
388 Y.Assert.isFalse(action_links.one(
389
390=== modified file 'lib/lp/bugs/javascript/tests/test_official_bug_tags.js'
391--- lib/lp/bugs/javascript/tests/test_official_bug_tags.js 2017-07-21 17:49:13 +0000
392+++ lib/lp/bugs/javascript/tests/test_official_bug_tags.js 2017-07-21 17:49:13 +0000
393@@ -27,8 +27,8 @@
394 test_setup_bug_tags_table: function() {
395 // The bug tags table is visible and the html form is not.
396 module.setup_official_bug_tag_management();
397- html_form = Y.one('[name=launchpadform]');
398- tags_table = Y.one('#layout-table');
399+ var html_form = Y.one('[name=launchpadform]');
400+ var tags_table = Y.one('#layout-table');
401 Y.Assert.areEqual('none', html_form.getStyle('display'));
402 Y.Assert.areEqual('block', tags_table.getStyle('display'));
403 },
404
405=== modified file 'lib/lp/bugs/javascript/tests/test_pre_search.js'
406--- lib/lp/bugs/javascript/tests/test_pre_search.js 2017-07-21 17:49:13 +0000
407+++ lib/lp/bugs/javascript/tests/test_pre_search.js 2017-07-21 17:49:13 +0000
408@@ -34,7 +34,7 @@
409 * A loading message is added to the footer slot.
410 */
411 test_loading_message: function() {
412- picker = new FauxPicker();
413+ var picker = new FauxPicker();
414 module._do_pre_search(picker, 'BUG-ID');
415 ArrayAssert.contains(
416 'set footer_slot = Loading suggestions...',
417@@ -47,7 +47,7 @@
418 * value.
419 */
420 test_min_search_length: function() {
421- picker = new FauxPicker();
422+ var picker = new FauxPicker();
423 module._do_pre_search(picker, 'BUG-ID');
424 ArrayAssert.contains(
425 'get min_search_chars',
426@@ -62,7 +62,7 @@
427 * disbled so the user can enter a search.
428 */
429 test_disable_search_mode: function() {
430- picker = new FauxPicker();
431+ var picker = new FauxPicker();
432 module._do_pre_search(picker, 'BUG-ID');
433 ArrayAssert.contains(
434 'fire search with BUG-ID',
435
436=== modified file 'lib/lp/bugs/javascript/tests/test_subscription.js'
437--- lib/lp/bugs/javascript/tests/test_subscription.js 2017-07-21 17:49:13 +0000
438+++ lib/lp/bugs/javascript/tests/test_subscription.js 2017-07-21 17:49:13 +0000
439@@ -299,7 +299,7 @@
440 Y.Assert.areEqual(1, subs.length);
441 // And there is a 'teams' variable containing all the team objects.
442 var teams_found = [];
443- for (index = 0; index < subs[0].vars.teams.length; index++) {
444+ for (var index = 0; index < subs[0].vars.teams.length; index++) {
445 teams_found.push(subs[0].vars.teams[index].title);
446 }
447 Y.ArrayAssert.itemsAreEqual(['team 1', 'team 2'], teams_found);
448@@ -823,7 +823,7 @@
449 Y.Assert.areEqual(1, subs.length);
450 // And there is a 'teams' variable containing all the team objects.
451 var teams_found = [];
452- for (index = 0; index < subs[0].vars.teams.length; index++) {
453+ for (var index = 0; index < subs[0].vars.teams.length; index++) {
454 teams_found.push(subs[0].vars.teams[index].title);
455 }
456 Y.ArrayAssert.itemsAreEqual(['team 1', 'team 2'], teams_found);
457@@ -889,7 +889,7 @@
458 Y.Assert.areEqual(1, subs.length);
459 // And there is a 'teams' variable containing all the team objects.
460 var teams_found = [];
461- for (index = 0; index < subs[0].vars.teams.length; index++) {
462+ for (var index = 0; index < subs[0].vars.teams.length; index++) {
463 teams_found.push(subs[0].vars.teams[index].title);
464 }
465 Y.ArrayAssert.itemsAreEqual(['team 1', 'team 2'], teams_found);
466@@ -970,7 +970,8 @@
467 };
468 info.count = info.direct.count + info.from_duplicates.count;
469
470- direct_info = module._get_direct_subscription_information(info);
471+ var direct_info = module._get_direct_subscription_information(
472+ info);
473 Y.Assert.areEqual(
474 module._reasons.NOT_SUBSCRIBED,
475 direct_info.reason);
476@@ -993,7 +994,8 @@
477 info.count = info.direct.count + info.from_duplicates.count;
478 window.LP.cache.subscription_info.push(true);
479
480- direct_info = module._get_direct_subscription_information(info);
481+ var direct_info = module._get_direct_subscription_information(
482+ info);
483 Y.Assert.areSame(
484 module._reasons.NOT_PERSONALLY_SUBSCRIBED,
485 direct_info.reason);
486@@ -1015,7 +1017,8 @@
487 from_duplicates: _constructCategory(['dupe'])
488 };
489 info.count = info.direct.count + info.from_duplicates.count;
490- direct_info = module._get_direct_subscription_information(info);
491+ var direct_info = module._get_direct_subscription_information(
492+ info);
493 Y.Assert.areSame(
494 module._reasons.NOT_PERSONALLY_SUBSCRIBED,
495 direct_info.reason);
496@@ -1036,7 +1039,8 @@
497 muted: true
498 };
499 info.count = info.direct.count;
500- direct_info = module._get_direct_subscription_information(info);
501+ var direct_info = module._get_direct_subscription_information(
502+ info);
503 Y.Assert.areSame(
504 module._reasons.MUTED_SUBSCRIPTION,
505 direct_info.reason);
506
507=== modified file 'lib/lp/code/javascript/branch.subscription.js'
508--- lib/lp/code/javascript/branch.subscription.js 2013-03-20 03:41:40 +0000
509+++ lib/lp/code/javascript/branch.subscription.js 2017-07-21 17:49:13 +0000
510@@ -128,7 +128,7 @@
511 var review_level_update = review_level.options[
512 review_level.selectedIndex].text;
513
514- config = {
515+ var config = {
516 on: {
517 success: function(updated_entry) {
518 Y.fire('branch:subscriber-list-stale');
519
520=== modified file 'lib/lp/code/javascript/branchmergeproposal.inlinecomments.js'
521--- lib/lp/code/javascript/branchmergeproposal.inlinecomments.js 2017-07-21 11:01:00 +0000
522+++ lib/lp/code/javascript/branchmergeproposal.inlinecomments.js 2017-07-21 17:49:13 +0000
523@@ -161,6 +161,7 @@
524 comment_date;
525
526 if (comments_tr === null) {
527+ var colspan;
528 if (Y.all('table.ssdiff').size() > 0) {
529 colspan = 4;
530 } else {
531@@ -174,7 +175,7 @@
532 Y.one('#diff-line-' + comment.line_number)
533 .insert(comments_tr, 'after');
534 }
535- comments_div = comments_tr.one('div');
536+ var comments_div = comments_tr.one('div');
537
538 var newrow = Y.Node.create(
539 '<div class="boardComment">' +
540
541=== modified file 'lib/lp/code/javascript/branchmergeproposal.status.js'
542--- lib/lp/code/javascript/branchmergeproposal.status.js 2013-03-20 22:32:47 +0000
543+++ lib/lp/code/javascript/branchmergeproposal.status.js 2017-07-21 17:49:13 +0000
544@@ -28,7 +28,7 @@
545 Y.lp.app.errors.display_error(null, err);
546 };
547 status_choice_edit.on('save', function(e) {
548- config = {
549+ var config = {
550 on: {
551 success: function(entry) {
552 var cb = status_choice_edit.get('contentBox');
553@@ -51,7 +51,7 @@
554 }
555 };
556 status_content.one('img').set('src', '/@@/spinner');
557- lp_client = new Y.lp.client.Launchpad();
558+ var lp_client = new Y.lp.client.Launchpad();
559 lp_client.named_post(
560 LP.cache.context.self_link, 'setStatus', config);
561
562@@ -74,7 +74,7 @@
563 */
564 function update_summary() {
565 var existing_summary = Y.one('#proposal-summary tbody');
566- SUMMARY_SNIPPET = '+pagelet-summary';
567+ var SUMMARY_SNIPPET = '+pagelet-summary';
568 Y.io(SUMMARY_SNIPPET, {
569 on: {
570 success: function(id, response) {
571@@ -86,10 +86,12 @@
572 var old_pos = 1;
573 var new_size = new_rows.size();
574 var old_size = old_rows.size();
575+ var new_row;
576+ var old_row;
577
578 while (new_pos < new_size && old_pos < old_size) {
579- var new_row = new_rows.item(new_pos);
580- var old_row = old_rows.item(old_pos);
581+ new_row = new_rows.item(new_pos);
582+ old_row = old_rows.item(old_pos);
583 var new_id = new_row.get('id');
584 var old_id = old_row.get('id');
585 if (new_id == old_id) {
586@@ -113,12 +115,12 @@
587 }
588 // Remove all left over old rows, and add all left over new rows.
589 while (old_pos < old_size) {
590- var old_row = old_rows.item(old_pos);
591+ old_row = old_rows.item(old_pos);
592 ++old_pos;
593 old_row.remove();
594 }
595 while (new_pos < new_size) {
596- var new_row = new_rows.item(new_pos);
597+ new_row = new_rows.item(new_pos);
598 ++new_pos;
599 if (new_row.get('id') != 'summary-row-b-diff') {
600 existing_summary.append(new_row);
601
602=== modified file 'lib/lp/code/javascript/requestbuild_overlay.js'
603--- lib/lp/code/javascript/requestbuild_overlay.js 2012-09-10 21:02:05 +0000
604+++ lib/lp/code/javascript/requestbuild_overlay.js 2017-07-21 17:49:13 +0000
605@@ -52,7 +52,7 @@
606 namespace.hookUpDailyBuildsSchedule = function() {
607 var logged_in = LP.links.me !== undefined;
608 if (logged_in) {
609- build_now_link = Y.one('#request-daily-build');
610+ var build_now_link = Y.one('#request-daily-build');
611 if( build_now_link !== null ) {
612 build_now_link.removeClass('hidden');
613 Y.lp.code.requestbuild_overlay.connect_requestdailybuild();
614@@ -316,17 +316,14 @@
615 success: request_build_response_handler.getSuccessHandler(
616 function(handler, id, response) {
617 var errors = [],
618- error_header = null,
619- error_header_text = "",
620- build_info, build_html, error_info,
621- nr_new, info_header, field_name;
622+ field_name;
623 // The content type is used to tell a fully successful
624 // request from a partially successful one. Successful
625 // responses simply return the HTML snippet for the builds
626 // table. If this ever causes problems, the view should
627 // be changed to always return JSON and to provide an
628 // attribute that identifies the type of response.
629- content_type = response.getResponseHeader('Content-type');
630+ var content_type = response.getResponseHeader('Content-type');
631 if( content_type !== 'application/json' ) {
632 // We got the HTML for the builds back, we're done.
633 request_build_overlay.hide();
634@@ -340,16 +337,16 @@
635 // supports displaying errors so we will construct
636 // our own HTML where the informational text will be
637 // appropriately displayed.
638- build_info = Y.JSON.parse(response.responseText);
639+ var build_info = Y.JSON.parse(response.responseText);
640
641 // The result of rendering the +builds view
642- build_html = build_info.builds;
643+ var build_html = build_info.builds;
644 // Any builds already pending (informational only)
645- pending_build_info = build_info.already_pending;
646+ var pending_build_info = build_info.already_pending;
647 // Other more critical errors
648- error_info = build_info.errors;
649+ var error_info = build_info.errors;
650
651- info_header = get_info_header(
652+ var info_header = get_info_header(
653 get_new_builds_message(
654 build_html, current_builds),
655 pending_build_info);
656@@ -359,7 +356,7 @@
657 errors.push(error_info[field_name]);
658 }
659 }
660- error_container = Y.Node.create('<div></div>');
661+ var error_container = Y.Node.create('<div></div>');
662 if (info_header !== null) {
663 error_container.append(info_header);
664 if (errors.length > 0) {
665@@ -514,7 +511,7 @@
666 success:
667 function(build_info) {
668 var distro_nodes,
669- size, build_record, distro_name, archive_token;
670+ size, build_record, distro_name, archive_token, i;
671 // We save the inner html of each distro series checkbox
672 // so we can restore it when required.
673 distro_nodes = get_distroseries_nodes();
674
675=== modified file 'lib/lp/code/javascript/tests/test_requestbuild_overlay.js'
676--- lib/lp/code/javascript/tests/test_requestbuild_overlay.js 2013-03-20 03:41:40 +0000
677+++ lib/lp/code/javascript/tests/test_requestbuild_overlay.js 2017-07-21 17:49:13 +0000
678@@ -16,7 +16,7 @@
679 LP.cache.context = {
680 web_link: "http://code.launchpad.dev/~foobar/myrecipe"};
681 // Prepare testbed.
682- fixture = Y.one("#testbed");
683+ var fixture = Y.one("#testbed");
684 var template = Y.one('#build-schedule-template').getContent();
685 var test_node = Y.Node.create(template);
686 fixture.append(test_node);
687@@ -110,7 +110,7 @@
688 web_link: "http://code.launchpad.dev/~foobar/myrecipe",
689 self_link: "http://api.launchpad.dev/devel/~foobar/myrecipe"};
690 // Prepare testbed.
691- fixture = Y.one("#testbed");
692+ var fixture = Y.one("#testbed");
693 var template = Y.one('#build-schedule-template').getContent();
694 var test_node = Y.Node.create(template);
695 fixture.append(test_node);
696@@ -235,7 +235,7 @@
697 name: "lp.code.requestbuild_overlay.buildschedule",
698
699 setUp: function() {
700- fixture = Y.one("#testbed");
701+ var fixture = Y.one("#testbed");
702 var template = Y.one('#build-schedule-template').getContent();
703 var test_node = Y.Node.create(template);
704 fixture.append(test_node);
705
706=== modified file 'lib/lp/registry/javascript/distroseries/tests/test_widgets.js'
707--- lib/lp/registry/javascript/distroseries/tests/test_widgets.js 2012-10-26 10:00:20 +0000
708+++ lib/lp/registry/javascript/distroseries/tests/test_widgets.js 2017-07-21 17:49:13 +0000
709@@ -243,7 +243,7 @@
710
711 test_populate_archindep_tags: function() {
712 this.setup_widget_client();
713- distroseries = {api_uri: "ubuntu/hoary", value: "3"};
714+ var distroseries = {api_uri: "ubuntu/hoary", value: "3"};
715 this.widget._populate_archindep_tags(distroseries);
716 Assert.areEqual("i386", this.widget._archindep_tags["3"]);
717 },
718
719=== modified file 'lib/lp/registry/javascript/distroseriesdifferences_details.js'
720--- lib/lp/registry/javascript/distroseriesdifferences_details.js 2017-07-21 17:49:13 +0000
721+++ lib/lp/registry/javascript/distroseriesdifferences_details.js 2017-07-21 17:49:13 +0000
722@@ -58,9 +58,9 @@
723 this._toggle.toggleClass('treeCollapsed').toggleClass('treeExpanded');
724
725 // Only insert if there isn't already a container row there.
726- var detail_row = this._row.next();
727- if (detail_row === null ||
728- !detail_row.hasClass('diff-extra')) {
729+ var details_row = this._row.next();
730+ if (details_row === null ||
731+ !details_row.hasClass('diff-extra')) {
732 details_row = Y.Node.create([
733 '<table><tr class="diff-extra hidden ',
734 parsed.source_name + '">',
735@@ -719,7 +719,7 @@
736 }
737 else if (state === 'COMPLETED') {
738 set_package_diff_status(container, 'COMPLETED');
739- url_uri = [
740+ var url_uri = [
741 dsd_link,
742 parent ? 'parent_package_diff_url' : 'package_diff_url'
743 ].join('/');
744@@ -898,6 +898,7 @@
745 var nb_inputs = all_inputs.size();
746 var summary = Y.Node.create('<div><ul></ul></div>'),
747 summary_ul = summary.one('ul');
748+ var i;
749 for (i=0; i < Math.min(namespace.MAX_PACKAGES, nb_inputs) ; i++) {
750 var input = all_inputs.shift();
751 var tr = input.ancestor('tr');
752
753=== modified file 'lib/lp/registry/javascript/milestonetable.js'
754--- lib/lp/registry/javascript/milestonetable.js 2013-04-09 05:05:39 +0000
755+++ lib/lp/registry/javascript/milestonetable.js 2017-07-21 17:49:13 +0000
756@@ -27,7 +27,7 @@
757
758 module._ensure_table_is_seen = function(tbody) {
759 // Remove the 'hidden' class from the table to ensure it is visible.
760- table = tbody.ancestor();
761+ var table = tbody.ancestor();
762 table.removeClass('hidden');
763 };
764
765
766=== modified file 'lib/lp/registry/javascript/structural-subscription.js'
767--- lib/lp/registry/javascript/structural-subscription.js 2017-07-21 17:49:13 +0000
768+++ lib/lp/registry/javascript/structural-subscription.js 2017-07-21 17:49:13 +0000
769@@ -1055,8 +1055,7 @@
770 * Overlay must not have a recipient picker, but a simple recipient label.
771 */
772 function set_recipient_label(content_node, filter_info) {
773- var recipient_label = content_node.one('input[name="recipient"] + span'),
774- teams = LP.cache.administratedTeams;
775+ var recipient_label = content_node.one('input[name="recipient"] + span');
776 if (filter_info !== undefined && filter_info.subscriber_is_team) {
777 var team = get_team(filter_info.subscriber_link);
778 recipient_label.set('text', team.title);
779@@ -1509,6 +1508,7 @@
780 .set('href', subscription_data.target_url)
781 .set('text', subscription_data.target_title));
782
783+ var j;
784 for (j=0; j<subscription_data.filters.length; j++) {
785 var filter_info = subscription_data.filters[j];
786 var filter = filter_info.filter;
787
788=== modified file 'lib/lp/registry/javascript/team.js'
789--- lib/lp/registry/javascript/team.js 2014-01-08 07:33:18 +0000
790+++ lib/lp/registry/javascript/team.js 2017-07-21 17:49:13 +0000
791@@ -37,7 +37,7 @@
792 addmember_link.removeClass('hidden');
793 spinner.addClass('hidden');
794 };
795- lp_client = new Y.lp.client.Launchpad();
796+ var lp_client = new Y.lp.client.Launchpad();
797
798 var error_handler = new Y.lp.client.ErrorHandler();
799 error_handler.clearProgressUI = disable_spinner;
800@@ -45,7 +45,7 @@
801 Y.lp.app.errors.display_error(addmember_link, error_msg);
802 };
803
804- addmember_config = {
805+ var addmember_config = {
806 on: {
807 success: function(change_and_status) {
808 var did_status_change = change_and_status[0];
809@@ -98,16 +98,16 @@
810 count = parseInt(count, 10) + 1;
811 count_elem.set('innerHTML', count);
812 }
813- person_repr = Y.Node.create(
814+ var person_repr = Y.Node.create(
815 '<li>' + person_html + '</li>');
816 members_section.removeClass('hidden');
817 members_ul.insertBefore(person_repr, first_node);
818- anim = Y.lp.anim.green_flash({node: person_repr});
819+ var anim = Y.lp.anim.green_flash({node: person_repr});
820 anim.run();
821 disable_spinner();
822 };
823
824- xhtml_person_config = {
825+ var xhtml_person_config = {
826 on: {
827 success: xhtml_person_handler,
828 failure: error_handler.getFailureHandler()
829
830=== modified file 'lib/lp/registry/javascript/team_mailinglists.js'
831--- lib/lp/registry/javascript/team_mailinglists.js 2013-03-20 22:32:47 +0000
832+++ lib/lp/registry/javascript/team_mailinglists.js 2017-07-21 17:49:13 +0000
833@@ -106,7 +106,7 @@
834 // sophisticated model creation will be needed for threaded by
835 // subject.
836 var i;
837- filter_func = function(item) {
838+ var filter_func = function(item) {
839 var nested_ids = messages[i].nested_messages;
840 var index = Y.Array.indexOf(nested_ids, item.message_id);
841 return (index !== -1);
842@@ -132,7 +132,8 @@
843 // Create a new array of the nested messages from the ids
844 // provided by the current message's `nested_messages`
845 // parameter.
846- nested_messages = Y.Array.filter(messages, filter_func);
847+ var nested_messages = Y.Array.filter(
848+ messages, filter_func);
849 this._create_mustache_model(
850 nested_messages,
851 mustache_model,
852
853=== modified file 'lib/lp/registry/javascript/tests/test_distroseriesdifferences_details.js'
854--- lib/lp/registry/javascript/tests/test_distroseriesdifferences_details.js 2017-07-21 17:49:13 +0000
855+++ lib/lp/registry/javascript/tests/test_distroseriesdifferences_details.js 2017-07-21 17:49:13 +0000
856@@ -166,7 +166,7 @@
857 test_add_msg_node: function() {
858 var msg_txt = 'Exemple text';
859 var msg_node = Y.Node.create(msg_txt);
860- placeholder = Y.one('#placeholder');
861+ var placeholder = Y.one('#placeholder');
862 module.add_msg_node(placeholder, msg_node);
863 Y.Assert.areEqual(
864 placeholder.one('.package-diff-placeholder').get('innerHTML'),
865@@ -669,7 +669,7 @@
866 };
867 // The event comment_added will be fired.
868 var event_fired = false;
869- event_handler = function(e) {
870+ var event_handler = function(e) {
871 event_fired = true;
872 Y.ObjectAssert.areEqual(comment_entry, e.details[0]);
873 };
874@@ -746,7 +746,7 @@
875 };
876 // The event comment_added will be fired.
877 var event_fired = false;
878- event_handler = function(e) {
879+ var event_handler = function(e) {
880 event_fired = true;
881 Y.ObjectAssert.areEqual(comment_entry, e.details[0]);
882 };
883@@ -795,11 +795,11 @@
884 setUp: function() {
885 Y.one("#placeholder").append(Y.Node.create(whole_table));
886 var first_poll = true;
887- pending_voc = [
888+ var pending_voc = [
889 {"token": "PENDING", "selected": true, "title": "Pending"},
890 {"token": "COMPLETED", "title": "Completed"},
891 {"token": "FAILED", "title": "Failed"}];
892- completed_voc = [
893+ var completed_voc = [
894 {"token": "PENDING", "title": "Pending"},
895 {"token": "COMPLETED", "selected": true, "title": "Completed"},
896 {"token": "FAILED", "title": "Failed"}];
897@@ -908,7 +908,7 @@
898
899 create_rows: function(missing_packages) {
900 var placeholder = Y.one("#placeholder");
901- rows_data = [
902+ var rows_data = [
903 ['evolution', '2.0.9-1', '2.0.8-4', missing_packages],
904 ['package', '2.0', '1.0', missing_packages],
905 ['package2', '4.0.4', '0.0.2', missing_packages],
906
907=== modified file 'lib/lp/registry/javascript/tests/test_structural_subscription.js'
908--- lib/lp/registry/javascript/tests/test_structural_subscription.js 2017-07-21 17:49:13 +0000
909+++ lib/lp/registry/javascript/tests/test_structural_subscription.js 2017-07-21 17:49:13 +0000
910@@ -626,9 +626,9 @@
911 module.setup(this.configuration);
912 module._show_add_overlay(this.configuration);
913 // After the setup the overlay should be in the DOM.
914- overlay = Y.one('#accordion-overlay');
915+ var overlay = Y.one('#accordion-overlay');
916 Assert.isNotNull(overlay);
917- submit_button = Y.one('.yui3-lazr-formoverlay-actions button');
918+ var submit_button = Y.one('.yui3-lazr-formoverlay-actions button');
919 submit_button.simulate('click');
920
921 var error_box = Y.one('.yui3-lazr-formoverlay-errors');
922@@ -645,9 +645,9 @@
923 module.setup(this.configuration);
924 module._show_add_overlay(this.configuration);
925 // After the setup the overlay should be in the DOM.
926- overlay = Y.one('#accordion-overlay');
927+ var overlay = Y.one('#accordion-overlay');
928 Assert.isNotNull(overlay);
929- submit_button = Y.one('.yui3-lazr-formoverlay-actions button');
930+ var submit_button = Y.one('.yui3-lazr-formoverlay-actions button');
931 submit_button.simulate('click');
932 // We are now looking at the state after the named post has been
933 // called, but before it has returned with a failure.
934@@ -675,9 +675,9 @@
935 module.setup(this.configuration);
936 module._show_add_overlay(this.configuration);
937 // After the setup the overlay should be in the DOM.
938- overlay = Y.one('#accordion-overlay');
939+ var overlay = Y.one('#accordion-overlay');
940 Assert.isNotNull(overlay);
941- submit_button = Y.one('.yui3-lazr-formoverlay-actions button');
942+ var submit_button = Y.one('.yui3-lazr-formoverlay-actions button');
943 submit_button.simulate('click');
944
945 // Put this stubbed function back.
946@@ -1507,7 +1507,7 @@
947 var called_method = false;
948
949 // Keep the old module's _show_add_overlay, so we can override.
950- old_show_add_overlay = module._show_add_overlay;
951+ var old_show_add_overlay = module._show_add_overlay;
952 var test = this;
953 module._show_add_overlay = function(config) {
954 module._show_add_overlay = old_show_add_overlay;
955
956=== modified file 'lib/lp/registry/javascript/tests/timeline.js'
957--- lib/lp/registry/javascript/tests/timeline.js 2013-03-20 03:41:40 +0000
958+++ lib/lp/registry/javascript/tests/timeline.js 2017-07-21 17:49:13 +0000
959@@ -267,7 +267,7 @@
960 name: 'utils',
961
962 test_isCanvasSupported: function() {
963- supported = Y.lp.registry.timeline.isCanvasSupported();
964+ var supported = Y.lp.registry.timeline.isCanvasSupported();
965 Assert.isTrue(supported);
966 }
967 }));
968
969=== modified file 'lib/lp/registry/javascript/timeline.js'
970--- lib/lp/registry/javascript/timeline.js 2017-07-21 17:49:13 +0000
971+++ lib/lp/registry/javascript/timeline.js 2017-07-21 17:49:13 +0000
972@@ -67,7 +67,7 @@
973 * @class Position
974 * @constructor
975 */
976-Position = function(x, y) {
977+var Position = function(x, y) {
978 this.x = x;
979 this.y = y;
980 };
981@@ -86,7 +86,7 @@
982 * @class SeriesLine
983 * @constructor
984 */
985-SeriesLine = function(timeline_graph, series, start) {
986+var SeriesLine = function(timeline_graph, series, start) {
987 this.timeline_graph = timeline_graph;
988 this.series = series;
989 this.start = start;
990@@ -296,7 +296,7 @@
991 * @class ProjectLine
992 * @constructor
993 */
994-ProjectLine = function(timeline_graph, timeline) {
995+var ProjectLine = function(timeline_graph, timeline) {
996 if (timeline.length === 0) {
997 throw new Error("The timeline array is empty.");
998 }
999
1000=== modified file 'lib/lp/services/webhooks/javascript/deliveries.js'
1001--- lib/lp/services/webhooks/javascript/deliveries.js 2015-10-20 06:47:41 +0000
1002+++ lib/lp/services/webhooks/javascript/deliveries.js 2017-07-21 17:49:13 +0000
1003@@ -177,7 +177,7 @@
1004 '<td>{{event_type}}</td>',
1005 '<td>{{status}}</td>',
1006 '</tr>'].join(' ');
1007- context = {
1008+ var context = {
1009 sprite: this._pick_sprite(delivery),
1010 date: Y.lp.app.date.approximatedate(Y.lp.app.date.parse_date(
1011 delivery.resource.get("date_created"))),
1012
1013=== modified file 'lib/lp/snappy/javascript/tests/test_snap.edit.js'
1014--- lib/lp/snappy/javascript/tests/test_snap.edit.js 2016-06-20 21:17:58 +0000
1015+++ lib/lp/snappy/javascript/tests/test_snap.edit.js 2017-07-21 17:49:13 +0000
1016@@ -85,6 +85,7 @@
1017 'auto_build_pocket'
1018 ];
1019 var field;
1020+ var i;
1021 module.setup();
1022 for (i = 0; i < fields.length; i++) {
1023 field = Y.DOM.byId('field.' + fields[i]);
1024
1025=== modified file 'lib/lp/snappy/javascript/tests/test_snap.update_build_statuses.js'
1026--- lib/lp/snappy/javascript/tests/test_snap.update_build_statuses.js 2016-05-14 00:25:07 +0000
1027+++ lib/lp/snappy/javascript/tests/test_snap.update_build_statuses.js 2017-07-21 17:49:13 +0000
1028@@ -22,7 +22,7 @@
1029 test_dom_updater_plugin_attached: function() {
1030 Y.Assert.isUndefined(this.table._plugins.updater);
1031 module.setup(this.table);
1032- updater = Y.lp.soyuz.dynamic_dom_updater.DynamicDomUpdater;
1033+ var updater = Y.lp.soyuz.dynamic_dom_updater.DynamicDomUpdater;
1034 Y.Assert.areEqual(updater, this.table._plugins.updater);
1035 // Unplug plugin to prevent DOM autorefresh during testing.
1036 // DOM autorefresh should be tested in DynamicDomUpdater testsuite.
1037@@ -33,7 +33,7 @@
1038 test_parameter_evaluator: function() {
1039 // parameterEvaluator should return an object with the ids of
1040 // builds in pending states.
1041- params = module.parameterEvaluator(this.table);
1042+ var params = module.parameterEvaluator(this.table);
1043 Y.lp.testing.assert.assert_equal_structure(
1044 {snap_build_ids: ["1"]}, params);
1045 },
1046@@ -42,7 +42,7 @@
1047 // parameterEvaluator should return empty if no builds remaining
1048 // in pending states.
1049 this.td_status.setAttribute("class", "build_status FULLYBUILT");
1050- params = module.parameterEvaluator(this.table);
1051+ var params = module.parameterEvaluator(this.table);
1052 Y.Assert.isNull(params);
1053 // reset td class to the original value
1054 this.td_status.setAttribute("class", this.td_status_class);
1055@@ -54,7 +54,7 @@
1056 // stopUpdatesCheck should return true if no pending builds exist.
1057 this.td_status.setAttribute("class", "build_status FULLYBUILT");
1058 Y.Assert.isTrue(module.stopUpdatesCheck(this.table));
1059- for (i = 0; i < module.pending_states.length; i++) {
1060+ for (var i = 0; i < module.pending_states.length; i++) {
1061 this.td_status.setAttribute(
1062 "class", "build_status " + module.pending_states[i]);
1063 Y.Assert.isFalse(module.stopUpdatesCheck(this.table));
1064@@ -65,14 +65,16 @@
1065
1066 test_update_build_status_dom: function() {
1067 var original_a_href = this.td_status_a.get("href");
1068- data = {"1": {
1069+ var data = {
1070+ "1": {
1071 "status": "BUILDING",
1072 "build_log_url": null,
1073 "when_complete_estimate": true,
1074 "buildstate": "Currently building",
1075 "build_log_size": null,
1076 "when_complete": "in 1 minute"
1077- }};
1078+ }
1079+ };
1080 module.domUpdate(this.table, data);
1081 Y.Assert.areEqual(
1082 "build_status BUILDING", this.td_status.getAttribute("class"));
1083@@ -87,14 +89,16 @@
1084 },
1085
1086 test_update_build_date_dom: function() {
1087- data = {"1": {
1088+ var data = {
1089+ "1": {
1090 "status": "NEEDSBUILD",
1091 "build_log_url": "/+build/1/+files/build1.txt.gz",
1092 "when_complete_estimate": true,
1093 "buildstate": "Needs building",
1094 "build_log_size": 12345,
1095 "when_complete": "in 30 seconds"
1096- }};
1097+ }
1098+ };
1099 module.domUpdate(this.table, data);
1100 Y.Assert.areEqual(
1101 "in 30 seconds (estimated) buildlog (12345 bytes)",
1102
1103=== modified file 'lib/lp/soyuz/javascript/lp_dynamic_dom_updater.js'
1104--- lib/lp/soyuz/javascript/lp_dynamic_dom_updater.js 2012-07-20 16:04:49 +0000
1105+++ lib/lp/soyuz/javascript/lp_dynamic_dom_updater.js 2017-07-21 17:49:13 +0000
1106@@ -99,7 +99,7 @@
1107 * @extends DomUpdater
1108 * @constructor
1109 */
1110- DynamicDomUpdater = function(config) {
1111+ var DynamicDomUpdater = function(config) {
1112 DynamicDomUpdater.superclass.constructor.apply(this, arguments);
1113 };
1114 DynamicDomUpdater.NAME = 'dynamicdomupdater';
1115
1116=== modified file 'lib/lp/soyuz/javascript/update_archive_build_statuses.js'
1117--- lib/lp/soyuz/javascript/update_archive_build_statuses.js 2011-10-27 11:36:13 +0000
1118+++ lib/lp/soyuz/javascript/update_archive_build_statuses.js 2017-07-21 17:49:13 +0000
1119@@ -173,6 +173,7 @@
1120 // If the length of the builds has changed, then assume
1121 // the ui has changed, otherwise we don't update them.
1122 var current_build_links = td_elem.getElementsByTagName('a');
1123+ var num_current_links;
1124 if (current_build_links === null) {
1125 num_current_links = 0;
1126 } else {
1127
1128=== modified file 'lib/lp/translations/javascript/importqueue.js'
1129--- lib/lp/translations/javascript/importqueue.js 2012-09-05 23:06:42 +0000
1130+++ lib/lp/translations/javascript/importqueue.js 2017-07-21 17:49:13 +0000
1131@@ -49,7 +49,7 @@
1132 '<div class="new show-output">' +
1133 compose_button(shown) +
1134 '</div>';
1135- new_button = button_field.create(text);
1136+ var new_button = button_field.create(text);
1137 button_field.replaceChild(new_button, button);
1138 new_button.on('click', (shown ? hide_output : show_output));
1139 return button_field.get('parentNode');
1140@@ -132,7 +132,7 @@
1141 var value_box = content_box.one('.value');
1142 var new_status = status_choice.get('value');
1143 value_box.setContent(new_status);
1144- config = {
1145+ var config = {
1146 on: {
1147 success: function(entry) {
1148 Y.Array.each(conf.items, function(item) {
1149@@ -149,7 +149,7 @@
1150 }
1151 };
1152 Y.log(config);
1153- lp_client = new Y.lp.client.Launchpad();
1154+ var lp_client = new Y.lp.client.Launchpad();
1155 var entry_uri = '+imports/' + entry_id;
1156 lp_client.named_post(entry_uri, 'setStatus', config);
1157 });
1158
1159=== modified file 'lib/lp/translations/javascript/pofile.js'
1160--- lib/lp/translations/javascript/pofile.js 2014-01-30 15:04:06 +0000
1161+++ lib/lp/translations/javascript/pofile.js 2017-07-21 17:49:13 +0000
1162@@ -34,7 +34,7 @@
1163 * for dismission.
1164 */
1165 var setupSuggestionDismissal = function(e) {
1166- all_dismiss_boxes = Y.all('.dismiss_action');
1167+ var all_dismiss_boxes = Y.all('.dismiss_action');
1168 if (all_dismiss_boxes !== null) {
1169 all_dismiss_boxes.each(function(checkbox) {
1170 var classbase = checkbox.get('id');
1171@@ -136,7 +136,8 @@
1172 };
1173
1174 var setWorkingMode = function (mode) {
1175- if(mode === WORKING_MODE_TRANSLATOR) {
1176+ var text;
1177+ if (mode === WORKING_MODE_TRANSLATOR) {
1178 text = 'Translator&nbsp;mode';
1179 } else {
1180 text = 'Reviewer&nbsp;mode';
1181
1182=== modified file 'lib/lp/translations/javascript/sourcepackage_sharing_details.js'
1183--- lib/lp/translations/javascript/sourcepackage_sharing_details.js 2017-07-21 17:49:13 +0000
1184+++ lib/lp/translations/javascript/sourcepackage_sharing_details.js 2017-07-21 17:49:13 +0000
1185@@ -179,10 +179,11 @@
1186 var key;
1187 for (key in form_data){
1188 if (form_data.hasOwnProperty(key)){
1189- encoded_key = encodeURIComponent(key);
1190- values = form_data[key];
1191+ var encoded_key = encodeURIComponent(key);
1192+ var values = form_data[key];
1193+ var i;
1194 for (i=0; i < values.length; i++){
1195- form_entry = (
1196+ var form_entry = (
1197 encoded_key + '=' + encodeURIComponent(values[i]));
1198 form_data_entries.push(form_entry);
1199 }
1200@@ -278,6 +279,7 @@
1201 var i;
1202 // Each callback is bound to the next, so we use reverse order.
1203 for(i = arguments.length-1; i >= 0; i--){
1204+ var callback;
1205 if (i === arguments.length - 1) {
1206 callback = arguments[i];
1207 }
1208@@ -410,7 +412,7 @@
1209 this.get('tsconfig').get('autoimport').set('complete', complete);
1210 },
1211 set_translations_usage: function(usage) {
1212- complete = (
1213+ var complete = (
1214 usage === namespace.usage.launchpad ||
1215 usage === namespace.usage.external);
1216 var usage_check = this.get('tsconfig').get('translations_usage');
1217@@ -577,14 +579,14 @@
1218 var import_overlay = create_form_overlay(
1219 '<h2>Import settings<h2>', function(form_data) {
1220 Y.log(form_data['field.translations_autoimport_mode']);
1221- mode = enum_title(
1222+ var mode = enum_title(
1223 form_data, 'field.translations_autoimport_mode',
1224 namespace.autoimport_modes);
1225 var product_series = sharing_controller.get('productseries');
1226 product_series.set('translations_autoimport_mode', mode);
1227 var autoimport_check = sharing_controller.get(
1228 'tsconfig').get('autoimport');
1229- handler = new IOHandler(sharing_controller, autoimport_check);
1230+ var handler = new IOHandler(sharing_controller, autoimport_check);
1231 function update_controller() {
1232 sharing_controller.set_autoimport_mode(mode);
1233 handler.show_success();
1234
1235=== modified file 'lib/lp/translations/javascript/tests/test_importqueue.js'
1236--- lib/lp/translations/javascript/tests/test_importqueue.js 2012-10-26 10:00:20 +0000
1237+++ lib/lp/translations/javascript/tests/test_importqueue.js 2017-07-21 17:49:13 +0000
1238@@ -40,7 +40,7 @@
1239 name: 'importqueue macros',
1240
1241 setUp: function() {
1242- fixture = Y.one("#fixture");
1243+ var fixture = Y.one("#fixture");
1244 var template = Y.one('#import-queue-listing').getContent();
1245 var test_node = Y.Node.create(template);
1246 fixture.append(test_node);
1247@@ -57,7 +57,7 @@
1248 Y.one('#import-queue-submit').hasClass('hidden'));
1249 Y.Assert.isTrue(
1250 Y.one('.status-select').hasClass('hidden'));
1251- status_choice = Y.one('.status-choice');
1252+ var status_choice = Y.one('.status-choice');
1253 Y.Assert.isFalse(status_choice.hasClass('hidden'));
1254 }
1255 }));
1256
1257=== modified file 'lib/lp/translations/javascript/tests/test_poexport.js'
1258--- lib/lp/translations/javascript/tests/test_poexport.js 2012-10-26 10:00:20 +0000
1259+++ lib/lp/translations/javascript/tests/test_poexport.js 2017-07-21 17:49:13 +0000
1260@@ -11,7 +11,7 @@
1261 name: 'PO export',
1262
1263 setUp: function() {
1264- fixture = Y.one("#fixture");
1265+ var fixture = Y.one("#fixture");
1266 var template = Y.one('#pofile-export').getContent();
1267 var test_node = Y.Node.create(template);
1268 fixture.append(test_node);
1269@@ -25,13 +25,13 @@
1270 // The change handler was not added if the checbox does not exist.
1271 var pochanged = Y.one('#div_pochanged');
1272 pochanged.get('parentNode').removeChild(pochanged);
1273- handler_added = namespace.initialize_pofile_export_page();
1274+ var handler_added = namespace.initialize_pofile_export_page();
1275 Y.Assert.isFalse(handler_added);
1276 },
1277
1278 test_initialize_pofile_export_page_with_pochanged_default_po: function() {
1279 // The checkbox is enabled when PO is selected.
1280- handler_added = namespace.initialize_pofile_export_page();
1281+ var handler_added = namespace.initialize_pofile_export_page();
1282 Y.Assert.isTrue(handler_added);
1283 Y.Assert.isTrue(
1284 Y.one('#po-format-only').hasClass('hidden'));
1285@@ -43,7 +43,7 @@
1286
1287 test_initialize_pofile_export_page_with_pochanged_mo_selected: function() {
1288 // The checkbox is disabled when MO is selected.
1289- handler_added = namespace.initialize_pofile_export_page();
1290+ var handler_added = namespace.initialize_pofile_export_page();
1291 Y.Assert.isTrue(handler_added);
1292 var formatlist = Y.one('#div_format select');
1293 formatlist.set('selectedIndex', 1);
1294
1295=== modified file 'lib/lp/translations/javascript/tests/test_sourcepackage_sharing_details.js'
1296--- lib/lp/translations/javascript/tests/test_sourcepackage_sharing_details.js 2012-10-26 10:00:20 +0000
1297+++ lib/lp/translations/javascript/tests/test_sourcepackage_sharing_details.js 2017-07-21 17:49:13 +0000
1298@@ -145,8 +145,8 @@
1299 '<p><a href="http://fake">fake</a></p>');
1300 }
1301 };
1302- unlink_overlay = import_overlay;
1303- usage_overlay = import_overlay;
1304+ var unlink_overlay = import_overlay;
1305+ var usage_overlay = import_overlay;
1306 ctrl.configure(
1307 model, {}, unlink_overlay, import_overlay, usage_overlay);
1308 var tsconfig = ctrl.get('tsconfig');
1309@@ -202,8 +202,8 @@
1310 '<p><a href="http://fake">fake</a></p>');
1311 }
1312 };
1313- unlink_overlay = import_overlay;
1314- usage_overlay = import_overlay;
1315+ var unlink_overlay = import_overlay;
1316+ var usage_overlay = import_overlay;
1317 ctrl.configure(
1318 null_model, {}, unlink_overlay, import_overlay,
1319 usage_overlay);
1320@@ -394,9 +394,9 @@
1321 var check = controller.get('tsconfig').get('branch');
1322 check.set('pending', true);
1323 controller.update_check(check);
1324- spinner = Y.one(controller.spinner_selector(check));
1325+ var spinner = Y.one(controller.spinner_selector(check));
1326 Y.Assert.isFalse(spinner.hasClass('hidden'));
1327- io_handler = new IOHandler(controller, check);
1328+ var io_handler = new IOHandler(controller, check);
1329 io_handler.show_success();
1330 Y.Assert.isFalse(check.get('pending'));
1331 Y.Assert.isTrue(spinner.hasClass('hidden'));