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)
Other Applications
ChatZilla
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: sgautherie, Assigned: bugzilla-mozilla-20000923)
References
Details
(Keywords: regression, Whiteboard: [cz-0.9.76])
Attachments
(1 file)
821 bytes,
patch
|
samuel
:
review+
neil
:
approval-seamonkey1.1a-
|
Details | Diff | Splinter Review |
[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:
}
]
Assignee | ||
Comment 1•18 years ago
|
||
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
Reporter | ||
Comment 2•18 years ago
|
||
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, ....
Reporter | ||
Comment 3•18 years ago
|
||
[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 | ||
Updated•18 years ago
|
Assignee: rginda → silver
Assignee | ||
Updated•18 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 4•18 years ago
|
||
Attachment #231577 -
Flags: review?(samuel)
Updated•18 years ago
|
Attachment #231577 -
Flags: review?(samuel) → review+
Reporter | ||
Updated•18 years ago
|
Attachment #231577 -
Flags: approval-seamonkey1.1a?
Reporter | ||
Updated•18 years ago
|
Whiteboard: [checkin needed]
Comment 5•18 years ago
|
||
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-
Comment 6•18 years ago
|
||
(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.
Assignee | ||
Comment 7•18 years ago
|
||
Horray for broken specs!
Assignee | ||
Comment 8•18 years ago
|
||
Also horray for warning about the bit that doesn't matter and not the bit that 'doesn't work'!
Comment 9•18 years ago
|
||
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
Assignee | ||
Comment 10•18 years ago
|
||
Checked in --> FIXED.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Whiteboard: [checkin needed] → [cz-0.9.76]
Reporter | ||
Comment 11•18 years ago
|
||
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 :-|
Comment 12•18 years ago
|
||
(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.
Comment 13•18 years ago
|
||
Given the latest patch for bug 329440 we should back this out again.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 14•18 years ago
|
||
Reverse fixed.
Status: REOPENED → RESOLVED
Closed: 18 years ago → 18 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•