Closed Bug 275986 Opened 20 years ago Closed 19 years ago

Programming error in msgHdrViewOverlay.js: mSaveHdr defined as member, but used as global

Categories

(SeaMonkey :: MailNews: Message Display, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 289952

People

(Reporter: mnyromyr, Unassigned)

Details

Attachment https://bugzilla.mozilla.org/attachment.cgi?id=163339 of bug 241203
introduces a new member mSaveHdr to the global variable messageHeaderSink
(see
http://lxr.mozilla.org/mozilla/source/mail/base/content/msgHdrViewOverlay.js#273
and the definition in line 459).

But throughout this file, mSaveHdr is *wrongly* used as a global, i.e. as "if
(mSaveHdr) ..." instead of "if (this.mSaveHdr)..." (all these uses are in member
functions of messageHeaderSink).

This does only work, because onStartHeaders does *create* this global in line 276!

Even though this programming error is not visible (e.g. as error messages) in
current builds, it may lead to future problems (and it is already striking
extensions that overlay certain functions and use the *member* mSaveHdr).

This programming error is both in current Mozilla nightlies and in Thunderbird
1.0 and newer.
Odd, you would have expected a JavaScript strict warning at some point.

BTW, cvs log blames attachment 163744 [details] [diff] [review] of bug 266536 (don't paste URLs).
> Odd, you would have expected a JavaScript strict warning at some point.

I do have the impression that JavaScript observer/handler/etc., when called
(back) from the C++ core, don't generate strict warnings, but I'm still
investigating that.
Assignee: sspitzer → mail
Bah, I hate duping my bugs especially when they're *not* dupes - but bug 289952
already has a patch for both the suite and TB...

*** This bug has been marked as a duplicate of 289952 ***
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.