Closed Bug 262893 Opened 16 years ago Closed 10 years ago

In <searchBar.js>, "Warning: redeclaration of var i" and others

Categories

(SeaMonkey :: MailNews: Message Display, defect)

defect
Not set
trivial

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.8alpha6

People

(Reporter: sgautherie, Assigned: sgautherie)

References

Details

(Keywords: fixed1.8.1, Whiteboard: [fixed1.8.1: Bv1b-TB])

Attachments

(3 files, 1 obsolete file)

[Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8a4) Gecko/20040927] (release) (W98SE)

{{
Warning: redeclaration of var i
Source File: chrome://messenger/content/searchBar.js
Line: 386, Column: 11
Source Code:
  for (var i = 0; i < termsArray.Count(); i++)
}}
Assignee: sspitzer → gautheri
Status: NEW → ASSIGNED
Attachment #161083 - Flags: superreview?(bienvenu)
Attachment #161083 - Flags: review?(bienvenu)
Attachment #161083 - Flags: superreview?(bienvenu)
Attachment #161083 - Flags: superreview+
Attachment #161083 - Flags: review?(bienvenu)
Attachment #161083 - Flags: review+
fixed
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Attachment #161083 - Attachment description: (Av1) <searchBar.js> (SeaMonkey part) → (Av1) <searchBar.js> (SeaMonkey part) [Checked in: Comment 2]
Attachment #161083 - Attachment is obsolete: true
Attached patch (Bv1-TB) <searchBar.js> (obsolete) — Splinter Review
Attachment #161202 - Flags: superreview?(bienvenu)
Attachment #161202 - Flags: review?(bienvenu)
Target Milestone: --- → mozilla1.8alpha5
Attachment #161202 - Attachment is obsolete: true
Attachment #161202 - Flags: superreview?(bienvenu)
Attachment #161202 - Flags: review?(bienvenu)
Attachment #161206 - Flags: superreview?(bienvenu)
Attachment #161206 - Flags: review?(bienvenu)
Product: Browser → Seamonkey
Re-opening, for the Toolkit part, which missed "Mozilla v1.8a5".
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → ASSIGNED
Target Milestone: mozilla1.8alpha5 → mozilla1.8alpha6
Comment on attachment 161206 [details] [diff] [review]
(Bv1b-TB) <searchBar.js>
[Checked in: Comment 15 & 16]

No (super-)review from <bienvenu@nventure.com> since "2004-10-05" :-(
Attachment #161206 - Flags: superreview?(mscott)
Attachment #161206 - Flags: superreview?(bienvenu)
Attachment #161206 - Flags: review?(bryner)
Attachment #161206 - Flags: review?(bienvenu)
Attachment #161206 - Flags: review?(bryner) → review+
Attachment #161083 - Attachment description: (Av1) <searchBar.js> (SeaMonkey part) [Checked in: Comment 2] → (Av1-MAS) <searchBar.js> [Checked in: Comment 2]
Attachment #161202 - Attachment description: (Bv1) <searchBar.js> (Toolkit part) → (Bv1-TB) <searchBar.js>
Attachment #161206 - Attachment description: (Bv1b) <searchBar.js> (Toolkit part) → (Bv1b-TB) <searchBar.js>
Comment on attachment 161206 [details] [diff] [review]
(Bv1b-TB) <searchBar.js>
[Checked in: Comment 15 & 16]

[Mozilla Thunderbird, version 1.0.1 (20050309)] (nightly) (W98SE)

Scott:
Oddly, I don't get this (strict enabled) warning, w/o the patch ... anyway.
I don't know how to get into the |for (i in srchFolderUriArray)|...

Please, provide me with some steps if further testing is needed.

Else, could you sr & check in this patch ?
(In reply to comment #7)
> (From update of attachment 161206 [details] [diff] [review] [edit])
> [Mozilla Thunderbird, version 1.0.1 (20050309)] (nightly) (W98SE)
> 
> Scott:
> Oddly, I don't get this (strict enabled) warning, w/o the patch ... anyway.

Brendan, Am I missing something here, or ... ?
(In reply to comment #8)
> (In reply to comment #7)
> > (From update of attachment 161206 [details] [diff] [review] [edit] [edit])
> > 
> > Oddly, I don't get this (strict enabled) warning, w/o the patch ... anyway.
> 
> Brendan, Am I missing something here, or ... ?

Afterward, I think that reporting this warning was removed from the "JS Engine" at some point.
[Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8.1b1) Gecko/20060804 SeaMonkey/1.1a] (nightly) (W98SE)

1. Press "Enter" in the (empty) criteria field.
R.
[
Warning: reference to undefined property gSearchInput.showingSearchCriteria
Source File: chrome://messenger/content/searchBar.js
Line: 188
]

***

1. Type some string to search for.
2. Press "Enter".
R. (In addition to the above warning, get some errors)
[
Error: gSearchBundle has no properties
Source File: chrome://messenger/content/searchBar.js
Line: 105

Error: gSearchBundle has no properties
Source File: chrome://messenger/content/searchBar.js
Line: 58
]
NB: Actually, the 3 w. & e. appear twice...
Summary: In <searchBar.js>, "Warning: redeclaration of var i" → In <searchBar.js>, "Warning: redeclaration of var i" and others
Whiteboard: helpwanted
(In reply to comment #10)
> 1. Type some string to search for.
> 2. Press "Enter".

Step 2 is unneeded.

> NB: Actually, the 3 w. & e. appear twice...

This was because of step 2: I didn't now the search happened at "each" keypress.

Summary:
A) Search without a string: 1 warning.
B) Search with a string: 1 warning + 2 errors.
Attachment #161206 - Flags: superreview?(mscott) → superreview+
Keywords: helpwanted
Whiteboard: helpwanted → [checkin needed: Bv1-TB] [New errors: in comment 10 & 11]
Comment on attachment 161206 [details] [diff] [review]
(Bv1b-TB) <searchBar.js>
[Checked in: Comment 15 & 16]

'approval1.8.1=?': (Thunderbird only)
Trivial JS warning fix, no risk.
(To stay in sync'.)
Attachment #161206 - Flags: approval1.8.1?
Comment on attachment 161206 [details] [diff] [review]
(Bv1b-TB) <searchBar.js>
[Checked in: Comment 15 & 16]

a=drivers, assuming bienvenu and scott are OK with this (since it's been on trunk for a while)
Attachment #161206 - Flags: approval1.8.1? → approval1.8.1+
Whiteboard: [checkin needed: Bv1-TB] [New errors: in comment 10 & 11] → [checkin needed (Trunk & 1.8 branch): Bv1-TB] [New errors: in comment 10 & 11]
Note: Bv1b-TB was checked in on trunk already, so it only needs branch checkin.
Whiteboard: [checkin needed (Trunk & 1.8 branch): Bv1-TB] [New errors: in comment 10 & 11] → [checkin needed (1.8 branch): Bv1-TB] [New errors: in comment 10 & 11]
Comment on attachment 161206 [details] [diff] [review]
(Bv1b-TB) <searchBar.js>
[Checked in: Comment 15 & 16]

Checkin: {
2006-08-14 12:26	bugzilla%standard8.demon.co.uk 	mozilla/mail/base/content/searchBar.js 	1.37
}
Attachment #161206 - Attachment description: (Bv1b-TB) <searchBar.js> → (Bv1b-TB) <searchBar.js> [Checked in: Comment 15]
Comment on attachment 161206 [details] [diff] [review]
(Bv1b-TB) <searchBar.js>
[Checked in: Comment 15 & 16]


Checkin: {
2006-08-24 10:28	bugzilla%standard8.demon.co.uk 	mozilla/mail/base/content/searchBar.js 	1.25.2.11 	MOZILLA_1_8_BRANCH
}
Attachment #161206 - Attachment description: (Bv1b-TB) <searchBar.js> [Checked in: Comment 15] → (Bv1b-TB) <searchBar.js> [Checked in: Comment 15 & 16]
Attachment #161206 - Attachment is obsolete: true
Keywords: fixed1.8.1
Whiteboard: [checkin needed (1.8 branch): Bv1-TB] [New errors: in comment 10 & 11] → [New errors: in comment 10 & 11] [fixed1.8.1: Bv1b-TB]
(In reply to comment #10)
> [
> Warning: reference to undefined property gSearchInput.showingSearchCriteria
> Source File: chrome://messenger/content/searchBar.js
> Line: 188
> ]

<http://lxr.mozilla.org/mozilla/search?string=showingSearchCriteria>
lists
[
/mail/base/content/search.xml, line 88 -- <property name="showingSearchCriteria" onget="return this.getAttribute('searchCriteria') == 'true';"
/mail/base/content/search.xml, line 125 -- this.showingSearchCriteria = true;
]
with no </mailnews> XML equivalent lines.

Our JS code "comes" from
[
2004-10-01 12:06	bienvenu%nventure.com 	mozilla/mailnews/base/resources/content/searchBar.js 	1.36

fix 261682 sr=mscott when in non-default view, automatic update of folder causes a re-search which recreates the view
]

David, could you have a look at this and possibly take care of it ?
[Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.2pre) Gecko/20070117 SeaMonkey/1.1] (nightly) (W2Ksp4)
[Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a2pre) Gecko/20070116 SeaMonkey/1.5a] (nightly) (W2Ksp4)

(In reply to comment #10)

Now (and with W2K), I get the following warning (only once at a time and) only when using the Clear button.
{
Warning: reference to undefined property gSearchInput.showingSearchCriteria
Source File: chrome://messenger/content/searchBar.js
Line: 469
}
(The line number has changed. And is the same in both builds.)

> ***
> 
> [
> Error: gSearchBundle has no properties
> Source File: chrome://messenger/content/searchBar.js
> Line: 105
> 
> Error: gSearchBundle has no properties
> Source File: chrome://messenger/content/searchBar.js
> Line: 58
> ]

I don't get theses anymore.
Depends on: MailClearButton
Depends on: 286367
No longer depends on: MailClearButton
Whiteboard: [New errors: in comment 10 & 11] [fixed1.8.1: Bv1b-TB] → [New errors: in comment 17] [fixed1.8.1: Bv1b-TB]
Component: MailNews: Search → MailNews: Message Display
QA Contact: search
QA Contact: search → message-display
(Serge never got around to the final bit here.)
The code removed in this patch was commented out six years ago in Bug 259484.
Attachment #459335 - Flags: superreview?(neil)
Attachment #459335 - Flags: review?(neil)
Comment on attachment 459335 [details] [diff] [review]
(Cv1) Remove dead code (gSearchInput.showingSearchCriteria)

I notice that abContactsPanel still has a reference, does Thunderbird have a bug for that?

>         if (gCurrentVirtualFolderUri &&
>-         (!gSearchInput || gSearchInput.value == "" || gSearchInput.showingSearchCriteria))
>+          (!gSearchInput || gSearchInput.value == ""))
Nit: might as well line this up correctly i.e.
if (gCurrentVirtualFolderUri &&
    (!gSearchInput || gSearchInput.value == ""))
Attachment #459335 - Flags: superreview?(neil)
Attachment #459335 - Flags: superreview+
Attachment #459335 - Flags: review?(neil)
Attachment #459335 - Flags: review+
> >         if (gCurrentVirtualFolderUri &&
> >-         (!gSearchInput || gSearchInput.value == "" || gSearchInput.showingSearchCriteria))
> >+          (!gSearchInput || gSearchInput.value == ""))
> Nit: might as well line this up correctly i.e.
> if (gCurrentVirtualFolderUri &&
>     (!gSearchInput || gSearchInput.value == ""))
Fixed locally.

Pushed to comm-central.
http://hg.mozilla.org/comm-central/rev/7223e8b0311f

Closing this !@#$%^&* bug so it gets off my bug queries finally.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago10 years ago
Resolution: --- → FIXED
Keywords: helpwanted
Whiteboard: [New errors: in comment 17] [fixed1.8.1: Bv1b-TB] → [fixed1.8.1: Bv1b-TB]
Attachment #161083 - Attachment is obsolete: false
Attachment #161206 - Attachment is obsolete: false
You need to log in before you can comment on or make changes to this bug.