Closed Bug 298816 Opened 20 years ago Closed 20 years ago

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

Categories

(Thunderbird :: General, defect)

defect
Not set
trivial

Tracking

(Not tracked)

VERIFIED FIXED
Thunderbird1.1

People

(Reporter: whimboo, Assigned: whimboo)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

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.
Attached patch patch v1 (obsolete) — Splinter Review
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 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-
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)
Status: NEW → ASSIGNED
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+
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird1.1
Status: RESOLVED → VERIFIED
Blocks: 303545
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: