Merge lp:~cjwatson/launchpad/eslint-eqeqeq into lp:launchpad

Proposed by Colin Watson
Status: Merged
Merged at revision: 18525
Proposed branch: lp:~cjwatson/launchpad/eslint-eqeqeq
Merge into: lp:launchpad
Prerequisite: lp:~cjwatson/launchpad/eslint-regexes
Diff against target: 100 lines (+13/-13)
4 files modified
lib/lp/app/javascript/languages.js (+4/-4)
lib/lp/code/javascript/branchmergeproposal.status.js (+6/-6)
lib/lp/code/javascript/sourcepackagerecipe.new.js (+1/-1)
lib/lp/translations/javascript/importqueueentry.js (+2/-2)
To merge this branch: bzr merge lp:~cjwatson/launchpad/eslint-eqeqeq
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+335615@code.launchpad.net

Commit message

Use === and !== in JS rather than == and !=.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/app/javascript/languages.js'
2--- lib/lp/app/javascript/languages.js 2012-07-07 14:00:30 +0000
3+++ lib/lp/app/javascript/languages.js 2018-01-02 05:04:14 +0000
4@@ -20,11 +20,11 @@
5 var code = href.substr(href.lastIndexOf("/")+1);
6 var english_name = element.get('text').toLowerCase();
7 var comment_start = english_name.indexOf(' (');
8- if(comment_start != -1) {
9+ if(comment_start !== -1) {
10 english_name = english_name.substring(0, comment_start);
11 }
12- if(code.indexOf(searchstring) == -1 &&
13- english_name.indexOf(searchstring) == -1) {
14+ if(code.indexOf(searchstring) === -1 &&
15+ english_name.indexOf(searchstring) === -1) {
16 element.ancestor('li').addClass('hidden');
17 }
18 else {
19@@ -33,7 +33,7 @@
20 }
21 });
22 var no_filter_matches = Y.one('#no_filter_matches');
23- if(count_matches == 0) {
24+ if(count_matches === 0) {
25 no_filter_matches.removeClass('hidden');
26 }
27 else {
28
29=== modified file 'lib/lp/code/javascript/branchmergeproposal.status.js'
30--- lib/lp/code/javascript/branchmergeproposal.status.js 2017-09-22 19:41:16 +0000
31+++ lib/lp/code/javascript/branchmergeproposal.status.js 2018-01-02 05:04:14 +0000
32@@ -33,7 +33,7 @@
33 success: function(entry) {
34 var cb = status_choice_edit.get('contentBox');
35 Y.Array.each(conf.status_widget_items, function(item) {
36- if (item.value ==
37+ if (item.value ===
38 status_choice_edit.get('value')) {
39 cb.one('a').addClass(item.css_class);
40 } else {
41@@ -95,11 +95,11 @@
42 old_row = old_rows.item(old_pos);
43 var new_id = new_row.get('id');
44 var old_id = old_row.get('id');
45- if (new_id == old_id) {
46- if (new_id != 'summary-row-b-diff') {
47+ if (new_id === old_id) {
48+ if (new_id !== 'summary-row-b-diff') {
49 // Don't mess with the diff.
50- if (new_row.get('innerHTML') !=
51- old_row.get('innerHTML')) {
52+ if (new_row.get('innerHTML') !==
53+ old_row.get('innerHTML')) {
54 existing_summary.insertBefore(
55 new_row, old_row);
56 old_row.remove();
57@@ -125,7 +125,7 @@
58 while (new_pos < new_size) {
59 new_row = new_rows.item(new_pos);
60 ++new_pos;
61- if (new_row.get('id') != 'summary-row-b-diff') {
62+ if (new_row.get('id') !== 'summary-row-b-diff') {
63 existing_summary.append(new_row);
64 }
65 }
66
67=== modified file 'lib/lp/code/javascript/sourcepackagerecipe.new.js'
68--- lib/lp/code/javascript/sourcepackagerecipe.new.js 2017-09-22 19:41:16 +0000
69+++ lib/lp/code/javascript/sourcepackagerecipe.new.js 2018-01-02 05:04:14 +0000
70@@ -34,7 +34,7 @@
71
72 module.onclick_use_ppa = function(e) {
73 var value = getRadioSelectedValue('input[name="field.use_ppa"]');
74- if (value == 'create-new') {
75+ if (value === 'create-new') {
76 set_enabled(PPA_NAME_ID, true);
77 set_enabled(PPA_SELECTOR_ID, false);
78 }
79
80=== modified file 'lib/lp/translations/javascript/importqueueentry.js'
81--- lib/lp/translations/javascript/importqueueentry.js 2012-07-07 14:00:30 +0000
82+++ lib/lp/translations/javascript/importqueueentry.js 2018-01-02 05:04:14 +0000
83@@ -180,7 +180,7 @@
84 for (var option_index = 0; option_index < num_options; option_index++) {
85 var option = options.item(option_index);
86 var known_name = option.get('textContent');
87- if (known_name == name && template_domains[known_name] == domain) {
88+ if (known_name === name && template_domains[known_name] === domain) {
89 // The current template name/domain are in the dropdown's
90 // options. Select that option.
91 potemplate_dropdown.set('selectedIndex', option_index);
92@@ -237,7 +237,7 @@
93 */
94 function handleFileTypeChange() {
95 var file_type = this.get('value');
96- if (file_type != last_file_type) {
97+ if (file_type !== last_file_type) {
98 updateCurrentFileType(file_type, true);
99 }
100 }