Closed Bug 822446 Opened 7 years ago Closed 7 years ago

JS Component Loader: WARNING nsPlacesExpiration.js:622 test for equality (==) mistyped as assignment (=)?

Categories

(Toolkit :: Places, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: dholbert, Assigned: dholbert)

Details

Attachments

(1 file)

This now appears in the noise that my debug build prints while running:
{
JS Component Loader: WARNING obj/dist/bin/components/nsPlacesExpiration.js:622
                     test for equality (==) mistyped as assignment (=)?
}

Looks like it's for a while loop that has an assignment in the loop-condition. We just need to add another layer of parens to make the assignment-as-loop-condition explicit. (as in bug 822430 & Bug 821507)
Attached patch fixSplinter Review
This fixes the instance in comment 0 & one other instance I found in toolkit/places with an MXR search.
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #693091 - Flags: review?(mak77)
Comment on attachment 693091 [details] [diff] [review]
fix

Review of attachment 693091 [details] [diff] [review]:
-----------------------------------------------------------------

this is another reason I prefer for (let row = aResultSet.getNextRow(); row; row = aResultSet.getNextRow()) even if it's more verbose :)

Btw, it's fine regardless, thanks for the patch!
Attachment #693091 - Flags: review?(mak77) → review+
Thanks!

https://hg.mozilla.org/integration/mozilla-inbound/rev/c618b0e333a0
OS: Linux → All
Hardware: x86_64 → All
Version: unspecified → Trunk
https://hg.mozilla.org/mozilla-central/rev/c618b0e333a0
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
You need to log in before you can comment on or make changes to this bug.