Closed
Bug 1140712
Opened 9 years ago
Closed 9 years ago
Clean up "SyntaxError: test for equality (==) mistyped as assignment (=)" in messenger/content/addressbook/abResultsPane.js
Categories
(MailNews Core :: Address Book, defect)
MailNews Core
Address Book
Tracking
(thunderbird38+ fixed, thunderbird39 fixed)
RESOLVED
FIXED
Thunderbird 39.0
People
(Reporter: aceman, Assigned: aceman)
References
Details
Attachments
(1 file, 4 obsolete files)
2.74 KB,
patch
|
aceman
:
review+
rkent
:
approval-comm-aurora+
|
Details | Diff | Splinter Review |
I get 3 warnings like this when opening the main AB window: Warning: SyntaxError: test for equality (==) mistyped as assignment (=)? Source File: chrome://messenger/content/addressbook/abResultsPane.js Line: 91, Column: 61 Source Code: if (element = document.getElementById("CardViewOuterBox")) This code was introduced in bug 170270. While the code is correct and we may not agree with this warning (it is a false positive), warnings like this are known to break tests (at least xpcshell). So better make the JS engine happy.
Attachment #8574283 -
Flags: review?(mkmelin+mozilla)
It looks to me it can be simplified even more. It worked in my tests. Suyash, can you check if this still does what you intended?
Attachment #8574283 -
Attachment is obsolete: true
Attachment #8574283 -
Flags: review?(mkmelin+mozilla)
Attachment #8574295 -
Flags: review?(mkmelin+mozilla)
Attachment #8574295 -
Flags: feedback?(syshagarwal)
Comment 3•9 years ago
|
||
Comment on attachment 8574295 [details] [diff] [review] patch v2 Review of attachment 8574295 [details] [diff] [review]: ----------------------------------------------------------------- Ya, this does what I intend to do :) Thanks. ::: mailnews/addrbook/content/abResultsPane.js @@ +82,5 @@ > UpdateSortIndicators(actualSortColumn, sortDirection); > > // If the selected address book is LDAP and the search box is empty, > // inform the user of the empty results pane. > + let elementIDs = ["abResultsTree", "CardViewOuterBox", "blankResultsPaneMessageBox"]; Is it 80chars width? Looks wrong here on splinter.
Attachment #8574295 -
Flags: feedback?(syshagarwal) → feedback+
OK, fixed long lines.
Attachment #8574295 -
Attachment is obsolete: true
Attachment #8574295 -
Flags: review?(mkmelin+mozilla)
Attachment #8574299 -
Flags: review?(mkmelin+mozilla)
Comment 5•9 years ago
|
||
Comment on attachment 8574299 [details] [diff] [review] patch v2.1 Review of attachment 8574299 [details] [diff] [review]: ----------------------------------------------------------------- Sorry but I think the readability if this is just not good. If you want to get rid of the strict warnings, just assign three variables before the if-else and do the tests later.
Attachment #8574299 -
Flags: review?(mkmelin+mozilla) → review-
Yeah, it is a bit over-engineered for only 3 elements :) So do you mean it like this?
Attachment #8574299 -
Attachment is obsolete: true
Attachment #8574436 -
Flags: review?(mkmelin+mozilla)
Comment 7•9 years ago
|
||
Comment on attachment 8574436 [details] [diff] [review] patch v3 Review of attachment 8574436 [details] [diff] [review]: ----------------------------------------------------------------- Yes! r=mkmelin
Attachment #8574436 -
Flags: review?(mkmelin+mozilla) → review+
Comment 8•9 years ago
|
||
Though it could be clearer to call the variables e.g. abResultsTree and CardViewOuterBox instead of box1, box2
Ok.
Attachment #8574436 -
Attachment is obsolete: true
Attachment #8574450 -
Flags: review+
Assignee | ||
Comment 10•9 years ago
|
||
I don't think this needs to go into TB38 if it does not cause any problems there.
Keywords: checkin-needed
Comment 11•9 years ago
|
||
https://hg.mozilla.org/comm-central/rev/f06d8b2b5f9d
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-thunderbird39:
--- → fixed
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 39.0
Comment 12•9 years ago
|
||
(In reply to :aceman from comment #10) > I don't think this needs to go into TB38 if it does not cause any problems > there. I would like to eliminate extraneous error messages in TB 38.
tracking-thunderbird38:
--- → +
Comment 13•9 years ago
|
||
Isn't the correct thing to do is to file a bug to remove bogus strict warnings in the jsengine?
Comment 14•9 years ago
|
||
(In reply to Philip Chee from comment #13) > Isn't the correct thing to do is to file a bug to remove bogus strict > warnings in the jsengine? I generally assume, perhaps falsely, that the js people will not make a decision like that based on the needs of Thunderbird or Seamonkey. Even if they did, the chances of getting that into gecko38 are extremely low.
Assignee | ||
Comment 15•9 years ago
|
||
I am sure Philip questioned the usefulness of the message for all products and the JS core. It is just a question to the coder (even with question mark) but is marked as "TypeError". So the message is maybe too strict, wrongly classified. And if it flags code incorrectly, what can we do? Only change the code to please the checker. Maybe it should have been just at "information" level instead of "warning" level. But I don't think we need to care about it too much for now.
Comment 16•9 years ago
|
||
Comment on attachment 8574450 [details] [diff] [review] patch v3.1 [Triage Comment] http://hg.mozilla.org/releases/comm-aurora/rev/6832d62c544f
Attachment #8574450 -
Flags: approval-comm-aurora+
Updated•9 years ago
|
status-thunderbird38:
--- → fixed
You need to log in
before you can comment on or make changes to this bug.
Description
•