Closed Bug 339091 Opened 18 years ago Closed 18 years ago

More JS strict warnings

Categories

(Core Graveyard :: XForms, defect)

defect
Not set
trivial

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: allan, Assigned: allan)

References

()

Details

(Keywords: fixed1.8.0.5, fixed1.8.1)

Attachments

(1 file)

Warning: test for equality (==) mistyped as assignment (=)?
Source File: chrome://xforms/content/input-xhtml.xml
Line: 345, Column: 48
Source Code:
                while (child = walker.nextNode()) {

Warning: function getDaysCount does not always return a value
Source File: chrome://xforms/content/widgets.xml
Line: 244, Column: 7
Status: NEW → ASSIGNED
Attached patch PatchSplinter Review
I'm a bit unsure about the "return 0". We could throw an error or something? But we have no generic mechanism in place for that now, do we?
Attachment #223168 - Flags: review?(Olli.Pettay)
Comment on attachment 223168 [details] [diff] [review]
Patch

IMO, it is ok to return 0.
Attachment #223168 - Flags: review?(Olli.Pettay) → review+
(In reply to comment #0)
> Warning: test for equality (==) mistyped as assignment (=)?
> Source File: chrome://xforms/content/input-xhtml.xml
> Line: 345, Column: 48
> Source Code:
>                 while (child = walker.nextNode()) {
> 

It's not bug. Probably we should do some changes in syntacsis to avoid that warning.

> Warning: function getDaysCount does not always return a value
> Source File: chrome://xforms/content/widgets.xml
> Line: 244, Column: 7
> 

As you said we can return 0. In any case it's not matter because the value of calendar is setted by using 'value' property and that property can't lead to error month values I guess.
(In reply to comment #3)
> (In reply to comment #0)
> > Warning: test for equality (==) mistyped as assignment (=)?
> > Source File: chrome://xforms/content/input-xhtml.xml
> > Line: 345, Column: 48
> > Source Code:
> >                 while (child = walker.nextNode()) {
> > 
> 
> It's not bug. Probably we should do some changes in syntacsis to avoid that
> warning.

That is what the patch does ;-)
Comment on attachment 223168 [details] [diff] [review]
Patch


>           }
>+          // XXX: throw error?
>+          return 0;

I guess we don't need in XXX comment. We report about error by returning zero value.
(In reply to comment #4)

> 
> That is what the patch does ;-)
> 

Yes :)), I didn't look at it. I like the patch excepting XXX comment.
(In reply to comment #6)
> (In reply to comment #4)
> 
> > 
> > That is what the patch does ;-)
> > 
> 
> Yes :)), I didn't look at it. I like the patch excepting XXX comment.

:) Fixed on trunk.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Whiteboard: xf-to-branch
Keywords: fixed1.8.1
Keywords: fixed1.8.0.5
Whiteboard: xf-to-branch
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: