Warning ``function getContentTypeFromHeaders does not always return a value'' [xs] in file ``chrome://navigator/content/pageInfo.js'', line 951, character 0.

RESOLVED FIXED

Status

SeaMonkey
Page Info
--
trivial
RESOLVED FIXED
15 years ago
14 years ago

People

(Reporter: timeless, Assigned: timeless)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(5 obsolete attachments)

(Assignee)

Description

15 years ago
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6b) Gecko/20031208

Warning ``function getContentTypeFromHeaders does not always return a value''
[xs] in file ``chrome://navigator/content/pageInfo.js'', line 951, character 0.
(Assignee)

Comment 1

15 years ago
Created attachment 137436 [details] [diff] [review]
(Av1) |return ""|
[Checked in: Comment 4]
(Assignee)

Updated

15 years ago
Attachment #137436 - Flags: superreview?(bz-vacation)
Attachment #137436 - Flags: review?(neil.parkwaycc.co.uk)
Comment on attachment 137436 [details] [diff] [review]
(Av1) |return ""|
[Checked in: Comment 4]

sr=bzbarsky, sure
Attachment #137436 - Flags: superreview?(bz-vacation) → superreview+

Comment 3

15 years ago
Comment on attachment 137436 [details] [diff] [review]
(Av1) |return ""|
[Checked in: Comment 4]

...although I would have preferred null, because that's nearer to what it used
to "return".
Attachment #137436 - Flags: review?(neil.parkwaycc.co.uk) → review+
Comment on attachment 137436 [details] [diff] [review]
(Av1) |return ""|
[Checked in: Comment 4]


Check in: { 12/20/2003 20:04	timeless%mozdev.org	1.60 }
Attachment #137436 - Attachment description: return ... → (Av1) |return ""| [Checked in: Comment 4]
Attachment #137436 - Attachment is obsolete: true
Created attachment 137793 [details] [diff] [review]
(Bv1) |return null|, and localization

As suggested by comment 3, and a little more.
(In fact, replacing Av1 :-<)
Attachment #137793 - Flags: review?(neil.parkwaycc.co.uk)
OS: Windows XP → All
Hardware: PC → All
Summary: Warning ``function getContentTypeFromHeaders does not always return a value'' [xs] in file ``chrome://navigator/content/pageInfo.js'', line 951, character 0. → Warning ``function getContentTypeFromHeaders does not always return a value'' [xs] in file ``chrome://navigator/content/pageInfo.js'', line 951, character 0.

Updated

15 years ago
Attachment #137793 - Flags: review?(neil.parkwaycc.co.uk) → review+
Attachment #137793 - Flags: superreview?(bz-vacation)
(Assignee)

Comment 6

15 years ago
personally, if you're going to do that i'd change the code to be:

function getContentTypeFromHeaders(cacheEntryDescriptor)
{
  if (!cacheEntryDescriptor)
    return null;

  var headers = cacheEntryDescriptor.getMetaDataElement("response-head");
  var match = /^Content-Type:\s*(.*?)\s*(?:\;|$)/mi.exec(headers);
  return match[1];
}
Created attachment 137924 [details] [diff] [review]
(Bv1b) |return null|, and var removals [== Bv1 :-(]

Bv1, with comment 6 suggestion.
Attachment #137793 - Attachment is obsolete: true
Attachment #137793 - Flags: superreview?(bz-vacation)
Attachment #137924 - Flags: superreview?(bz-vacation)
Attachment #137924 - Flags: review?(neil.parkwaycc.co.uk)
Attachment #137924 - Attachment description: (Bv1b) |return null|, and var removals → (Bv2) |return null|, and var removals
Created attachment 137926 [details] [diff] [review]
(Bv2) |return null|, and var removals

(My mistake: Bv1b was still Bv1 :-()

Bv1, with comment 6 suggestion.
Attachment #137926 - Flags: superreview?(bz-vacation)
Attachment #137926 - Flags: review?(neil.parkwaycc.co.uk)
Attachment #137924 - Attachment description: (Bv2) |return null|, and var removals → (Bv1b) |return null|, and var removals [== Bv1 :-(]
Attachment #137924 - Attachment is obsolete: true
Attachment #137924 - Flags: superreview?(bz-vacation)
Attachment #137924 - Flags: review?(neil.parkwaycc.co.uk)
Comment on attachment 137926 [details] [diff] [review]
(Bv2) |return null|, and var removals

sr=bzbarsky if you add another set of parens around the whole //.exec()
construction... (I think that will be more readable.)
Attachment #137926 - Flags: superreview?(bz-vacation) → superreview+
Created attachment 137949 [details] [diff] [review]
(Bv2b) |return null|, and var removals
[Checked in: Comment 12]

Bv2, with comment 9 suggestion(s).
Attachment #137926 - Attachment is obsolete: true
Attachment #137926 - Flags: review?(neil.parkwaycc.co.uk)
Comment on attachment 137949 [details] [diff] [review]
(Bv2b) |return null|, and var removals
[Checked in: Comment 12]


(Bv2) 'bz-vacation: superreview+'. (from comment 9)
Attachment #137949 - Flags: superreview+
Attachment #137949 - Flags: review?(neil.parkwaycc.co.uk)

Updated

15 years ago
Attachment #137949 - Flags: review?(neil.parkwaycc.co.uk) → review+
Comment on attachment 137949 [details] [diff] [review]
(Bv2b) |return null|, and var removals
[Checked in: Comment 12]


Check in: { 12/25/2003 16:01	neil%parkwaycc.co.uk	1.61 }
Attachment #137949 - Attachment description: (Bv2b) |return null|, and var removals → (Bv2b) |return null|, and var removals [Checked in: Comment 12]
Attachment #137949 - Attachment is obsolete: true
Status: NEW → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → FIXED
[Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.6) Gecko/20040113] (W98SE)

Argh ... This patch(s) is not in v1.6: too bad ;-<
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.