Closed Bug 821507 Opened 12 years ago Closed 12 years ago

WARNING resource://gre/modules/XPIProvider.jsm:890 test for equality (==) mistyped as assignment

Categories

(Toolkit :: Add-ons Manager, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: dholbert, Assigned: dholbert)

Details

Attachments

(1 file)

Noticed this (as the first few lines of output) when starting up a debug build today:
{
JS Component Loader: WARNING resource://gre/modules/XPIProvider.jsm:890
                     test for equality (==) mistyped as assignment (=)?
JS Component Loader: WARNING resource://gre/modules/XPIProvider.jsm:1315
                     test for equality (==) mistyped as assignment (=)?
JS Component Loader: WARNING resource://gre/modules/XPIProvider.jsm:2174
                     test for equality (==) mistyped as assignment (=)?
JS Component Loader: WARNING resource://gre/modules/PluginProvider.jsm:239
                     test for equality (==) mistyped as assignment (=)?
}

Looks like these are all for loops that intentionally do an assignment in the loop-condition, e.g.:
> 890     while (entry = entries.nextFile)
> 891       size += getFileSize(entry);
https://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/XPIProvider.jsm#890

In C++, you can silence warnings like this by adding an extra layer of parens around the assignment.  I'm guessing that'll work in JS, too...
Attached patch fix v1Splinter Review
Attachment #692047 - Flags: review?(dtownsend+bugmail)
(I verified locally that this fixes the warnings.)
Version: unspecified → Trunk
Comment on attachment 692047 [details] [diff] [review]
fix v1

Seems a little silly but sure
Attachment #692047 - Flags: review?(dtownsend+bugmail) → review+
https://hg.mozilla.org/mozilla-central/rev/4519670ac62d
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: