Closed
Bug 337885
Opened 17 years ago
Closed 17 years ago
Many xbl <setter>s don't return val
Categories
(Calendar :: Internal Components, defect)
Calendar
Internal Components
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: jminta, Assigned: ehsan.akhgari)
Details
(Whiteboard: [good first bug])
Attachments
(1 file)
15.54 KB,
patch
|
mattwillis
:
first-review+
jminta
:
second-review+
|
Details | Diff | Splinter Review |
When defining a <setter> in xbl, val should always be returned, to allow for some fancier bits of javascript. There are a ton of places in the code (mostly written by me) that don't do this.
Reporter | ||
Updated•17 years ago
|
Whiteboard: [good first bug]
Reporter | ||
Comment 1•17 years ago
|
||
All the setters in Calendar: http://landfill.mozilla.org/mxr-test/mozilla/search?string=%3Csetter%3E&find=calendar&filter=
Comment 2•17 years ago
|
||
The bugspam monkeys have struck again. They are currently chewing on default assignees for Calendar. Be afraid for your sanity!
Assignee: base → nobody
Assignee | ||
Comment 3•17 years ago
|
||
Added "return val;"s to setter method. Pay special attention to <http://landfill.mozilla.org/mxr-test/mozilla/source/calendar/base/content/calendar-month-view.xml#601> (that is marked with a comment in the patch.) I wasn't sure what to do about it, so I just left it as it is now (returning this.mIndex).
Assignee: nobody → ehsan.akhgari
Status: NEW → ASSIGNED
Attachment #235864 -
Flags: first-review?(jminta)
Reporter | ||
Comment 4•17 years ago
|
||
Comment on attachment 235864 [details] [diff] [review] Setter return val patch matt, can you take a first pass at this?
Attachment #235864 -
Flags: second-review?(jminta)
Attachment #235864 -
Flags: first-review?(mattwillis)
Attachment #235864 -
Flags: first-review?(jminta)
Comment 5•17 years ago
|
||
Comment on attachment 235864 [details] [diff] [review] Setter return val patch >Index: calendar/base/content/calendar-month-view.xml >=================================================================== >@@ -594,16 +596,17 @@ > <setter><![CDATA[ > this.mIndex = val % 7; > > var label = document.getAnonymousElementByAttribute(this, "anonid", "label"); > var dayName = calGetString("dateFormat", "day." + (this.mIndex+1) + ".name"); > label.setAttribute("value", dayName); > > return this.mIndex; >+ /* should this return this.mIndex directly? */ > ]]></setter> I think this is fine to leave alone. It's returning val % 7, and since we're already returning a value, we may be using it elsewhere. Otherwise, r1=lilmatt. Nice job.
Attachment #235864 -
Flags: first-review?(mattwillis) → first-review+
Reporter | ||
Comment 6•17 years ago
|
||
Comment on attachment 235864 [details] [diff] [review] Setter return val patch This looks great. I agree that returning this.mIndex is fine, since it's just a number. r2=jminta Thanks for the patch!
Attachment #235864 -
Flags: second-review?(jminta) → second-review+
Comment 7•17 years ago
|
||
Patch checked in on MOZILLA_1_8_BRANCH and trunk. -> FIXED Thanks!
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•