Javascript error "redeclaration of const imgICache" in contentAreaUtils.js

VERIFIED FIXED in Thunderbird1.1

Status

--
trivial
VERIFIED FIXED
13 years ago
13 years ago

People

(Reporter: whimboo, Assigned: whimboo)

Tracking

(Blocks: 1 bug)

Trunk
Thunderbird1.1

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

13 years ago
Following error is reported on startup of Thunderbird:

Error: redeclaration of const imgICache
Source File: chrome://communicator/content/contentAreaUtils.js
Line: 232

Patch will follow.
(Assignee)

Comment 1

13 years ago
Created attachment 187340 [details] [diff] [review]
patch v1

Moving several constant declarations into the functions where they are used. No
need to declare them outside while they are used only once.
Attachment #187340 - Flags: review?(mnyromyr)

Comment 2

13 years ago
Comment on attachment 187340 [details] [diff] [review]
patch v1

> function saveImageURL(aURL, aFileName, aFilePickerTitleKey, aShouldBypassCache,
>                       aReferrer)
> {
>+  const imgICache = Components.interfaces.imgICache;

This constant is used exactly once and is thus pretty useless. Use its value
directly when calling getService.

>-const SAVEMODE_FILEONLY      = 0x00;

This is used in more than one function!

> function appendFiltersForContentType(aFilePicker, aContentType, aFileExtension, aSaveMode)
> {
>+  const SAVEMODE_FILEONLY      = 0x00; // We have no DOM, and can only save the URL as is.

... not only here!
Attachment #187340 - Flags: review?(mnyromyr) → review-
(Assignee)

Comment 3

13 years ago
Created attachment 187343 [details] [diff] [review]
patch v2 - only tb fixes

The window messageWindow.xul includes the contentAreaUtils.js twice. Further
messenger.xul includes the overlay contentAreaContextOverlay.xul which self
includes the contentAreaUtils.js.
Attachment #187340 - Attachment is obsolete: true
Attachment #187343 - Flags: review?(mscott)
(Assignee)

Updated

13 years ago
Status: NEW → ASSIGNED

Comment 4

13 years ago
Comment on attachment 187343 [details] [diff] [review]
patch v2 - only tb fixes

thanks for the patch
Attachment #187343 - Flags: superreview+
Attachment #187343 - Flags: review?(mscott)
Attachment #187343 - Flags: review+

Updated

13 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird1.1
(Assignee)

Updated

13 years ago
Status: RESOLVED → VERIFIED
(Assignee)

Updated

13 years ago
Blocks: 303545
You need to log in before you can comment on or make changes to this bug.