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

RESOLVED FIXED in mozilla1.8beta1

Status

--
minor
RESOLVED FIXED
15 years ago
14 years ago

People

(Reporter: sgautherie, Assigned: sgautherie)

Tracking

Trunk
mozilla1.8beta1

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(8 obsolete attachments)

(Assignee)

Description

15 years ago
[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
(Assignee)

Comment 1

15 years ago
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.

Comment 2

15 years ago
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);
}
(Assignee)

Comment 3

15 years ago
Created attachment 140600 [details] [diff] [review]
(Av1) "mailnews/" <abCardOverlay.js>

Bug fix, plus some reformatting/var. removal/etc.
Assignee: sspitzer → gautheri
Status: NEW → ASSIGNED
(Assignee)

Updated

15 years ago
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.
(Assignee)

Updated

15 years ago
Attachment #140600 - Attachment is obsolete: true
Attachment #140600 - Flags: review?(neil.parkwaycc.co.uk)
(Assignee)

Comment 5

15 years ago
Created attachment 140767 [details] [diff] [review]
(Av1a) "mailnews/" <abCardOverlay.js>

Av1, with comment 4 suggestion(s).
(Assignee)

Updated

15 years ago
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-
(Assignee)

Updated

15 years ago
Attachment #140767 - Attachment is obsolete: true
(Assignee)

Comment 7

15 years ago
Created attachment 140771 [details] [diff] [review]
(Av2) "mailnews/" <abCardOverlay.js>
[Wrong attachment :-(]

Av1a, with comment 6 suggestion(s).
(Assignee)

Updated

15 years ago
Attachment #140771 - Attachment description: (Av2) <abCardOverlay.js> → (Av2) <abCardOverlay.js> [Wrong attachment :-(]
Attachment #140771 - Attachment is obsolete: true
(Assignee)

Comment 8

15 years ago
Created attachment 140772 [details] [diff] [review]
(Av2a) "mailnews/" <abCardOverlay.js>

Av1a, with comment 6 suggestion(s).
(Assignee)

Updated

15 years ago
Attachment #140772 - Flags: review?(neil.parkwaycc.co.uk)

Updated

15 years ago
Attachment #140772 - Flags: review?(neil.parkwaycc.co.uk) → review+
(Assignee)

Updated

15 years ago
Attachment #140772 - Flags: superreview?(mscott)
(Assignee)

Comment 9

15 years ago
[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
(Assignee)

Updated

14 years ago
Attachment #140772 - Attachment is obsolete: true
Attachment #140772 - Flags: superreview?(mscott)
(Assignee)

Comment 10

14 years ago
Created attachment 169004 [details] [diff] [review]
(Av2b-MAS) <abCardOverlay.js>
[Check in: Comment 14]

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+
(Assignee)

Updated

14 years ago
Attachment #169004 - Attachment description: (Av2b) <abCardOverlay.js> → (Av2b) "mailnews/" <abCardOverlay.js>
(Assignee)

Updated

14 years ago
Attachment #140767 - Attachment description: (Av1a) <abCardOverlay.js> → (Av1a) "mailnews/" <abCardOverlay.js>
(Assignee)

Updated

14 years ago
Attachment #140600 - Attachment description: (Av1) <abCardOverlay.js> → (Av1) "mailnews/" <abCardOverlay.js>
(Assignee)

Updated

14 years ago
Attachment #140771 - Attachment description: (Av2) <abCardOverlay.js> [Wrong attachment :-(] → (Av2) "mailnews/" <abCardOverlay.js> [Wrong attachment :-(]
(Assignee)

Updated

14 years ago
Attachment #140772 - Attachment description: (Av2a) <abCardOverlay.js> → (Av2a) "mailnews/" <abCardOverlay.js>
(Assignee)

Comment 11

14 years ago
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)
(Assignee)

Comment 12

14 years ago
[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

Updated

14 years ago
Attachment #169004 - Flags: superreview?(bienvenu) → superreview+
I think I fixed the bitrot ok, but leaving the bug open just in case...
(Assignee)

Comment 14

14 years ago
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
(Assignee)

Updated

14 years ago
Target Milestone: --- → mozilla1.8beta
(Assignee)

Comment 15

14 years ago
Created attachment 171699 [details] [diff] [review]
(Bv1-MAS) <abCardOverlay.js>
[Checked in: Comment 16]

Fixes a (indentation) nit from Av2b.

Neil,
Can you check it in on my behalf ? Thanks. (assuming implicit same r+/sr+)
(Assignee)

Updated

14 years ago
Whiteboard: [20050119-SG: I'll soon upload the TB port of this patch]
(Assignee)

Comment 16

14 years ago
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
(Assignee)

Comment 17

14 years ago
Created attachment 171817 [details] [diff] [review]
(Cv1-TB) <abCardOverlay.js>
[Checked in: Comment 24]

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)
(Assignee)

Comment 18

14 years ago
Created attachment 171819 [details] [diff] [review]
(Dv1-MAS) <abCardOverlay.js>
[Checked in: Comment 23]

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+)
(Assignee)

Updated

14 years ago
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.
(Assignee)

Comment 20

14 years ago
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)

Updated

14 years ago
Attachment #171819 - Flags: superreview+
Attachment #171819 - Flags: review+

Updated

14 years ago
Attachment #171817 - Flags: superreview?(bienvenu)
Attachment #171817 - Flags: superreview+
Attachment #171817 - Flags: review?(bienvenu)
Attachment #171817 - Flags: review+
(Assignee)

Comment 21

14 years ago
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?
(Assignee)

Comment 22

14 years ago
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?

Updated

14 years ago
Attachment #171819 - Flags: approval1.8b3? → approval1.8b3+
(Assignee)

Comment 23

14 years ago
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

Updated

14 years ago
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)
(Assignee)

Updated

14 years ago
Attachment #171817 - Attachment description: (Cv1-TB) <abCardOverlay.js> (checked in) → (Cv1-TB) <abCardOverlay.js> [Checked in: Comment 24]
Attachment #171817 - Attachment is obsolete: true
(Assignee)

Updated

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