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

RESOLVED DUPLICATE of bug 289952

Status

RESOLVED DUPLICATE of bug 289952
14 years ago
14 years ago

People

(Reporter: mnyromyr, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

14 years ago
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).
(Reporter)

Comment 2

14 years ago
> 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.

Updated

14 years ago
Assignee: sspitzer → mail
(Reporter)

Comment 3

14 years ago
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
Last Resolved: 14 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.