Closed Bug 344641 Opened 18 years ago Closed 18 years ago

In <connection-xpcom.js>, "Warning: function CBSConnection does not always return a value"

Categories

(Other Applications :: ChatZilla, defect)

defect
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: sgautherie, Assigned: bugzilla-mozilla-20000923)

References

Details

(Keywords: regression, Whiteboard: [cz-0.9.76])

Attachments

(1 file)

[Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8.1b1) Gecko/20060713 SeaMonkey/1.1a] (nightly) (W98SE) When starting ChatZilla for the first time: [ Warning: function CBSConnection does not always return a value Source File: chrome://chatzilla/content/lib/js/connection-xpcom.js Line: 164 Source Code: } ]
I'm going to suggest WONTFIX; this is actually deliberate code. The function is only ever called as a constructor, and needs to |return null| in certain cases. Could make it |return this| at the end, but that seems needlessly stupid.
OS: Windows 98 → All
Hardware: PC → All
Version: 1.8 Branch → Trunk
I'd prefer the warning to be silenced, even if there is no underlying issue: keep the Error Console clean, don't waste time reporting/searching bugs, ....
[Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8.1b1) Gecko/20060801 SeaMonkey/1.1a] (nightly) (W98SE) [CZ-0.9.75] (Bug still there, of course.)
Blocks: 329440
Keywords: regression
Assignee: rginda → silver
Status: NEW → ASSIGNED
Attachment #231577 - Flags: review?(samuel)
Attachment #231577 - Flags: review?(samuel) → review+
Attachment #231577 - Flags: approval-seamonkey1.1a?
Whiteboard: [checkin needed]
Comment on attachment 231577 [details] [diff] [review] Return |this| to quiet warning The original code is bogus. There should be a strict warning for trying to uselessly return a value inside a constructor, as the value gets ignored.
Attachment #231577 - Flags: approval-seamonkey1.1a? → approval-seamonkey1.1a-
(In reply to comment #5) >(From update of attachment 231577 [details] [diff] [review] [edit]) >The original code is bogus. There should be a strict warning for trying to >uselessly return a value inside a constructor, as the value gets ignored. Well, "return null;" gets ignored; you have to return an object of some sort.
Horray for broken specs!
Also horray for warning about the bit that doesn't matter and not the bit that 'doesn't work'!
I would guess the warning gets shown at something like parse time, when it's unknown whether this will be used as a normal function or as a constructor
Checked in --> FIXED.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Whiteboard: [checkin needed] → [cz-0.9.76]
Neil, what kind of fix would you suggest / accept for 1.8.1 branch ? NB: SM v1.1 will get the current patch, whenever the branch upgrades to CZ v0.9.76 :-|
(In reply to comment #11) >Neil, what kind of fix would you suggest / accept for 1.8.1 branch ? I do not intend to learn the entire ChatZilla codebase to give an accurate answer. However, based on a cursory inspection of that code fragment, I would suggest that it needs to throw an exception. Failing that, the returns should be removed, leaving the assert as the last statement in the constuctor. >NB: SM v1.1 will get the current patch, whenever the branch upgrades to CZ >v0.9.76 :-| Fair enough.
Given the latest patch for bug 329440 we should back this out again.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Reverse fixed.
Status: REOPENED → RESOLVED
Closed: 18 years ago18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: