Closed Bug 374121 Opened 13 years ago Closed 13 years ago

Strict warnings in calendarWindow.js, calendar-month-view.xml, calGoogleCalendar.js, calGoogleSession.js

Categories

(Calendar :: General, defect, trivial)

defect
Not set
trivial

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ssitter, Assigned: ssitter)

Details

Attachments

(1 file)

There are some strict warnings in calendarWindow.js, calendar-month-view.xml, calGoogleCalendar.js and calGoogleSession.js:

Warning: trailing comma is not legal in ECMA-262 object initializers
Source File: chrome://calendar/content/calendarWindow.js
Line: 78, Column: 3
Source Code:
   };

-> Solution: remove trailing comma

Warning: anonymous function does not always return a value
Source File: chrome://calendar/content/calendar-month-view.xml
Line: 127, Column: 12
Source Code:
            }

-> Solution: from looking at the .idl and the Thunderbird implementation there is no need to return anything from getFlavorData() -> remove return

Warning: function cGC_general_response does not always return a value
Source File: file:///C:/[...]/calGoogleCalendar.js
Line: 806, Column: 4
Source Code:
    }

-> Solution: return null in error case

Warning: test for equality (==) mistyped as assignment (=)?
Source File: file:///C:/[...]/calGoogleSession.js
Line: 386, Column: 56
Source Code:
                while (request = this.mItemQueue.shift()) {

-> Solution: add another pair of braces
Attachment #258707 - Flags: first-review?(lilmatt)
Comment on attachment 258707 [details] [diff] [review]
rev0 - fix strict warnings

>Index: mozilla/calendar/providers/gdata/components/calGoogleCalendar.js
>===================================================================
>             // Operation failed
>             aListener.onOperationComplete(this,
>                                           e.result,
>                                           aOperation,
>                                           null,
>                                           e.message);
>         }
>+        return null;
Add a comment here like "Returning null to avoid js strict warning"



>Index: mozilla/calendar/providers/gdata/components/calGoogleSession.js
>===================================================================
>                 // Process Items that were requested while logging in
>                 var request;
>-                while (request = this.mItemQueue.shift()) {
>+                while ((request = this.mItemQueue.shift())) {
Add a comment here like "Extra parentheses to avoid js strict warning"

r=lilmatt with those. (I'll address them on checkin for you) ;)
Attachment #258707 - Flags: first-review?(lilmatt) → first-review+
Patch checked in on MOZILLA_1_8_BRANCH and trunk.

-> FIXED
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.