Closed Bug 233036 Opened 20 years ago Closed 19 years ago

In <abCardOverlay.js>, "Warning: reference to undefined property window.arguments[0].QueryInterface"

Categories

(SeaMonkey :: MailNews: Address Book & Contacts, defect)

defect
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.8beta1

People

(Reporter: sgautherie, Assigned: sgautherie)

Details

Attachments

(8 obsolete files)

[Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.6) Gecko/20040113] (W98SE)

{
Warning: reference to undefined property window.arguments[0].QueryInterface
Source File: chrome://messenger/content/addressbook/abCardOverlay.js
Line: 53
}

Reproducible: 100%
1. Window > Address Book > New Card
neil:
asking for your insight:

Code is
{{
  var cardproperty;

  // if one is passed in, use it
  try {
      cardproperty =
window.arguments[0].QueryInterface(Components.interfaces.nsIAbCard);     <-- 53 !
  }
  catch (ex) {
    cardproperty =
Components.classes["@mozilla.org/addressbook/cardproperty;1"].createInstance(Components.interfaces.nsIAbCard);
  }
}}

|window.arguments[0]| is (not null) '[object Object]'.

I don't know how to fix this code.
If you can make/be sure that window.arguments[0] exist, you could use

var cardproperty = window.arguments[0];
if (!(cardproperty instanceof Components.interfaces.nsIAbCard))
{
    cardproperty = Components.classes["@mozilla.org/addressbook/cardproperty;1"]
                             .createInstance(Components.interfaces.nsIAbCard);
}
Bug fix, plus some reformatting/var. removal/etc.
Assignee: sspitzer → gautheri
Status: NEW → ASSIGNED
Attachment #140600 - Flags: review?(neil.parkwaycc.co.uk)
Comment on attachment 140600 [details] [diff] [review]
(Av1) "mailnews/" <abCardOverlay.js>

>+    (("arguments" in window) && window.arguments[0] &&
window.arguments[0] might be a strict JS warning...

>+  var focus = (gEditCard.displayLastNameFirst)
>+              ? document.getElementById('LastName')
>+              : document.getElementById('FirstName');
I think I'd prefer if you used ? 'LastName' : 'FirstName' instead.
Attachment #140600 - Attachment is obsolete: true
Attachment #140600 - Flags: review?(neil.parkwaycc.co.uk)
Av1, with comment 4 suggestion(s).
Attachment #140767 - Flags: review?(neil.parkwaycc.co.uk)
Comment on attachment 140767 [details] [diff] [review]
(Av1a) "mailnews/" <abCardOverlay.js>

>+  var focus = document.getElementById(gEditCard.displayLastNameFirst
>+                                      ? 'LastName'
>+                                      : 'FirstName');
Might as well put these two on the same line.

>@@ -513,10 +499,8 @@ function CleanUpWebPage(webPage)
>   if ( webPage.length && webPage.search("://") == -1 )
>   {
>     // check for missing / on http://
>-    if ( webPage.substr(0, 6) == "http:/" )
>-      return( "http://" + webPage.substr(6) );
>-    else
>-      return( "http://" + webPage );
>+    return( "http://" + ((webPage.substr(0, 6) == "http:/")
>+                         ? webPage.substr(6) : webPage));
Whoops, I didn't spot this bit before. Unless you want to fix this to use the
uri fixup component, please leave this alone.
Attachment #140767 - Flags: review?(neil.parkwaycc.co.uk) → review-
Attachment #140767 - Attachment is obsolete: true
Av1a, with comment 6 suggestion(s).
Attachment #140771 - Attachment description: (Av2) <abCardOverlay.js> → (Av2) <abCardOverlay.js> [Wrong attachment :-(]
Attachment #140771 - Attachment is obsolete: true
Av1a, with comment 6 suggestion(s).
Attachment #140772 - Flags: review?(neil.parkwaycc.co.uk)
Attachment #140772 - Flags: review?(neil.parkwaycc.co.uk) → review+
Attachment #140772 - Flags: superreview?(mscott)
[Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7b) Gecko/20040421] (<-- 1.7rc1 !)
(W98SE)

mscott:
Did you miss this sr=? ?
Product: Browser → Seamonkey
Attachment #140772 - Attachment is obsolete: true
Attachment #140772 - Flags: superreview?(mscott)
Av2a, updated to current trunk.

Scott:
Could you super-review this more than 7 months old patch ?
Attachment #169004 - Flags: superreview?(mscott)
Attachment #169004 - Flags: review+
Attachment #169004 - Attachment description: (Av2b) <abCardOverlay.js> → (Av2b) "mailnews/" <abCardOverlay.js>
Attachment #140767 - Attachment description: (Av1a) <abCardOverlay.js> → (Av1a) "mailnews/" <abCardOverlay.js>
Attachment #140600 - Attachment description: (Av1) <abCardOverlay.js> → (Av1) "mailnews/" <abCardOverlay.js>
Attachment #140771 - Attachment description: (Av2) <abCardOverlay.js> [Wrong attachment :-(] → (Av2) "mailnews/" <abCardOverlay.js> [Wrong attachment :-(]
Attachment #140772 - Attachment description: (Av2a) <abCardOverlay.js> → (Av2a) "mailnews/" <abCardOverlay.js>
Comment on attachment 169004 [details] [diff] [review]
(Av2b-MAS) <abCardOverlay.js>
[Check in: Comment 14]

No super-review from <mscott@mozilla.org> since "2004-02-06" :-(
Attachment #169004 - Attachment description: (Av2b) "mailnews/" <abCardOverlay.js> → (Av2b-MAS) <abCardOverlay.js>
Attachment #169004 - Flags: superreview?(mscott) → superreview?(bienvenu)
[Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8a6) Gecko/20050111] (release) (W98SE)

Bug still there.
OS: Windows 98 → All
Hardware: PC → All
Attachment #169004 - Flags: superreview?(bienvenu) → superreview+
I think I fixed the bitrot ok, but leaving the bug open just in case...
Comment on attachment 169004 [details] [diff] [review]
(Av2b-MAS) <abCardOverlay.js>
[Check in: Comment 14]

(In reply to comment #13)
> I think I fixed the bitrot ok, but leaving the bug open just in case...

Changes in the checked in version:
{ 2005-01-18 15:28	neil%parkwaycc.co.uk	mozilla/ mailnews/ addrbook/
resources/ content/ abCardOverlay.js	   1.52 }

OnLoadNewCard(): |-125,11 +110,11| replaced by |+123,7 +108,7|
SetCardDialogTitle(): |top.window.title| had bitrotted to |document.title|.
Attachment #169004 - Attachment description: (Av2b-MAS) <abCardOverlay.js> → (Av2b-MAS) <abCardOverlay.js> [Check in: Comment 14]
Attachment #169004 - Attachment is obsolete: true
Target Milestone: --- → mozilla1.8beta
Fixes a (indentation) nit from Av2b.

Neil,
Can you check it in on my behalf ? Thanks. (assuming implicit same r+/sr+)
Whiteboard: [20050119-SG: I'll soon upload the TB port of this patch]
Comment on attachment 171699 [details] [diff] [review]
(Bv1-MAS) <abCardOverlay.js>
[Checked in: Comment 16]


Check in: { 2005-01-19 01:42	neil%parkwaycc.co.uk	mozilla/ mailnews/
addrbook/ resources/ content/ abCardOverlay.js	     1.53 }
Attachment #171699 - Attachment description: (Bv1-MAS) <abCardOverlay.js> → (Bv1-MAS) <abCardOverlay.js> [Checked in: Comment 16]
Attachment #171699 - Attachment is obsolete: true
Av2b and Bv1, ported to TB.

I don't use TB: Could you test/review/check in this patch ? Thanks.
Attachment #171817 - Flags: review?(bienvenu)
Fixes a few more nits found while preparing Cv1-TB port.

Better to keep the 2 file contents identical.

Neil,
Can you check it in on my behalf ? Thanks. (assuming implicit same r+/sr+)
Whiteboard: [20050119-SG: I'll soon upload the TB port of this patch]
Serge, these patches seem to work on TB & MAS without causing problems (I've
just tested them with todays trunk) you possibly just need to give neil & david
a nudge to get them reviewed.
Comment on attachment 171817 [details] [diff] [review]
(Cv1-TB) <abCardOverlay.js>
[Checked in: Comment 24]

David (or Scott):

This has been working in MAS trunk for 4 months, and Mark has now tested it in
TB too.
Attachment #171817 - Flags: superreview?(bienvenu)
Attachment #171819 - Flags: superreview+
Attachment #171819 - Flags: review+
Attachment #171817 - Flags: superreview?(bienvenu)
Attachment #171817 - Flags: superreview+
Attachment #171817 - Flags: review?(bienvenu)
Attachment #171817 - Flags: review+
Comment on attachment 171819 [details] [diff] [review]
(Dv1-MAS) <abCardOverlay.js>
[Checked in: Comment 23]

'approval1.8b3=?': (SeaMonkey only)
Trivial U.I. code cleanup, no risk.
Attachment #171819 - Flags: approval1.8b3?
Comment on attachment 171817 [details] [diff] [review]
(Cv1-TB) <abCardOverlay.js>
[Checked in: Comment 24]

'approval1.8b3=?':
(Trivial) U.I. code cleanup, no risk.
(Has already been in SeaMonkey for months, mostly)
Attachment #171817 - Flags: approval1.8b3?
Attachment #171819 - Flags: approval1.8b3? → approval1.8b3+
Comment on attachment 171819 [details] [diff] [review]
(Dv1-MAS) <abCardOverlay.js>
[Checked in: Comment 23]


Check in: { 2005-07-08 17:23	neil%parkwaycc.co.uk	mozilla/ mailnews/
addrbook/ resources/ content/ abCardOverlay.js	     1.55 }
Attachment #171819 - Attachment description: (Dv1-MAS) <abCardOverlay.js> → (Dv1-MAS) <abCardOverlay.js> [Checked in: Comment 23]
Attachment #171819 - Attachment is obsolete: true
Attachment #171817 - Flags: approval1.8b3? → approval1.8b4+
Comment on attachment 171817 [details] [diff] [review]
(Cv1-TB) <abCardOverlay.js>
[Checked in: Comment 24]

I just checked this in:
/cvsroot/mozilla/mail/components/addrbook/content/abCardOverlay.js,v  <-- 
abCardOverlay.js
new revision: 1.8; previous revision: 1.7
Attachment #171817 - Attachment description: (Cv1-TB) <abCardOverlay.js> → (Cv1-TB) <abCardOverlay.js> (checked in)
Attachment #171817 - Attachment description: (Cv1-TB) <abCardOverlay.js> (checked in) → (Cv1-TB) <abCardOverlay.js> [Checked in: Comment 24]
Attachment #171817 - Attachment is obsolete: true
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: