Closed Bug 57650 Opened 24 years ago Closed 17 years ago

javascript strict warnings in MsgComposeCommands.js

Categories

(MailNews Core :: Composition, defect, P3)

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: bugzilla, Assigned: bugzilla)

Details

(Keywords: helpwanted)

Attachments

(1 file, 3 obsolete files)

JavaScript strict warning:
chrome://messenger/content/messengercompose/MsgComposeCommands.js line 661: refe
rence to undefined property args.body

JavaScript strict warning:
chrome://messenger/content/messengercompose/MsgComposeCommands.js line 677: refe
rence to undefined property args.to

JavaScript strict warning:
chrome://messenger/content/messengercompose/MsgComposeCommands.js line 679: refe
rence to undefined property args.cc

JavaScript strict warning:
chrome://messenger/content/messengercompose/MsgComposeCommands.js line 681: refe
rence to undefined property args.bcc

JavaScript strict warning:
chrome://messenger/content/messengercompose/MsgComposeCommands.js line 683: refe
rence to undefined property args.newsgroups

JavaScript strict warning:
chrome://messenger/content/messengercompose/MsgComposeCommands.js line 685: refe
rence to undefined property args.subject

JavaScript strict warning:
chrome://messenger/content/messengercompose/MsgComposeCommands.js line 687: refe
rence to undefined property args.attachment

JavaScript strict warning:
chrome://messenger/content/messengercompose/MsgComposeCommands.js line 689: refe
rence to undefined property args.newshost

args newshost = undefined
JavaScript strict warning:
chrome://messenger/content/messengercompose/MsgComposeCommands.js line 690: refe
rence to undefined property args.newshost

JavaScript strict warning:
chrome://messenger/content/messengercompose/MsgComposeCommands.js line 581: refe
rence to undefined property args.preselectid

JavaScript strict warning:
chrome://messenger/content/messengercompose/MsgComposeCommands.js line 613: refe
rence to undefined property args.originalMsg

JavaScript strict warning:
chrome://messenger/content/messengercompose/MsgComposeCommands.js line 613: refe
rence to undefined property args.fieldsAddr
change product/component
Assignee: kmcclusk → ducarroz
Component: Compositor → Composition
Product: Browser → MailNews
QA Contact: petersen → esther
Summary: Lots of strict warnings in MsgComposeCommands.js → javascript strict warnings in MsgComposeCommands.js
I don't think so I can do anything for that as those properties are created
dynamically depending on the content of the window's argument. Anyway, this part
of the code is going away soon as now I pass argument throught a nsIsupport
object, no more need for dynamically created properties.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → WONTFIX
Henrik - is it possible for you to verify these as fixed? Thanks!
havent seen this warn anymore, so verified
Status: RESOLVED → VERIFIED
JavaScript strict warning:
chrome://messenger/content/messengercompose/MsgComposeCommands.js line 644: refe
rence to undefined property window.arguments[0].QueryInterface

JavaScript strict warning:
chrome://messenger/content/messengercompose/MsgComposeCommands.js line 671: refe
rence to undefined property args.type

JavaScript strict warning:
chrome://messenger/content/messengercompose/MsgComposeCommands.js line 673: refe
rence to undefined property args.format

JavaScript strict warning:
chrome://messenger/content/messengercompose/MsgComposeCommands.js line 675: refe
rence to undefined property args.originalMsg

JavaScript strict warning:
chrome://messenger/content/messengercompose/MsgComposeCommands.js line 677: refe
rence to undefined property args.preselectid

JavaScript strict warning:
chrome://messenger/content/messengercompose/MsgComposeCommands.js line 679: refe
rence to undefined property args.to

JavaScript strict warning:
chrome://messenger/content/messengercompose/MsgComposeCommands.js line 681: refe
rence to undefined property args.cc

JavaScript strict warning:
chrome://messenger/content/messengercompose/MsgComposeCommands.js line 683: refe
rence to undefined property args.bcc

JavaScript strict warning:
chrome://messenger/content/messengercompose/MsgComposeCommands.js line 685: refe
rence to undefined property args.newsgroups

JavaScript strict warning:
chrome://messenger/content/messengercompose/MsgComposeCommands.js line 691: refe
rence to undefined property args.newshost
Status: VERIFIED → REOPENED
Resolution: WONTFIX → ---
With the latest build:
JavaScript strict warning:
chrome://messenger/content/messengercompose/MsgComposeCommands.js line 1698: 
redeclaration of var obj

JavaScript strict warning:
chrome://messenger/content/messengercompose/MsgComposeCommands.js line 1751: 
redeclaration of var obj
Warning: redeclaration of var i
Source File: chrome://messenger/content/messengercompose/MsgComposeCommands.js
Line: 854, Column: 17
Source Code:
        for (var i=1; i <= MAX_RECIPIENTS; i++) 

Warning: redeclaration of var result
Source File: chrome://messenger/content/messengercompose/MsgComposeCommands.js
Line: 1762, Column: 16
Source Code:
            var result = {value:0};

Warning: redeclaration of var obj
Source File: chrome://messenger/content/messengercompose/MsgComposeCommands.js
Line: 1992, Column: 16
Source Code:
            var obj = new Object;

Warning: redeclaration of var obj
Source File: chrome://messenger/content/messengercompose/MsgComposeCommands.js
Line: 2045, Column: 12
Source Code:
        var obj = new Object;
Assignee: ducarroz → stephend
Status: REOPENED → NEW
re-assiging to myself.  Varada, can you review this?
Comment on attachment 50484 [details] [diff] [review]
Patch

r=varada
Make sure indentation is proper.
Attachment #50484 - Flags: review+
Comment on attachment 50599 [details] [diff] [review]
Sexier, improved indentation patch

r=varada, by mail.
Attachment #50599 - Flags: review+
Comment on attachment 50599 [details] [diff] [review]
Sexier, improved indentation patch

sr=sspitzer
Thanks Seth and Varada.  Fix committed.
Status: NEW → RESOLVED
Closed: 24 years ago23 years ago
Resolution: --- → FIXED
hmmm something went wrong here:
I'm still seeing a *lot* of warnings ala:

Warning: reference to undefined property window.arguments[0].QueryInterface
Source File: chrome://messenger/content/messengercompose/MsgComposeCommands.js
Line: 1012

Warning: reference to undefined property args.type
Source File: chrome://messenger/content/messengercompose/MsgComposeCommands.js
Line: 1037

to reproduce:
Go to:
http://bugzilla.mozilla.org/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=RESOLVED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&bugidtype=include&bug_id=&changedin=1&votes=&chfield=%5BBug+creation%5D&chfieldfrom=&chfieldto=Now&chfieldvalue=&product=Browser&product=MailNews&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&status_whiteboard=&status_whiteboard_type=substring&keywords=&keywords_type=anywords&field0-0-0=noop&type0-0-0=noop&value0-0-0=&cmdtype=doit&newqueryname=&order=Reuse+same+sort+as+last+time
press File -> Send Page
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
There have been 5 checkins since my JS strict fix...back to Seth (I can't fix these)
Assignee: stephend → ducarroz
Status: REOPENED → NEW
QA Contact: esther → sheelar
-->varada
Assignee: ducarroz → varada
when selecting a local folder via the Options -> File Sent Message:

Warning: assignment to undeclared variable destUri
Source File: chrome://messenger/content/messengercompose/MsgComposeCommands.js
Line: 1559
now I'm also seeing a lot of these:
Warning: reference to undefined property gIOService.offline
Source File: chrome://messenger/content/messengercompose/MsgComposeCommands.js
Line: 647
Attached patch fixes the destUri warning (obsolete) — Splinter Review
Henrik: any steps on how to reproduce the other warning?
when selecting a local folder via the Options -> File Sent Message:

Warning: assignment to undeclared variable destUri
Source File: chrome://messenger/content/messengercompose/MsgComposeCommands.js
Line: 1730

20020117
Dont check anything in yet, since the patch is not complete.
To see a lot of warnings exit mozilla and do:
mozilla.exe -composer -jsconsole
the console almost gets flooded.

I have a patch that fixes everyone of them except:
Warning: reference to undefined property window.arguments[0].QueryInterface
Source File: chrome://messenger/content/messengercompose/MsgComposeCommands.js
Line: 1162

please help me get rid of that one!
Attachment #63720 - Attachment is obsolete: true
stephend: can you do the review and checkin.
anybody up for a review here? Please...
CC'ing people go get review
Warning: assignment to undeclared variable cell
Source File: chrome://messenger/content/messengercompose/MsgComposeCommands.js
Line: 2228

Warning: assignment to undeclared variable i
Source File: chrome://messenger/content/messengercompose/MsgComposeCommands.js
Line: 158

someone could just take my last patch and fix those two warnings.
Comment on attachment 65612 [details] [diff] [review]
Final patch. Unsure when that QueryInterface is used.

looks great
r=morten@nilsen.com
Attachment #65612 - Flags: review+
QA Contact: sheelar → stephend
Varada, any update on this?  There are really a lot of warnings.  The patch (8
months old?) does make them go away.
taking all of varada's bugs.
Assignee: varada → sspitzer
Current CVS, Linux: Whenever i hit reply on a msg, these three errors and
warnings appear in JS Console:

Error: can't convert Error to string

Error: sMsgComposeService is not defined
Source File: chrome://messenger/content/messengercompose/MsgComposeCommands.js
Line: 1023

Warning: reference to undefined property
Components.classes['@mozilla.org/ldapprefs-service;1']
Source File: chrome://messenger/content/messengercompose/MsgComposeCommands.js
Line: 131

(i'b building with --disable-ldap if that matters)
Attachment #65612 - Flags: superreview?(neil.parkwaycc.co.uk)
Warning ``assignment to undeclared variable statusText'' [xs] in file
``chrome://messenger/content/messengercompose/MsgComposeCommands.js'', line 354,
character 0.
Stopped for error handler.
#0: function anonymous(aWebProgress=null:null, aRequest=null:null,
aStatus=integer:0, aMessage=string:"") in
<chrome://messenger/content/messengercompose/MsgComposeCommands.js> line 354
352: // therefore we need to protect ourself by using try/catch
353: try {
354: statusText = document.getElementById("statusText");
355: if (statusText)
356: statusText.setAttribute("label", aMessage);
Keywords: helpwanted
Assignee: sspitzer → bugzilla
Comment on attachment 65612 [details] [diff] [review]
Final patch. Unsure when that QueryInterface is used.

>-          if (gIOService && gIOService.offline)
>+          if (gIOService && "offline" in gIOService && gIOService.offline)
Um, no. If gIOService exists then it implements nsIIOService so it certainly
supports offline.

>-        params = window.arguments[0].QueryInterface(Components.interfaces.nsIMsgComposeParams);
>+        if ("QueryInterface" in window.arguments[0])
>+          params = window.arguments[0].QueryInterface(Components.interfaces.nsIMsgComposeParams);
Bitrotted, no longer necessary.

>-      if (args.bodyislink == "true")
>+      if ("bodyislink" in args && args.bodyislink == "true")
The correct fix for these is for the method that creates args to ensure that
all of these properties are set to a null or empty string.

>               cleanBody = unescape(body);
>             } catch(e) { cleanBody = body;}
> 
>-            msgCompFields.body = "<BR><A HREF=\"" + body + "\">" + cleanBody + "</A><BR>";
>+            msgCompFields.body = "<br><a href=\"" + body + "\">" + cleanBody + "</a><br>";
While you're here perhaps you'd like to HTML escape the cleanBody?

>-  destUri = menuItem.getAttribute('id');
>+  var destUri = menuItem.getAttribute('id');
IIRC menuItem.id should work just as well, if not better.
Attachment #65612 - Flags: superreview?(neil.parkwaycc.co.uk) → superreview-
Product: MailNews → Core
(In reply to R.K.Aa. comment #31)
> Current CVS, Linux: Whenever i hit reply on a msg, these three errors and
> warnings appear in JS Console:
> 
> Error: can't convert Error to string
> 
> Error: sMsgComposeService is not defined
> Source File: chrome://messenger/content/messengercompose/MsgComposeCommands.js
> Line: 1023
> 
> Warning: reference to undefined property
> Components.classes['@mozilla.org/ldapprefs-service;1']
> Source File: chrome://messenger/content/messengercompose/MsgComposeCommands.js
> Line: 131
> 
> (i'b building with --disable-ldap if that matters)


I don't see these (on XP)
Andrew
Karsten
Henrik
on non-windows, do you see comment 31, comment 27, and issues after 200-09-24?

only checkin from this bug is 1.213 stephend%netscape.com 2001-09-24 21:16, so Henrik's attachment 65612 [details] [diff] [review] was never checked in. I think the last items corrections to be done were for linux, which I can't test.

Severity: normal → minor
dont think it's valid anymore
Status: NEW → RESOLVED
Closed: 23 years ago17 years ago
Resolution: --- → INVALID
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: